ClassiCube icon indicating copy to clipboard operation
ClassiCube copied to clipboard

Block IDs above 256 can have unexpected physics in singleplayer

Open Sobsz opened this issue 3 years ago • 3 comments

Blocks with IDs above 256 are treated by the physics engine as if their ID was modulo 256, e.g. blocks 257 and 513 act the same as block 1. This applies to flowing liquids, falling powders, and disappearing vegetation, but not to growing/dying grass.

Admittedly, many maps already disobey physics (e.g. waterfalls) and would be broken even if the physics were working perfectly, making this bug somewhat minor. Still, I believe this should at least be documented, so that people trying to avoid physics IDs (e.g. when preparing freebuild map downloads) know what to watch out for.

How to reproduce:

  1. Save a map from a server with block IDs above 256.
  2. Open the map in singleplayer and place a block with ID 264, 266, 520, or 522. (You may need to disable auto rotate.)
  3. woo flood

Sobsz avatar Jul 27 '21 13:07 Sobsz

I intentionally did this for performance, see comment in #814

Although given this is second issue here, and that it's also been reported elsewhere to me a couple of times, I think I will give in and change the block physics code to behave properly

UnknownShadow200 avatar Jul 28 '21 01:07 UnknownShadow200

I personally wouldn't mind a way to disable physics altogether, whether as an option in the client or perhaps a flag in the map file (though I don't know your exact stance on adding such things). It's not a solution to the problem itself, but it would work in most cases, while still allowing for an accurate Classic experience with maximum performance. (I probably should've just asked for this in the first place...)

Sobsz avatar Jul 28 '21 17:07 Sobsz

I personally wouldn't mind a way to disable physics altogether, whether as an option in the client or perhaps a flag in the map file (though I don't know your exact stance on adding such things). It's not a solution to the problem itself, but it would work in most cases, while still allowing for an accurate Classic experience with maximum performance. (I probably should've just asked for this in the first place...)

Options > Misc options image

Goodlyay avatar Jul 28 '21 17:07 Goodlyay