Simulator rewrite
#3
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:
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.
Reply
Thanks given by:


Messages In This Thread
Simulator rewrite - by xoft - 11-09-2012, 07:05 AM
RE: Simulator rewrite - by Taugeshtu - 11-09-2012, 07:09 AM
RE: Simulator rewrite - by xoft - 11-09-2012, 07:41 AM
RE: Simulator rewrite - by xoft - 11-11-2012, 10:23 PM
RE: Simulator rewrite - by FakeTruth - 11-12-2012, 12:59 AM
RE: Simulator rewrite - by xoft - 11-12-2012, 01:04 AM
RE: Simulator rewrite - by NiLSPACE - 11-18-2012, 04:00 AM
RE: Simulator rewrite - by xoft - 11-18-2012, 04:41 AM
RE: Simulator rewrite - by xoft - 02-28-2013, 07:08 AM
RE: Simulator rewrite - by keyboard - 02-28-2013, 12:25 PM
RE: Simulator rewrite - by xoft - 02-28-2013, 05:50 PM
RE: Simulator rewrite - by xoft - 03-01-2013, 05:16 AM
RE: Simulator rewrite - by keyboard - 03-01-2013, 03:26 PM
RE: Simulator rewrite - by NiLSPACE - 03-01-2013, 05:49 AM
RE: Simulator rewrite - by xoft - 03-02-2013, 05:08 AM
RE: Simulator rewrite - by NiLSPACE - 03-02-2013, 05:29 AM
RE: Simulator rewrite - by xoft - 03-02-2013, 05:41 AM
RE: Simulator rewrite - by xoft - 03-03-2013, 01:49 AM
RE: Simulator rewrite - by xoft - 03-03-2013, 06:31 AM
RE: Simulator rewrite - by keyboard - 03-03-2013, 12:59 PM
RE: Simulator rewrite - by NiLSPACE - 03-03-2013, 08:22 AM
RE: Simulator rewrite - by xoft - 03-03-2013, 06:41 PM
RE: Simulator rewrite - by NiLSPACE - 03-03-2013, 08:31 PM
RE: Simulator rewrite - by xoft - 03-03-2013, 11:33 PM
RE: Simulator rewrite - by xoft - 03-04-2013, 01:40 AM
RE: Simulator rewrite - by NiLSPACE - 12-07-2013, 10:07 PM
RE: Simulator rewrite - by xoft - 12-07-2013, 10:21 PM
RE: Simulator rewrite - by tigerw - 12-08-2013, 08:32 AM
RE: Simulator rewrite - by NiLSPACE - 12-08-2013, 08:39 AM
RE: Simulator rewrite - by tigerw - 12-08-2013, 08:40 AM



Users browsing this thread: 2 Guest(s)