29-Nov-2014, 10:51 PM
I have been doing some investigation of this. In brief, I have concluded that this is not a bug in Tile World. The same kind of "clone desynchronization" occurs on the Atari Lynx, and so far I have been able to observe, it works the same as in Tile World's Lynx mode. The question remains: why does this happen? (I haven't seen this discussed anywhere else.) Here is a description of how things are handled internally in Tile World. (The Lynx ROM presumably does something similar; in any case, the final result is the same.)
1. When a level is (re)started, the game builds a list of all creatures in reading order. Creatures include monsters, blocks, and Chip himself. The list includes monsters and blocks on top of clone machines. After this, if Chip is not in the first position in the list, he trades places with whatever creature is there. So, Chip is always at the beginning of the list.
2. Each game tick, the creature list is traversed in reverse order. Monsters move 1/4 of a tile when not slipping. Creatures on clone machines or traps don't move. (Things are actually more complicated. There are three traversals per tick. In the first, the creatures decide which direction they move when not in midmove. In the second, the move is executed. The third traversal handles teleporters. All this may be ignored for this discussion.)
3. When a creature dies, the creature's entry in the creature list is not removed. Instead, the entry is marked "hidden", which just means there is no longer any creature occupying that location in the list. Hidden entries in the list are ignored during the traversal.
4. When a clone button is pressed, the corresponding creature moves 1/4 of a tile off the clone machine, and a new creature is created on top of the clone machine. If there is a "hidden" slot available in the creature list, the new creature will be inserted into the earliest such slot. If there aren't any hidden slots, the creature is appended to the end of the list.
So, when a creature is cloned, if the creature appears later in the list than the creature that pushed the clone button, it initially moves 1/4th of a tile. However, if it appears earlier in the list, it moves 1/4 tile again on the same tick for a total of 1/2 tile.
Here is an example. It's pedantic Lynx compatible, so if you want you can try it on the Lynx ROM (using Brian Raiter's "c4" utility to patch the level in).
If you run the level in Lynx mode, every so often the fireball cloned on the second row will be slightly ahead of that on the first row. Here's how it works in detail:
The creature list initially looks like this:
C B1 F1 B2 F2
Here, C is Chip, B1 and F1 are the ball and fireball on the first row, and likewise for B2 and F2. At first, the fireballs don't move because they're on clone machines. Then the balls press the clone buttons. B2 acts first, causing F2 to leave the clone machine and another fireball to appear in its place. Likewise, F1 also leaves its clone machine on the same tick. Now there are more creatures on the list. We denote the extra creatures by an ellipsis since they're irrelevant to the example.
C B1 F1 B2 F2 ...
As time passes, more cloning occurs, without anything interesting happening until the fireballs start drowning. When the splash animations for F1 and F2 finish, their entries on the list are now marked hidden:
C B1 H B2 H ...
Later, the balls will push the clone buttons. First, when B2 presses its button, the fireball on row 2 is released from the clone machine. A new fireball, F2a is created on top of the machine, and placed into the first available slot:
C B1 F2a B2 H ...
Next, it is F2a's turn, but nothing happens since it's on a clone machine. Then B1 presses its button, and we have a new fireball F1a on the clone machine in the first row:
C B1 F2a B2 F1a ...
The next time the clone buttons are pressed is when it happens. F1a, on a clone machine, does nothing. Then B2 presses the clone button, causing F2a to leave the clone machine. F2a is processed next. Since it isn't on a clone machine anymore, it moves again. Then B1 releases F1a from the clone machine, but F1a was already processed, so it doesn't move again this tick. So F2a is now 1/4 tile ahead of F1a.
After this, the fireballs cloned will be synchronized until F1a and F2a drown, making their slots in the creature list available again, and the cycle repeats.
Some final notes:
The extra 1/4 move can occur even if there is only one clone machine in the level. It all depends on the relative order of the creature that presses the button and the creature on the clone machine in the creature list. For instance, it never happens when Chip presses a clone button since he is at the beginning of the list.
random 8 above mentioned that something similar happens with traps. The explanation is more or less the same. If the creature on the trap appears earlier in the list than the creature that pushed the button, it gets another move.
We should probably call this quirk/glitch something. Perhaps "release boosting"? Maybe someone will come up with another name.
1. When a level is (re)started, the game builds a list of all creatures in reading order. Creatures include monsters, blocks, and Chip himself. The list includes monsters and blocks on top of clone machines. After this, if Chip is not in the first position in the list, he trades places with whatever creature is there. So, Chip is always at the beginning of the list.
2. Each game tick, the creature list is traversed in reverse order. Monsters move 1/4 of a tile when not slipping. Creatures on clone machines or traps don't move. (Things are actually more complicated. There are three traversals per tick. In the first, the creatures decide which direction they move when not in midmove. In the second, the move is executed. The third traversal handles teleporters. All this may be ignored for this discussion.)
3. When a creature dies, the creature's entry in the creature list is not removed. Instead, the entry is marked "hidden", which just means there is no longer any creature occupying that location in the list. Hidden entries in the list are ignored during the traversal.
4. When a clone button is pressed, the corresponding creature moves 1/4 of a tile off the clone machine, and a new creature is created on top of the clone machine. If there is a "hidden" slot available in the creature list, the new creature will be inserted into the earliest such slot. If there aren't any hidden slots, the creature is appended to the end of the list.
So, when a creature is cloned, if the creature appears later in the list than the creature that pushed the clone button, it initially moves 1/4th of a tile. However, if it appears earlier in the list, it moves 1/4 tile again on the same tick for a total of 1/2 tile.
Here is an example. It's pedantic Lynx compatible, so if you want you can try it on the Lynx ROM (using Brian Raiter's "c4" utility to patch the level in).
If you run the level in Lynx mode, every so often the fireball cloned on the second row will be slightly ahead of that on the first row. Here's how it works in detail:
The creature list initially looks like this:
C B1 F1 B2 F2
Here, C is Chip, B1 and F1 are the ball and fireball on the first row, and likewise for B2 and F2. At first, the fireballs don't move because they're on clone machines. Then the balls press the clone buttons. B2 acts first, causing F2 to leave the clone machine and another fireball to appear in its place. Likewise, F1 also leaves its clone machine on the same tick. Now there are more creatures on the list. We denote the extra creatures by an ellipsis since they're irrelevant to the example.
C B1 F1 B2 F2 ...
As time passes, more cloning occurs, without anything interesting happening until the fireballs start drowning. When the splash animations for F1 and F2 finish, their entries on the list are now marked hidden:
C B1 H B2 H ...
Later, the balls will push the clone buttons. First, when B2 presses its button, the fireball on row 2 is released from the clone machine. A new fireball, F2a is created on top of the machine, and placed into the first available slot:
C B1 F2a B2 H ...
Next, it is F2a's turn, but nothing happens since it's on a clone machine. Then B1 presses its button, and we have a new fireball F1a on the clone machine in the first row:
C B1 F2a B2 F1a ...
The next time the clone buttons are pressed is when it happens. F1a, on a clone machine, does nothing. Then B2 presses the clone button, causing F2a to leave the clone machine. F2a is processed next. Since it isn't on a clone machine anymore, it moves again. Then B1 releases F1a from the clone machine, but F1a was already processed, so it doesn't move again this tick. So F2a is now 1/4 tile ahead of F1a.
After this, the fireballs cloned will be synchronized until F1a and F2a drown, making their slots in the creature list available again, and the cycle repeats.
Some final notes:
The extra 1/4 move can occur even if there is only one clone machine in the level. It all depends on the relative order of the creature that presses the button and the creature on the clone machine in the creature list. For instance, it never happens when Chip presses a clone button since he is at the beginning of the list.
random 8 above mentioned that something similar happens with traps. The explanation is more or less the same. If the creature on the trap appears earlier in the list than the creature that pushed the button, it gets another move.
We should probably call this quirk/glitch something. Perhaps "release boosting"? Maybe someone will come up with another name.