#17609·luanti

paramtype2 `"customrotation"`

Author: The4codeblocksCreated Sep 29, 2026Updated Sep 30, 2026
LabelsFeature requestAction / change neededPossible close

Usecase

for minimizing redundant rotations with symmetrical nodes (stairs only need 12 out of 24 facedir rotations, logs only need 3 of 6 wallmounted rotations) additionally wallmounted is upside-down with param2 = 0 so having a minor change is useful

with colorcustomrotation, this helps maximize the number of bits dedicated to color otherwise this may be useful for saving space in param2 for custom mod behavior

also the field overloads act as a helper for converting param2 to facedir

Solutions

paramtype2 = "customrotation":

  • rotation_bits definition sets lower bit count dedicated to rotation
  • facedir_equivalent definition is a table from the param2 bitslice (sized rotation_bits) to the facedir equivalent

paramtype2 = "colorcustomrotation":

  • same as above but the remainder of bits are dedicated to color everything else:
  • when reading a definition table, rotation_bits is overloaded with the bit count of existing paramtype2s (2 for 4dir, 3 for wallmounted, 5 for facedir) and facedir_equivalent is also overloaded with the facedir equivalents of other paramtype2s ({[0]=0,1,2,3} for 4dir, identity for facedir)

Alternatives

engine support for each type individually (not very engine-like)

Additional context

No response