.up
The movement commands are part of the heart of the DarwinBots DNA language. Without these, there could be no movement, just bouncing, gliding and flowing.
Contents
Sysvars
Movement:
Forwards compatibility note: aimdx is the old name for aimright aimsx is the old name for aimleft |
Syntax:
- .up accelerates the robot forward in the direction that he is facing. *.dn accelerates the robot backward from the direction he is facing. *.sx
- .dx
Example:
cond start 10 .up store stop
A robot with this gene would constantly accelerate forward at a rate of 10 per turn. That is to say that his forward velocity would increase by a value of 10. If he should rotate then the direction in which the acceleration takes place would also change.
Technical Details:
Range:
Vector acceleration:
All four relate to vector acceleration rather than actual movement. The direction of the vector acceleration is defined by the direction in which the DarwinBot is facing when the command is carried out. Prior to actual movement of the DarwinBot the values in .up .dn .sx and .dx are all added together such that a negative .up and a positive .dn will add to make a larger acceleration in the .dn direction and a positive .up and a positive .dn, of equal magnitude, will cancel each other out.
Ties and Repulsion:
Next, these accelerations are added to any existing accelerations due to the actions of ties and repulsion fields (when robots get too close together). Finally, the accelerations are converted to X and Y vectors and applied to the DarwinBot by adding them to existing velocities in the X and Y directions. The total velocity cannot exceed 40 units per cycle so any excess is then lost.
Movement energy costs:
Energy costs to the DarwinBot are calculated based on the input values. These vary with robot mass and applied acceleration but cannot exceed 100 energy points per vector per cycle.
===Activation hierarchy:===: Movement commands are executed after rotation commands