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

Performance problems in the cave biome map generator when there is a large difference in total chances between different layers of depth. #829

Open
IntegratedQuantum opened this issue Dec 17, 2024 · 0 comments
Labels
optimization a performance problem that should be addressed or an optimization idea terrain

Comments

@IntegratedQuantum
Copy link
Member

The generator currently selects biomes randomly (using a slow linear algorithm), checks if they fit into the depth range, and discards them if not available. This can be pretty bad if one region has significantly higher chances (this may happen if an addon wants to replace all natural biomes in region, by setting the chances of its own biomes to 100000000).

I think a better solution would be to use a tree with a node for all distinct depth ranges, containing one precomputed alias table each.

@IntegratedQuantum IntegratedQuantum added enhancement a new feature or improvement optimization a performance problem that should be addressed or an optimization idea terrain labels Dec 17, 2024
@IntegratedQuantum IntegratedQuantum added this to the Long-Term Goals milestone Dec 17, 2024
@IntegratedQuantum IntegratedQuantum removed the enhancement a new feature or improvement label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization a performance problem that should be addressed or an optimization idea terrain
Projects
None yet
Development

No branches or pull requests

1 participant