Order of actions
The order of actions is the order of steps that bots take during a cycle to interact within their environment. All actions are done after the DNA executes and changes the bots' memory locations. Bots execute each step in the order of actions by their order in the robots array. Bots with lower ids will execute before bots with higher ids. All bots must complete each step before any bot may move on to the next step. All actions occur in the following order:
- .readtie is set, and reads tie information into Trefs
- delgene happens
- The bot turns.
- Position is updated (things like accelerations, velocity, collisions, etc. Also updates the eye positions)
- Slime and shell are made.
- Shoot commands occur
- Viruses are shot
- Buoyancy is set
- Storing body, venom, and poison
- Feeding from body
- Firing of ties
Knowledge of the order of operations has many uses in the design of bots. For example if a tie bot is tied to a shot bot it can change the value of .shoot to -2. This will cause the shot bot to feed the tie bot with energy when it attacks. The only way for the shot bot to prevent this is to either get rid of the tie or to disable the tie bots ability to communicate using ties, since the tie will change the robots shot value before it is fired and after it was set by the DNA.