-
Notifications
You must be signed in to change notification settings - Fork 54
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
Optimize _draw_tiles function #7
Comments
Hi! Thanks for checking it out. |
Since all the generators will benefit from chunking, we should add chunking to the |
Yeah that sounds like the right idea! |
I think that the main problem with the drawing is that you are drawing everything at once. Even if its as efficient as possible you are still drawing millions of blocks, I had this problems with my game where the problems isn't the function itself it only took about 0.001 seconds, but rather the amount of times the function needed to happen. I don't know if its possible, but you don't technically have to draw everything at once you could just do it asynchronous by drawing 100 blocks every frame or something. If you unblock the main thread you realise that there was no performance problem in the first place. |
I did give this some thought, but in the end it seems like a chunk system will be implemented anyway so I don't think we need to make any optimization here. But if needed I support moving the tile rendering to another thread |
That makes sense though! I've never worked with threads so I'll have to look into it but that sounds better than implementing a chunk system for generators that don't need it (I'd prefer chunking to be only used for infinite worlds rather than static ones). |
Should we close this now that #29 was merged? |
HeightmapGenerator2D takes a very long time to generate. Tested with a 1750x900 world, it takes about 25 seconds with no modifiers, and the carver modifier only seems to add only about 2 seconds.
The text was updated successfully, but these errors were encountered: