If the simulator requires a neighbor chunk, it will still have to do a chunk lookup through cWorld. But that will be in so much fewer cases, that it's worth the effort.
I'm not sure storing 4 neighbors in each chunk and keep them in sync is worth the effort.
What I had in mind was a function signature:
So it will be able to directly read chunk data for the chunk, it will query cWorld for neighbors, if needed; it will have a per-chunk list of blocks to simulate and it will output a list of blocks that should change (so that cChunk can update heightmap, send the block changes to the client etc.)
EDIT: updated the function signature to take const references, where appropriate.
I have committed the simulator-waking to a new branch, /branches/wake_simulators_on_load. It's only for the curiosity, because it's actually useless, with those tick times.
I'm not sure storing 4 neighbors in each chunk and keep them in sync is worth the effort.
What I had in mind was a function signature:
Code:
cSomeSimulator::SimulateInChunk(const cChunkDef::BlockTypes & a_BlockTypes, const cChunkDef::BlockNibbles & a_BlockMetas, const BlockCoords & a_BlocksToSimulate, sSetBlockVector & a_BlocksToChangeOut);
So it will be able to directly read chunk data for the chunk, it will query cWorld for neighbors, if needed; it will have a per-chunk list of blocks to simulate and it will output a list of blocks that should change (so that cChunk can update heightmap, send the block changes to the client etc.)
EDIT: updated the function signature to take const references, where appropriate.
I have committed the simulator-waking to a new branch, /branches/wake_simulators_on_load. It's only for the curiosity, because it's actually useless, with those tick times.