Difference between revisions of ".up"

From WikiManual
Jump to: navigation, search
 
m
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Movement==
+
{{movementarticles|num=1|sysvar=.up|dir=forward in its eye direction}}
'''Overview''' The movement command s .up .dn .sx .dx
 
The movement commands are part of the heart of the DarwinBots DNA language. Without these, there could be no movement. The movement commands are simple to implement but even these can take a little understanding to use properly. 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.
 
 
 
 
----
 
'''Syntax'''
 
 
 
'''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'''
 
 
 
 
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.
 
 
 
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.
 
 
 
'''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
 
 
 
'''Associated Keywords''': .aimsx .aimdx .vel
 

Latest revision as of 15:17, 23 December 2005


Movement:

.aimsx 6 .aimdx 5
.up 1
.sx 3 Veggietransparent.gif .dx 4
.dn 2
.aim 18 .setaim 19
.maxvel 11
.setboy 314 .rdboy 315

Forwards compatibility note:

aimdx is the old name for aimright

aimsx is the old name for aimleft

Sysvars:

V221.gif 1 .up is a movement Sysvar. Without these, there could be no movement, just bouncing, gliding, flowing and tie-pushing.

Syntax:

  • .up accelerates the robot forward in its eye direction. It uses memory location 1 of the bot to store how much it accelerates in that direction.

Examples:

10 .up store

or

10 1 store

This puts 10 on the stack. Than it puts 1 on the stack. Than it stores 10 in memory location 1 of the bot (.up) and removes 1 and 10 from the stack. The 10 in memory location 1 of the bot accelerates it +10 forward in its eye direction if it has not reached the maximum acceleration in that direction.

cond
start
10 .up store
stop

A robot with this gene would constantly accelerate forward in its eye direction at a rate of 10 per turn. That is to say that his velocity in that direction would increase by a value of 10. If it should rotate then the direction in which the acceleration takes place would also change.

Technical Details:

Movement values get cut above 1000 and below -1000, then added up to a single vector including tie and other propulsion vectors, then the vector gets cut to a length of 40 as maximum aceleration.

More details at Movement.