View terrain at any distance

For people working on the C++ code.
Post Reply
MisterE
Member
Posts: 185
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

View terrain at any distance

by MisterE » Post

Would this be easy/possible to implement?

The idea is shamelessly taken from veloren
Image
https://veloren.net/

Veloren only recently implemented viewing terrain at any distance.

Some rough ideas of how it could be done: either save map data as the server loads it, or generate a preview from the seed. The goal is to get: 1) approximate average color of the nodes (pixels), and 2) height map of the terrain. Then, a simple pixelated image of the terrain color is mapped to a mesh of he terrain height and this is displayed in the distance. Each mapblock in the distance is its own rough mesh and image, and these are generated when the map is loaded, saved by the server, and sent to clients if/as they request them. When I say mesh, I mean a very rough mesh to save data. The trees and buildings, for example, should not be included. Basically, the mesh approximates the shape of the base terrain. As a player gets close to a mapblock, the mapblock is loaded, and details become visible like normal.

Infinite viewing is not necessary... just, send a large viewing range using this method would do.

User avatar
freshreplicant
Member
Posts: 67
Joined: Sun Aug 09, 2020 10:37
In-game: freshreplicant

Re: View terrain at any distance

by freshreplicant » Post

I think I saw a video about this being implemented in Veloren the other day actually. I don't have the technical know-how to weigh in, but from a users perspective this would be amazing.

User avatar
Linuxdirk
Member
Posts: 2713
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: View terrain at any distance

by Linuxdirk » Post

This actually was in the game once and was called "farmesh" but it was removed for some reason.

MisterE
Member
Posts: 185
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: View terrain at any distance

by MisterE » Post

Looking up farmesh, it looks like it was a good start, but go abandoned. It really would be nice for core devs to have another go at it

User avatar
v-rob
Developer
Posts: 813
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: View terrain at any distance

by v-rob » Post

Part of the problem with the farmesh is that it only previews generated terrain. If your map has a gigantic city or a huge crater from TNT blasts, the farmesh would only show what the map originally looked like. For small-scale buildings and suchlike, this isn't a problem, but largely modified maps aren't represented well.

Plus, the farmesh was from when nodes were hardcoded. Some more work would be necessary to make it work with Minetest's greater game versatility now. Even more so, the farmesh could only accurately (ish) represent 2D noise mapgens. 3D noise don't look quite right with the farmesh. Lua mapgens, which AFAIK can't be pre-generated, present even more of a problem.

So, while I do like the farmesh (when I occasionally play 0.3.1, I almost always turn it on), it presents a lot of problems for modern Minetest, and some thought would be necessary to reimplement it in a usable way.
GUI Core Developer | My Best Mods: Bridger - Slats - Stained Glass | To contact me, send a PM

Dragonop
Member
Posts: 1226
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: View terrain at any distance

by Dragonop » Post

v-rob wrote:
Wed Jan 13, 2021 18:02
Part of the problem with the farmesh is that it only previews generated terrain. If your map has a gigantic city or a huge crater from TNT blasts, the farmesh would only show what the map originally looked like. For small-scale buildings and suchlike, this isn't a problem, but largely modified maps aren't represented well.
Still better than a window into the cyan void, just hide it under some fog

User avatar
rubenwardy
Moderator
Posts: 6365
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: View terrain at any distance

by rubenwardy » Post

As well as farmesh, there's also farmap which was level of detail based - you'd see actual things in the distance at a lower resolution

Bedrock supports massive view ranges without these tricks which look terrible

User avatar
AspireMint
Member
Posts: 390
Joined: Mon Jul 09, 2012 12:59
GitHub: AspireMint
IRC: AspireMint
In-game: AspireMint
Location: Stuck at spawn

Re: View terrain at any distance

by AspireMint » Post

Idea: If you could edit mapblock (not in db), before it is sent, maybe it would be possible to view things in distance.
I mean, remove nodes that are not visible but still rendered in client which slows down things,
replace nodes that has running jobs (abm) or mesh to dummy nodes, or remove unnecessary blocks,
and just send "shell" (eg. dirt_with_grass blocks, not dirt lying under it).
And level of modified mapblock would depend on player settings (low-end device friendly).
So something like this: minetest.on_send_mapblock = function(player, mapblock) should return modified mapblock
(settings - player:get_mapblock_settings() ?)

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 0 guests