Getting a large view range in 5.7

For people working on the C++ code.
User avatar
rubenwardy
Moderator
Posts: 7021
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: London, United Kingdom
Contact:

Getting a large view range in 5.7

by rubenwardy » Post

Minetest 5.7.0 is coming with an improved graphics pipeline. One of the improvements is the ability to use more of the GPU by batching together mapblock meshes. This can result in significant performance improvements on modern computers, especially those with dedicated GPUs.

One caveat is that it still takes a long time to fully load the map.

Settings

In order to benefit from this performance improvement, you'll need to change the "Client Mesh Chunksize" (client_mesh_chunk) setting to 4 or 8. To increase your view range, you'll also need to increase a few more settings:

Code: Select all

client_mesh_chunk = 4
# ^ also try 8 if you have a dedicated GPU
viewing_range = 1000
client_mapblock_limit = 50000

# Server-side settings.
# Only change the following on singleplayer or LAN servers, this will cause a lot of network/resource use 
max_block_generate_distance = 63
max_block_send_distance = 63
Note that the bottleneck now is very much loading the map. You can change some settings to load a large view range when playing singleplayer, but it takes a while and is not advised on multiplayer servers

to do:
lhofhansl wrote:Note that at large viewing_range you really need to increase max_simultaneous_block_sends_per_client or the server simply cannot send the blocks fast enough.
You also must either apply #13277, or increase server_unload_unused_data_timeout to 180 or 240. Otherwise the server will unload the close blocks, which makes distant culled blocks visible, which are then sent to the client, only to be culled there, slowing the entire process down (and sending 2-5x as many blocks).

Gallery

Image
1200 nodes render distance, shadows, bloom, FXAA, 4K display @ 15 FPS (kilbith)

Image
2000 view range with bloom, 4k @ 7fps (kilbith)
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: Getting a large view range in 5.7

by freshreplicant » Post

Wow, looks amazing. Will have to see how much of that my RX580 can handle.

Lars
Developer
Posts: 26
Joined: Fri Oct 13, 2017 21:12
GitHub: lhofhansl

Re: Getting a large view range in 5.7

by Lars » Post

You meant client_mapblock_limit = 50000? 5000 is way too small.

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

Re: Getting a large view range in 5.7

by rubenwardy » Post

Lars wrote:
Sat Mar 11, 2023 20:18
You meant client_mapblock_limit = 50000? 5000 is way too small.
Yes, edited
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: Getting a large view range in 5.7

by ShadMOrdre » Post

These settings force the server to generate a 1km conical sphere in the direction the player is looking. This could easily be misused on a server, by errant players simlpy wandering around ungenerated areas of the world, forcing the server into an endless loop of generating such a large amount of terrain.

In previous versions, I set client_mapblock_limit to -1, and client_unload_unused_data_timeout to 3600, or 1 hour. With these two settings, I could generate a large area of the map, and could view the entirety of that generated area when disabling view distance. While loosing FPS, I could see all parts of the map that I had explored during this instance of playing. Once generated, the server was able to focus on other tasks, such as mobs.


In the new version, with these settings, the server seems to want to generate all terrain within the view distance. A view distance of 1km means the server is tied up until all the terrain in the direction the player is looking has been generated. If I simply turn, the server now has to generate the newly visible area.

This does not work.

I think that map gen distance should be a separate setting from view distance. While view distance can be set high, mapgen distance should not be. For lua mapgens, the problem is magnified.

This weird new behavior, and the disable draw distance bug, are cause enough to not release anything until this is resolved.

Server owners beware, the above settings will lag your server until or unless you've generated all desired terrain.

Shad

User avatar
Blockhead
Moderator
Posts: 2106
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Getting a large view range in 5.7

by Blockhead » Post

While I think this advice clearly is bad advice for a server operator, I thought it was really only intended for singleplayer. That could be made clearer. I definitely agree though that mapgen and view distances should be decoupled. Lastly, the view distance bug is already solved in 3e148e281.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Walker
Member
Posts: 2030
Joined: Tue Oct 03, 2017 09:22
In-game: Walker
Contact:

Re: Getting a large view range in 5.7

by Walker » Post

wooow

lets see what i can reach with my RX 6600 XT at 4K ;)

once 5.7.0 is out i will post FPS for 4K and 3x4k (wall)

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

Re: Getting a large view range in 5.7

by rubenwardy » Post

ShadMOrdre wrote:
Fri Mar 17, 2023 05:02
I think that map gen distance should be a separate setting from view distance. While view distance can be set high, mapgen distance should not be. For lua mapgens, the problem is magnified.
It is already - `max_block_generate_distance` is a server-side setting that sets how far the map is generated for clients.
ShadMOrdre wrote:
Fri Mar 17, 2023 05:02
Server owners beware, the above settings will lag your server until or unless you've generated all desired terrain.
This guide is intended for singleplayer, not for servers. I've edited the first post to make this clearer
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: Getting a large view range in 5.7

by ShadMOrdre » Post

@rubenwardy,

Thank you for the clarification.

Can you please trigger a Windows daily dev build with the latest commits for further testing please? Or is there a newer compiled RC somewhere?

Thanks again, in advance.


Shad

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: Getting a large view range in 5.7

by ShadMOrdre » Post

Just a thought, but MT is a client server application. The client is the server, in a manner of speaking, and all MT games require the server part of the application to "host" the world so that the client part of the application can connect to the "served" world.

So, while these settings were meant for single player, I would argue that there is no difference, and the user experience will suffer, regardless of singleplayer server or hosted multiplayer server.

Still, it is nice to have clarification on what settings have what effect.



Shad

User avatar
Walker
Member
Posts: 2030
Joined: Tue Oct 03, 2017 09:22
In-game: Walker
Contact:

Re: Getting a large view range in 5.7

by Walker » Post

THIS IS A GAME CHANGER !!!

really, this is unbelievable

first things first:
- OS: Kubunut 22.04 LTS
- Minetest: 5.7.0-dev-6cd2eea48 ( from today 5am UTC+2)

- GPU: RX 6600 XT
- CPU: Ryzen 9 5950x
- RAM: 128GB ( 3200MT/s dual channel; dual rank )

and now ...

woooooooooow

( all setting from first post merged )
client_mesh_chunk = 1 / 1x4K / 1000 viewdist. = 14fps
client_mesh_chunk = 8 / 1x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 3x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 1x8K / 1000 viewdist. = 61fps+ (max display refreshrate )

scene are:
- flat map gen
- camera at cloud level
- many trees ( jungle, pine and "normal" )

User avatar
初音 ミク
Member
Posts: 108
Joined: Wed Mar 03, 2021 07:17

Re: Getting a large view range in 5.7

by 初音 ミク » Post

On a laptop with Ryzen 2200U (integrated GPU) I can now play at 50+ fps on Walkers German-Creative-server with a viewing range of 400

50+ was determined in the spawn area with lots of trees @ 1280x720p windowed @ Kubuntu 22.04
初音 ミク = Hatsune Miku --- my page on Wikipedia > https://en.wikipedia.org/wiki/Hatsune_Miku

and now Walker's official mistress

User avatar
Blockhead
Moderator
Posts: 2106
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Getting a large view range in 5.7

by Blockhead » Post

One drawback I have noticed today: If your CPU is under heavy load and you are using a mesh chunk size bigger than 1, you will experience a noticeable delay between placing a node and that node actually appearing in the world, as the engine resolves the new mesh for that chunk.

I didn't experience this in multiplayer on my server for whatever reason, but very much did once I launched a singleplayer world, presumably because my CPU was a lot busier running the mods as well.

Mesh chunk size 8 worked fine in multiplayer, but in singleplayer 8 was a bad delay, 4 was barely tolerable and 2 worked fine. Are you allowed to use non-powers of two by the way?
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
lemonzest
Member
Posts: 23
Joined: Sun Mar 06, 2022 21:19
IRC: lemonzest
In-game: lemonzest

Re: Getting a large view range in 5.7

by lemonzest » Post

Image

MineClone2, 3840x2160, Medium Shadows, Fullscreen, 80s/90s FPS, 1000 view distance.

Thanks to this post my FPS dropping to 20s and below are fixed!

AMD Ryzen 7 3800X/48GB RAM/AMD Radeon RX 6600 XT

Fedora Linux 38 Cinnamon/Flatpak Minetest 5.7.0

fansosa
New member
Posts: 1
Joined: Tue May 23, 2023 18:06

Re: Getting a large view range in 5.7

by fansosa » Post

Wow, looks amazing. Will have to see how much of technifiser mods it can handle
Last edited by fansosa on Fri May 26, 2023 16:40, edited 3 times in total.

User avatar
Blockhead
Moderator
Posts: 2106
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Getting a large view range in 5.7

by Blockhead » Post

fansosa wrote:
Wed May 24, 2023 07:36
Wow, looks amazing. Will have to see how much of that my RX580 can handle.
I use a Sapphire RX580 4GB myself, and it is a big improvement even on that card. Though your CPU has to do some work to keep up too as I noted earlier, to generate those chunks. I recommend a chunksize of at most 8 in multiplayer. It even seems to run fine with a bit of dynamic shadows.
Attachments
bighorizon.jpeg
bighorizon.jpeg (178.51 KiB) Viewed 9765 times
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
lemonzest
Member
Posts: 23
Joined: Sun Mar 06, 2022 21:19
IRC: lemonzest
In-game: lemonzest

Re: Getting a large view range in 5.7

by lemonzest » Post

Image

Another MineClone 2 Shot :D after all this had loaded in the minetestserver process on the server had eaten 6.3GB of RAM!

Astrobe
Member
Posts: 628
Joined: Sun Apr 01, 2018 10:46

Re: Getting a large view range in 5.7

by Astrobe » Post

Blockhead wrote:
Thu May 11, 2023 06:59
One drawback I have noticed today: If your CPU is under heavy load and you are using a mesh chunk size bigger than 1, you will experience a noticeable delay between placing a node and that node actually appearing in the world, as the engine resolves the new mesh for that chunk.

I didn't experience this in multiplayer on my server for whatever reason, but very much did once I launched a singleplayer world, presumably because my CPU was a lot busier running the mods as well.
Can confirm. If I launch a server and a client on the same machine, all is fine. But when I use the "host server" and start playing, I observe lags. I guess the mesh recalculation (or whatever) is done in sequence with all of the rest of what the engine and client must do when you place/remove a node. This is not related to the player's action directly, as I also notice the lag when a script decides to remove a node.
Funny thing is that the selection node for the place node is drawn before the node appears.
My game? It's Minefall.

User avatar
Mantar
Member
Posts: 645
Joined: Thu Oct 05, 2017 18:46
Contact:

Re: Getting a large view range in 5.7

by Mantar » Post

Yeah, I had this. Framerate was a silky 60fps, but there'd be a one-second lag before any change (player or otherwise) became visible, though the selection box would update instantly. Reducing mesh chunk size from 8 to 6 fixed it for me. At least well enough that it's not noticeable on my machine now.
Lead dev of Exile, git repo: https://codeberg.org/Mantar/Exile

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

Re: Getting a large view range in 5.7

by Linuxdirk » Post

The best I get is 400 nodes with 60 FPS in 2K resolution.

Code: Select all

viewing_range = 400
max_block_send_distance = 25
block_send_optimize_distance = 13
max_block_generate_distance = 25
client_mapblock_limit = 15625
Due to testing I found out a good ratio on what to set the values to.
  • Processor: Intel Core i7 4790K
  • Graphics card: Zotac GeForce GTX 1080 (GP104)
  • RAM: 2x G.Skill 8 GB DDR3-1600 (16 GB total)
my (slightly older) setup
Attachments
s.jpg
s.jpg (684.62 KiB) Viewed 9496 times

Astrobe
Member
Posts: 628
Joined: Sun Apr 01, 2018 10:46

Re: Getting a large view range in 5.7

by Astrobe » Post

FWIW I found out after the fact that in some places, I had FPS drops in the case of a client and a server on the same machine this time. These settings mostly mitigate the problem (there's still lag when placing stairs, but I think it existed before that):

client_mesh_chunk=2
client_mapblock_limit=10000

I use a view range of 200.
My game? It's Minefall.

QBSteve
Member
Posts: 23
Joined: Wed Mar 15, 2023 00:00
In-game: QBSteve

Re: Getting a large view range in 5.7

by QBSteve » Post

Walker wrote:
Mon Mar 20, 2023 05:04
THIS IS A GAME CHANGER !!!

really, this is unbelievable

first things first:
- OS: Kubunut 22.04 LTS
- Minetest: 5.7.0-dev-6cd2eea48 ( from today 5am UTC+2)

- GPU: RX 6600 XT
- CPU: Ryzen 9 5950x
- RAM: 128GB ( 3200MT/s dual channel; dual rank )

and now ...

woooooooooow

( all setting from first post merged )
client_mesh_chunk = 1 / 1x4K / 1000 viewdist. = 14fps
client_mesh_chunk = 8 / 1x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 3x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 1x8K / 1000 viewdist. = 61fps+ (max display refreshrate )

scene are:
- flat map gen
- camera at cloud level
- many trees ( jungle, pine and "normal" )
What do the "1x4K", "3x4K" and "1x8K" mean?
Hello! I'm just some random person with an ancient 7 year old potato that is my laptop :)

User avatar
Walker
Member
Posts: 2030
Joined: Tue Oct 03, 2017 09:22
In-game: Walker
Contact:

Re: Getting a large view range in 5.7

by Walker » Post

QBSteve wrote:
Wed Dec 13, 2023 01:42
Walker wrote:
Mon Mar 20, 2023 05:04
THIS IS A GAME CHANGER !!!

really, this is unbelievable

first things first:
- OS: Kubunut 22.04 LTS
- Minetest: 5.7.0-dev-6cd2eea48 ( from today 5am UTC+2)

- GPU: RX 6600 XT
- CPU: Ryzen 9 5950x
- RAM: 128GB ( 3200MT/s dual channel; dual rank )

and now ...

woooooooooow

( all setting from first post merged )
client_mesh_chunk = 1 / 1x4K / 1000 viewdist. = 14fps
client_mesh_chunk = 8 / 1x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 3x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 1x8K / 1000 viewdist. = 61fps+ (max display refreshrate )

scene are:
- flat map gen
- camera at cloud level
- many trees ( jungle, pine and "normal" )
What do the "1x4K", "3x4K" and "1x8K" mean?
"1x4K" = playing on one 4K Display
"3x4K" = playing over all three 4K displays in front of me
"1x8K" = playing over all four 4K displays connected to my PC (where 4 times 4K is equivalent to an 8K display*)

*) 4 times 4K means 4 time 3840x2160 -> 4x3840x2160 = 33177600 pixels
and 8K means 7680x4320 which is also 33177600 pixels

QBSteve
Member
Posts: 23
Joined: Wed Mar 15, 2023 00:00
In-game: QBSteve

Re: Getting a large view range in 5.7

by QBSteve » Post

Walker wrote:
Wed Dec 13, 2023 08:11
QBSteve wrote:
Wed Dec 13, 2023 01:42
Walker wrote:
Mon Mar 20, 2023 05:04
THIS IS A GAME CHANGER !!!

really, this is unbelievable

first things first:
- OS: Kubunut 22.04 LTS
- Minetest: 5.7.0-dev-6cd2eea48 ( from today 5am UTC+2)

- GPU: RX 6600 XT
- CPU: Ryzen 9 5950x
- RAM: 128GB ( 3200MT/s dual channel; dual rank )

and now ...

woooooooooow

( all setting from first post merged )
client_mesh_chunk = 1 / 1x4K / 1000 viewdist. = 14fps
client_mesh_chunk = 8 / 1x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 3x4K / 1000 viewdist. = 61fps+ (max display refreshrate )
client_mesh_chunk = 8 / 1x8K / 1000 viewdist. = 61fps+ (max display refreshrate )

scene are:
- flat map gen
- camera at cloud level
- many trees ( jungle, pine and "normal" )
What do the "1x4K", "3x4K" and "1x8K" mean?
"1x4K" = playing on one 4K Display
"3x4K" = playing over all three 4K displays in front of me
"1x8K" = playing over all four 4K displays connected to my PC (where 4 times 4K is equivalent to an 8K display*)

*) 4 times 4K means 4 time 3840x2160 -> 4x3840x2160 = 33177600 pixels
and 8K means 7680x4320 which is also 33177600 pixels
I see, thanks! My 7yr old laptop has a i5-5200U with 8GB RAM. What settings should I use for optimal performance? (30 FPS is fine, 60 FPS is preferred)

Thanks in advance! :D
Hello! I'm just some random person with an ancient 7 year old potato that is my laptop :)

User avatar
Walker
Member
Posts: 2030
Joined: Tue Oct 03, 2017 09:22
In-game: Walker
Contact:

Re: Getting a large view range in 5.7

by Walker » Post

QBSteve wrote:
Wed Dec 13, 2023 23:39
Walker wrote:
Wed Dec 13, 2023 08:11
QBSteve wrote:
Wed Dec 13, 2023 01:42


What do the "1x4K", "3x4K" and "1x8K" mean?
"1x4K" = playing on one 4K Display
"3x4K" = playing over all three 4K displays in front of me
"1x8K" = playing over all four 4K displays connected to my PC (where 4 times 4K is equivalent to an 8K display*)

*) 4 times 4K means 4 time 3840x2160 -> 4x3840x2160 = 33177600 pixels
and 8K means 7680x4320 which is also 33177600 pixels
I see, thanks! My 7yr old laptop has a i5-5200U with 8GB RAM. What settings should I use for optimal performance? (30 FPS is fine, 60 FPS is preferred)

Thanks in advance! :D
client_mesh_chunk = 2 or 4 ( 4 has better fps but more lag )
and than increase you viewrange until you hit you desired framerate

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest