01-27-2012, 08:35 PM
I started to move chunk generator and found some problems.
In your parallel version method cWorld::GetChunk returns 0 if there is not chunk and it start to generate it. Returning NULL is not correct because there is no result verification in some functions. Some other functions work incorrect with NULL. GetChunk is safety only with chunk generator in it.
I think that the solution of this problem is generating chunks in other place. Notch server generate 100 chunks near players. MCServer can do the same. On each Tick server will check all chunks near players and add tasks to ChunkGenerator if chunks don't exist.
If I'm right that the main problem is returnin NULL then generating immediate chunks will solve problem.
Did you find other bugs in your parallel ChunkGenerator? I didn't find anything bad.
In your parallel version method cWorld::GetChunk returns 0 if there is not chunk and it start to generate it. Returning NULL is not correct because there is no result verification in some functions. Some other functions work incorrect with NULL. GetChunk is safety only with chunk generator in it.
I think that the solution of this problem is generating chunks in other place. Notch server generate 100 chunks near players. MCServer can do the same. On each Tick server will check all chunks near players and add tasks to ChunkGenerator if chunks don't exist.
If I'm right that the main problem is returnin NULL then generating immediate chunks will solve problem.
Did you find other bugs in your parallel ChunkGenerator? I didn't find anything bad.