11-11-2012, 10:23 PM
You know what? That idea with storing chunk neighbors might not be as bad as it first seemed.
For current simulators, such as sand and floody fluid, it is not beneficial at all, none of these touch a neighbor more than 1 block away. For that reason, keeping the neighbors up to date would be too much work for almost no gain.
However, for redstone and in the future, for vanilla fluid simulators, this could become the real deal. These two need blocks up to 16 blocks away, for which the neighbor chunks make sense very much. Also this would further reduce the locking of the chunkmap - the simulators will tick inside the chunk's tick, having the chunkmap already locked, and accessing the neighbors as needed without locking at all.
For this to work, we'd need two things - chunk keeping track of their neighbors in a set of protected member fields / functions, and simulators being capable of ticking one chunk worth of data.
I'll start implementing the first one - chunk neighbors. Then I have no trouble converting old simulators to the new schema.
BUT! I'm afraid I won't have enough wits to rewrite the current redstone simulator to the one-chunk-worth idiom. So the only reasonable thing I can do for the time being, is disabling the redstone simulator, until someone boldly steps in and rewrites it, too.
For current simulators, such as sand and floody fluid, it is not beneficial at all, none of these touch a neighbor more than 1 block away. For that reason, keeping the neighbors up to date would be too much work for almost no gain.
However, for redstone and in the future, for vanilla fluid simulators, this could become the real deal. These two need blocks up to 16 blocks away, for which the neighbor chunks make sense very much. Also this would further reduce the locking of the chunkmap - the simulators will tick inside the chunk's tick, having the chunkmap already locked, and accessing the neighbors as needed without locking at all.
For this to work, we'd need two things - chunk keeping track of their neighbors in a set of protected member fields / functions, and simulators being capable of ticking one chunk worth of data.
I'll start implementing the first one - chunk neighbors. Then I have no trouble converting old simulators to the new schema.
BUT! I'm afraid I won't have enough wits to rewrite the current redstone simulator to the one-chunk-worth idiom. So the only reasonable thing I can do for the time being, is disabling the redstone simulator, until someone boldly steps in and rewrites it, too.