Home
Documents
CCL

SECTION 5 - MISCELLANEOUS COMMANDS

SECTION BRIEF - This section presents a collection of diverse commands which are generally useful, but not commonly used.

5.1 REPAIRING DAMAGE

COMMAND STRUCTURE

60 cyc

Repair Internal

60 cyc Repair Armor
60 cyc Repair Treads
60 cyc Repair Scanner
60 cyc Repair Weapon
1 cyc If [Repair] Kit [is] Available then [Branch To : Do] “Label”
1 cyc If [Repair] Kit [is] Unavailable then [Branch To : Do] “Label”

SYSTEM VARIABLES AFFECTED

  • IntDamage
  • TreadDamage
  • ArmorDamage
  • WeapDamage
  • ScanDamage
  • KitsLeft

EXAMPLE USAGE

TreadFixer
   If Tank Treads are Not Functional Then FixTreads
   Resume

FixTreads
   If Repair Kit is Available Then FixIt
   Resume

FixIt
   Repair Treads
   Resume
A Repair Kit is a special item available in the Chassis Design Module (CDM). It contains many contraptions, gizmos, and gadgets used to repair the various mechanisms and instruments on a cybertank. When a “Repair .” command is executed, assuming a Repair Kit is available, a percentage of the damaged equipment is repaired. Only a small amount of damage Will be completely fixed. Four separate repair kits are included when this option is purchased.

5.2 DEFENSE SHIELD

COMMAND STRUCTURE

10 cyc

Raise [Shield]

5 cyc Lower [Shield]
1 cyc If Shield [is] Up Then [Branch To : Do] “Label”
1 cyc If Shield [is] Down Then [Branch To : Do] “Label”

SYSTEM VARIABLES AFFECTED

  • None

EXAMPLE USAGE

ChkShield
   If Shield Is Down Then ShootIt
   Lower Shield

ShootIt
   Fire Weapon at Enemy Tank
   Resume
A Defense Shield is a special item available in the Chassis Design Module (CDM) which helps protect your cybertank from damage. When the Defense Shield is raised, an electro-magnetic field surrounds your cybertank reducing the amount of damage incurred by enemy cybertank fire.
There are three drawbacks to using a Defense Shield. The electro-magnetic field created by the shield reduces the maximum range of the cybertank’s scanner; the CWS WILL NOT fire a weapon through the shield (in order to fire, your cybertank must first lower its Shield); the shield, when raised, consumes fuel. It is recommended that you raise the Defense Shield only when necessary and lower it as quickly as possible

5.3 DETERMINING FUEL LEVEL

COMMAND STRUCTURE

1 cyc

If Fuel [is] Empty Then [Branch TO : Do] “Label”

1 cyc If Fuel [is] Remaining Then [Branch TO : Do] "Label"

SYSTEM VARIABLES AFFECTED

  • None

EXAMPLE USAGE

ChkFuel
   If Fuel is Empty Then Branch to NoMove

NoMove
   Resume
All cybertanks require fuel to power onboard mechanical devices. Without fuel, a cybertank is a sitting duck. A lack of fuel affects the following:
  1. The MOS, CSS, and CWS are inoperable.
  2. All movement is terminated.
  3. All CommLink communications are halted.
  4. The Defense Shield cannot be raised.
As you can see, running out of fuel is no trivial matter. It is an important consideration in the design of your cybertank’s AI. Always try to keep movement to a minimum, since it is a big fuel consumer. The Energy Miser, available in the Chassis Design Module (CDM), is an important option since it reduces fuel consumption by approximately 50%.

NOTE: Even though your cybertank may run out of fuel, its internal computer systems still continues processing logic functions. The AI still executes and TRYS to carry out all commands. If you design your cybertank to check its fuel level regularly, you can have it branch to a special routine (Possibly self-destruct at that point) when it detects a lack of fuel

5.4 WHEN ALL ELSE FAILS

COMMAND STRUCTURE

1 cyc

Self Destruct

SYSTEM VARIABLES AFFECTED

  • All

EXAMPLE USAGE

CheckAll
   If Tank Treads are Functional Then Branch to OK
   If Scanner is Functional Then Branch to OK
   If Weapon is Functional Then Branch to OK
   If Fuel-is Remaining Then Branch to OK
   If Repair Kit is Available Then Branch to OK
   Self Destruct

OK
   Resume
This command is pretty self-explanatory. When your cybertank is really down and out, the only noble thing to do is Self Destruct.

5.5 GENERALLY USEFUL COMMANDS

COMMAND STRUCTURE

1 cyc

Get Distance [To] “X” "Y"

1 cyc Get Random [To #]
1 cyc Beep
1 cyc * (asterisk)

SYSTEM VARIABLES AFFECTED

  • XYDist
  • RandomNum

EXAMPLE USAGE

CheckDist
   Get Distance To 1 1
   If XYDist > 30 then MaybeGo

* This is a comment line
MoveIt
   Turn Tank to 1 1
   Move Tank Forward 1
   Beep
   Resume

* You can put anything you want here
MaybeGO
   Get Random to 100
   If RandomNum > 50 then NoGo
   Branch to MoveIt

* All of this is ignored by the computer systems
NoGo
   Resume
The above commands were developed after some of the staff at OSI fought long and hard for their development. The commands, while not necessary for the “everyday” use of a cybertank, prove useful in some instances.
The “Get Random” command was developed because some employees wanted their cybertanks to randomly move left or right when searching for any enemy.
Another employee wanted to know which corner of the map was nearest his cybertank so he could decide where to go when it was time to run and hide. The “Get Distance” command proved very useful in this case.
The “Beep” command produces a short beep sound useful in debugging certain routines in your AI.
The last statement cannot really be called a command. The “*” (asterisk) is used to comment your Al design. The cybertank’s on-board computer system recognizes any line that starts with an asterisk as a comment line and does not attempt to execute it. It should be noted that the asterisk must be in the left-most column. Any text, comments, or explanations which follow an asterisk are ignored. It is suggested that ail employees comment their AI. Commenting is extremely helpful when examining AI code months after it was originally Written.

5.6 SETTING A "BREAKPOINT"

COMMAND STRUCTURE

0 cyc

Break

SYSTEM VARIABLES AFFECTED

  • None

EXAMPLE USAGE

CheckEnemy
   Scan for Enemy Tank
   If Enemy Tank Was Not Found Then Branch To Done
   If Enemy Tank Is Not Within Weapon Range Then Branch To
      Done
   Break

Done
   Resume
The “Break” command is only important when testing a cybertank in the Cybertank Test Module (CTM) (see Part 2, Section 5). When executed, the ‘“Break” command halts execution, but only in the CTM. While battling in the Combat Simulation Module (CSM) (see Part 2, Section 4), the ‘Break” command does absolutely nothing. The cybertank’s on-board computer system ignores the command and continues execution with the next instruction

5.7 ATTAINING MANUAL CONTROL

COMMAND STRUCTURE

1 cyc

If [Last] Key [Pressed] Then [Branch To : Do] “Label”

1 cyc

If [Last] Key [Pressed] = “1 character” Then [Branch To : Do] “Label”

SYSTEM VARIABLES AFFECTED

  • None

EXAMPLE USAGE

ReadKey
   If Last Key Pressed = “I” then Branch to MoveForward
   If Last Key Pressed = “F” then Branch to Fire
   Resume

MoveForward
   Move Tank Forward 1
   Branch to Done

Fire
   Fire Weapon at Closest Object

Done
   Resume
The Cybertank Remote System (CRS) provides a great deal of control over your cybertank’s actions. The CRS is basically a link between your terminal’s keyboard and your cybertank. By issuing one letter commands [A-Z] from your terminal’s keyboard during simulations, you can alter the behavior of your cybertank.
The above example checks to see if the “I” or “F” keys have been pressed. if either were pressed, the CRS passes the information to the cybertank’s AI so it can respond accordingly by branching to the correct label. if neither the “I” nor “F” key were pressed, then the cybertank continues to function as usual.
Cybertanks that rely on the CRS to respond to keyboard control are often called Manual cybertanks. Manual cybertanks have a tremendous advantage over standard AI cybertanks because the cybertank benefits from the designer’s logic and reasoning capabilities during a simulation. When designing Manual cybertanks, you do not have to worry about designing Al to move around indestructible buildings, avoid water, or retreat from the enemy. It is much easier to design a Manual cybertank.

5.8 SEQUENCE COMMANDS

COMMAND STRUCTURE

1 cyc

Branch To “Label”

1 cyc Goto “Label”
1 cyc Do “Label”
1 cyc Gosub “Label”
1 cyc Resume

SYSTEM VARIABLES AFFECTED

  • None

EXAMPLE USAGE

TankProg
   Do ScanEnemy
   Do MoveFrwd
   Branch to TankProg

ScanEnemy
   Scan For Enemy Tank
   If Enemy Tank Found Then Do ShootIt
   Resume

MoveFrwd
   Move Tank Forward 1
   Resume

ShootIt
   If Enemy Tank is Within Range Then Do KillIt
   Resume

KillIt
   Fire at Enemy Tank
   Resume
The Sequence Commands listed above play an important role in the design of your cybertank’s AI. The “Branch” end “Goto” commands direct the execution of your cybertank’s Al to a specific “Label”. When a ‘“Branch” and “Goto” command is executed, your cybertank’s on-board computer system searches the Al for the specified “Label.” Once located, the computer system begins to execute the commands found directly after the “Label.”
The “Do” and “Gosub” commands ore similar to the “Goto” and “Branch” commands, except that the on-board computer system remembers which instruction the “00” or “Gosub” is on. When a “Resume” command is encountered, execution is directed to the line directly after the line which contained the “Do” or “Gosub.” This is useful if there is a routine in your cybertank’s AI which is needed at several locations in your cybertank’s AI program. Instead of typing the routine repeatedly, you can execute a “Do” or “Gosub” each time the routine Is needed. Using the above example, the small routine named “Killlt” can be called from anywhere In a cybertank’s Al. Since the routine ends with a “Resume” statement, execution will ALWAYS resume to the line directly after the “Do Killit” Instruction.
Now to follow the procedure with another example:
Example
   Do MakePath
   Do MoveFwrd
   Do ScanEnemy
   Branch to Example

*********

MakePath
   Detect Obstruction at Tank Direction
   If Movement is Not Obstructed Then Brach To MakeOk
   Fire Weapon at Obstruction

MakeOk
   Resume

*********

MoveFwrd
   Move Tank Forward 1
   Resume

*********

ScanEnemy
   Scan for Enemy Tank
   If Enemy Tank Not Found Then Branch To NoEnemy
   If Enemy Tank is Beyond Weapon Range Then Branch To
      NoEnemy
   Fire Weapon at Enemy Tank

NoEnemy
   Resume
Ok, now to follow the logic in this AI section:
  1. The routine “MakePath” is called with the “Do MakePath” command.
     
  2. The routine “MakePath” checks to see if there is an obstruction. If there is no movement obstruction, then execution branches to "MakeOK”. If there is an obstruction, then the cybertank fires at it (and hopefully destroys it).
     
  3. Whether there was an obstruction or not, the Al winds u p a t “MakeOk”. At “MakeOK” there is a “RESUME” command. This command returns the Al back to the command directly after the “Do MakePath”. In other words, execution continues at the line “Do MoveFrwd."
     
  4. The command “Do MoveFwrd” sends execution to the routine “MoveFwrd”.
     
  5. The “MoveFwrd” routine simply moves the cybertank forward 1 hectometer.
     
  6. The “RESUME” command sends execution back to the line directly after the ‘“Do MoveFwrd" command, which is the “Do ScanEnemy” command.
     
  7. The “DO ScanEnemy” command sends the AI to the routine called “ScanEnemy”.
     
  8. The routine “ScanEnemy” checks to see if an enemy can be found and if so, is it within weapon range. If an enemy cybertank is not found, or one is found but is out of weapon range, then the Al will branch to the label “NoEnemy”. If an enemy is found AND it is within weapon range, then the cybertank will fire at it.
     
  9. Whether a cybertank was fired at or not, execution winds up at the label “NoEnemy.” At “NoEnemy” there is a “RESUME” command. This command returns the Al to the command directly after the “Do ScanEnemy.” In other words, execution continues at the line “Branch to Example.”
     
  10. The command “Branch to Example” loops the AI back up to the label ‘“Example” and the whole process is repeated over and over.

5.9 INCLUDING CAPSULE ROUTINES

COMMAND STRUCTURE

0 cyc

Include “AI Capsule file name”

SYSTEM VARIABLES AFFECTED

  • None

EXAMPLE USAGE

TankProg
   Do ScanEnemy
   Do MoveFrwd
   Branch to TankProg

   Include ScanEnemy
   Include MoveFrwd
The “Include...” command simply makes it easier to create cybertanks. The directors and engineers at OSI have designed many useful and commonly used routines that can be included in your cybertank’s Al. By using the “Include.” command, an OSI AI Capsule is incorporated into your cybertank’s AI during the Authorization process. For more information on including Capsules in your Al, please see Part 4

Toadstool's Home | Contact © 2003 Toadstool's Game Shrines. All Rights Reserved.