Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query the hardware and initialize the settings for the best user experience #15630

Open
cosin15 opened this issue Jan 3, 2025 · 8 comments
Open
Labels
Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature @ Startup / Config / Util

Comments

@cosin15
Copy link
Contributor

cosin15 commented Jan 3, 2025

Problem

It is amazing how much the user experience improves when increasing the value of num_emerge_threads.
The sad thing is that I didn't know about this setting until recently.

Solutions

Query the hardware and initialize the settings for the best user-experience.

Alternatives

Don't hide num_emerge_threads

Additional context

No response

@cosin15 cosin15 added the Feature request Issues that request the addition or enhancement of a feature label Jan 3, 2025
@cosin15 cosin15 changed the title Automatically setting the Query the hardware and initialize the settings for the best user experience Jan 3, 2025
@kromka-chleba
Copy link
Contributor

The feature unfortunately causes some mapgen bugs: #9357

@appgurueu
Copy link
Contributor

The feature unfortunately causes some mapgen bugs: #9357

(Side note: I'm not sure how much of a problem this is with the special case of pure Lua mapgen which does not rely on overgeneration.)

@Zughy Zughy added Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature @ Startup / Config / Util and removed Feature request Issues that request the addition or enhancement of a feature labels Jan 3, 2025
@rubenwardy
Copy link
Contributor

See #13674

@cosin15
Copy link
Contributor Author

cosin15 commented Jan 3, 2025

The feature unfortunately causes some mapgen bugs: #9357

(Side note: I'm not sure how much of a problem this is with the special case of pure Lua mapgen which does not rely on overgeneration.)

What is this 'overgeneration' good for?

@SmallJoker
Copy link
Member

Related #5024


What is this 'overgeneration' good for?

It increases the chunk size that the mapgen is working with (default is 5³ mapblocks = (5*16)³ nodes) with an 1 mapblock wide border so that you can randomly place oversized/overlapping structures (such as trees) into it without instantly risking a cut-off.

@jeremyshannon
Copy link
Contributor

(Side note: I'm not sure how much of a problem this is with the special case of pure Lua mapgen which does not rely on overgeneration.)

Most mapgens use overgeneration, if this is supposed to be helpful for newbies who just loaded Luanti for the first time, inserting glitches into their brand-new Voxelibre map is gonna give a bad impression and defeat the whole point of the automatic setting initialization.

@cosin15
Copy link
Contributor Author

cosin15 commented Jan 4, 2025

Related #5024

What is this 'overgeneration' good for?

It increases the chunk size that the mapgen is working with (default is 5³ mapblocks = (5*16)³ nodes) with an 1 mapblock wide border so that you can randomly place oversized/overlapping structures (such as trees) into it without instantly risking a cut-off.

Does that imply that when mapgen runs, the chunk (5^3 blocks) might already have trees in it at the bottom?

This looks suspicious to me:
https://github.com/minetest/minetest/blob/5bcb7983ec1648b9993e4092be014308726af383/src/servermap.cpp#L206

The neighboring chunks need to be locked as well I guess since it is not just one chunk that is written to.

I also don't get, why this function should be multi threaded?

@lhofhansl
Copy link
Contributor

Couple of observations from my setup (with sqlite):

  • More emerge threads only help with generation. Loading already generated blocks actually slows down!
  • More emerge threads increase server lag, especially with expensive generation logic.
  • There are some bug, like cut-off trees.

Maybe things are different with different DB backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature @ Startup / Config / Util
Projects
None yet
Development

No branches or pull requests

8 participants