Cuberite Forum
World Generation on seperate thread. - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: World Generation on seperate thread. (/thread-194.html)



World Generation on seperate thread. - rs2k - 10-27-2011

What would it take to move the world generation and possibly loading onto a separate thread. I don't notice any lag with loading already generated chunks, but chunk generation certainly causes noticeable lag with more than one person on the server.

I'd imagine the lag would be unbearable with 10+ people on a new server.

I'm not familiar enough with the code to make a change like this yet, but I feel this is an important thing to do.


RE: Wordl Generation on seperate thread. - FakeTruth - 10-27-2011

Terrain can be generated by multiple jobs in seperate threads and it would be faster, I'm not sure how much faster it would be though, since multiple threads would be working on the same single chunk (which is pretty small anyway).

If you want to completely generate chunks independently from the gameplay thread you'll be facing quite some trouble. If I want to access a chunk I expect a result right away, but if you generate it on a seperate thread you more or less request to access the chunk and if it's not generated yet it'll say (right away) try again laterTongue This might cause quite some trouble, I'm not sure XD