IcyCraft CE

Complex Behaviors

Complex behaviors are a form of bytecode instruction.

There are 512 bytes of 2b offsets for each tileID's complex behavior.
These offsets are of the complex behavior code.

The 2b after the offset table is the length in bytes of the complex behavior code.


Each complex behavior code ends with a null.
The command byte is interpreted by it's specific bits.
The higher bit's argument bytes come first, and are applied first.
If a command is conditional, and it is false, the rest of the commands will not be applied.

THESE CODES ARE SUBJECT TO CHANGE IN VERSION 3
bit no. (high->low) [do if] False [do if] True
bit 7 (NO-OP) Do if randInt(0,X) is zero
bit 6 (NO-OP) Do if next to tileID
bit 5 (NO-OP) Set this tile to tileID
bit 4 (NO-OP) (NO-OP)
bit 3 Skip next bit. Interpret next bit.
bit 2 remove item,amount from player inventory. remove item,amount from the container at this tile.
bit 1 Skip next bit. Interpret next bit.
bit 0 add item,amount to player inventory. add item,amount to the container at this tile.