Towards 1.13
#10
I agree with almost everything you wrote here.

About optimization: the idea of coding into numbers doesn't sound too bad to me, however we should think _a bit_ now about layout of the numbers + the storage, to either let the compiler do optimizations right away or do them later (I can think of, for example, if the total actual block state (maybe even including some surrounding blocks) is encoder in a single number, I'd happily trade the few bits for a cache of known state transformations.

One possible option: a plugin registers a block, which has a method similar to javas hash code that combines all relevant state into a single number, (which also defines whether two block states are equal and so on). This should definitely be a fast hash and computed rather often. Additionally, we have a tick function, which takes the current state plus the surrounding blockarea and transforms it into some other state. If a plugin does not depend on neighboring blocks, it can mark itself as isolated, in which case no surrounding blockarea is passed in.

If the surrounding area changed, the block is marked as dirty (well if a block changed, it's surrounding blocks are marked dirty), in which case tick needs to be re-evaluated. Block state changes which aren't dirty could be looked up in a table that maps previous state to next state.

It's just an idea, but with a little bit more work into it, it could make ticking large areas really efficient because i would guess a lot of water simulation eg is pretty similar and could thus be optimized.

Also, a possible option of optimizing would be looking into ways to optimize data layout and computation make the compiler produce SIMD instructions, as that could potentially result in a fairly high performance gain.
Reply
Thanks given by:


Messages In This Thread
Towards 1.13 - by xoft - 01-08-2019, 01:04 AM
RE: Towards 1.13 - by xoft - 01-09-2019, 03:06 AM
RE: Towards 1.13 - by NiLSPACE - 01-09-2019, 06:45 AM
RE: Towards 1.13 - by xoft - 01-09-2019, 09:55 PM
RE: Towards 1.13 - by xoft - 01-09-2019, 09:58 PM
RE: Towards 1.13 - by NiLSPACE - 01-09-2019, 10:28 PM
RE: Towards 1.13 - by xoft - 01-11-2019, 05:57 AM
RE: Towards 1.13 - by ShadowCone - 01-11-2019, 03:52 AM
RE: Towards 1.13 - by NiLSPACE - 01-11-2019, 06:03 AM
RE: Towards 1.13 - by ShadowCone - 01-12-2019, 12:28 AM
RE: Towards 1.13 - by xoft - 01-16-2019, 01:10 AM
RE: Towards 1.13 - by xoft - 01-22-2019, 09:14 AM
RE: Towards 1.13 - by NiLSPACE - 01-22-2019, 06:56 PM
RE: Towards 1.13 - by xoft - 01-22-2019, 07:34 PM
RE: Towards 1.13 - by NiLSPACE - 01-22-2019, 08:57 PM
RE: Towards 1.13 - by NiLSPACE - 01-23-2019, 04:58 AM
RE: Towards 1.13 - by xoft - 01-23-2019, 05:32 AM
RE: Towards 1.13 - by xoft - 01-23-2019, 06:04 AM
RE: Towards 1.13 - by peterbell10 - 01-23-2019, 09:49 AM
RE: Towards 1.13 - by xoft - 01-24-2019, 12:00 AM
RE: Towards 1.13 - by xoft - 01-24-2019, 12:07 AM
RE: Towards 1.13 - by peterbell10 - 01-24-2019, 02:35 AM
RE: Towards 1.13 - by peterbell10 - 01-24-2019, 02:59 AM
RE: Towards 1.13 - by xoft - 01-24-2019, 08:02 AM
RE: Towards 1.13 - by xoft - 01-24-2019, 07:41 PM
RE: Towards 1.13 - by tigerw - 01-25-2019, 02:25 AM
RE: Towards 1.13 - by NiLSPACE - 01-25-2019, 04:41 AM
RE: Towards 1.13 - by xoft - 01-25-2019, 05:08 AM
RE: Towards 1.13 - by NiLSPACE - 01-25-2019, 04:31 PM
RE: Towards 1.13 - by xoft - 01-25-2019, 05:19 AM
RE: Towards 1.13 - by tigerw - 01-25-2019, 06:16 AM
RE: Towards 1.13 - by xoft - 01-25-2019, 07:49 PM
RE: Towards 1.13 - by tigerw - 01-25-2019, 09:44 PM
RE: Towards 1.13 - by tigerw - 01-25-2019, 10:40 PM
RE: Towards 1.13 - by xoft - 01-26-2019, 12:58 AM
RE: Towards 1.13 - by tigerw - 01-26-2019, 09:11 PM
RE: Towards 1.13 - by xoft - 01-27-2019, 03:40 AM
RE: Towards 1.13 - by Aberts10 - 05-28-2019, 09:31 AM
RE: Towards 1.13 - by xoft - 05-30-2019, 12:11 AM
RE: Towards 1.13 - by xoft - 08-04-2019, 07:56 AM
RE: Towards 1.13 - by Seadragon91 - 08-04-2019, 07:22 PM
RE: Towards 1.13 - by xoft - 08-04-2019, 11:34 PM
RE: Towards 1.13 - by xoft - 08-05-2019, 07:20 PM
RE: Towards 1.13 - by xoft - 08-06-2019, 07:50 PM
RE: Towards 1.13 - by xoft - 08-29-2019, 12:02 AM
RE: Towards 1.13 - by xoft - 08-30-2019, 10:21 PM
RE: Towards 1.13 - by xoft - 08-31-2019, 02:35 AM
RE: Towards 1.13 - by NiLSPACE - 09-01-2019, 03:04 AM
RE: Towards 1.13 - by xoft - 09-01-2019, 07:13 AM
RE: Towards 1.13 - by NiLSPACE - 09-02-2019, 03:51 AM
RE: Towards 1.13 - by NiLSPACE - 09-05-2019, 12:25 AM
RE: Towards 1.13 - by xoft - 09-05-2019, 06:04 AM
RE: Towards 1.13 - by xoft - 09-05-2019, 06:05 AM
RE: Towards 1.13 - by xoft - 09-10-2019, 05:57 AM
RE: Towards 1.13 - by xoft - 09-27-2019, 07:50 PM
RE: Towards 1.13 - by xoft - 10-17-2019, 06:23 AM
RE: Towards 1.13 - by xoft - 12-28-2019, 08:45 AM



Users browsing this thread: 1 Guest(s)