WATR, DSTW, BUBW, SLTW, WTRV, and ACID all have code that checks for surrounding RBDM/LRBD. Shouldn't it be the other way around, so RBDM checks for water/ACID? This might make water a tiny bit less laggy.
Also, RBDM is really unrealistic, but I guess it's too late to fix that...
This would only really help if it allows the neighbour loops (or ideally, the whole update function) for those liquids to be removed.
Checking for each element is only two instructions (compare+jump) if it does not match, which is fairly insignificant compared to the neighbour loop overhead and any random number generation. Liquid movement is probably the thing that contribute most to water lag.
I know, but it would still make the game run a TINY bit faster (probably around 0.00001 FPS or something), but small changes add up.
12Me21:
I know, but it would still make the game run a TINY bit faster (probably around 0.00001 FPS or something), but small changes add up.
TBH I'd rather see an official build with CPU optimizations for newer CPUs. It'd be like the opposite of the legacy build, and support AVX, and be compiled 64-bit.
Only for saves without RBDM/LRBD. Saves containing RBDM/LRBD would run slower, and by a not-tiny amount (since neither element currently has an update function).
At the moment, AVX probably wouldn't make much difference. The biggest advantage of newer SIMD instructions is they operate on more data at once (although new instructions sometimes help too). But most of the Powder Toy code is a bit too complicated for compilers to automatically figure out how to efficiently use SIMD (even just SSE1/2/3, never mind AVX) on it.
However, I am working on this problem in my fork.