Order of actions

From WikiManual
Jump to: navigation, search

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:

  1. .readtie is set, and reads tie information into Trefs
  2. delgene happens
    1. Communication using ties occurs.
    2. Ties are updated (that is, things like .sharenrg, deleting ties, and feeding through ties. Does not include firing ties though)
    1. The bot turns.
    2. Position is updated (things like accelerations, velocity, collisions, etc. Also updates the eye positions)
  3. Slime and shell are made.
  4. Shoot commands occur
  5. Viruses are shot
  6. Buoyancy is set
  7. Storing body, venom, and poison
  8. Feeding from body
  9. Firing of ties
  10. Reproduction
  11. Death


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.