CYBERTANK COMMAND LANGUAGE
SYNOPSIS - This section presents the commands available for designing
a cybertank’s Artificial Intelligence (Al). The CCL Reference is a must for all
inexperienced employees and contains a great deal of useful information for the
experienced employee. Each section of the CCL Reference contains examples to clearly
demonstrate the use and function of the commands
Table of Conents
- SECTION 1 - CYBERTANK COMMAND LANGUAGE
- 1.1 GENERAL DEFINITIONS
- 1.2 CYCLE COUNT
- 1.3 RESERVED WORDS
- 1.4 STRUCTURE CONVENTIONS
- 1.5 LABELS
- 1.6 SYSTEM VARIABLES
- 1.7 USER VARIABLES
- 1.8 OPERATORS
- SECTION 2 - MOVING THE CYBERTANK
- 2.1 TREAD DAMAGE AND REPAIR
- 2.2 MOVING
- 2.3 TURNING
- 2.4 DETECTING MOVEMENT OBSTRUCTIONS
- 2.5 DETERMINING CYBERTANK FACING
- SECTION 3 - USING THE SCANNER
- 3.1 SCANNER DAMAGE AND REPAIR
- 3.2 SCANNING FOR ENEMY CYBERTANKS
- 3.3 SCANNING FOR OBJECTS
- 3.4 FINDING THE HEADQUARTERS
- 3.5 ROTATING THE SCANNER
- 3.6 LOCKING THE SCANNER ON A TARGET
- 3.7 DETECTING A SCANNER LOCKED ON YOU
- 3.8 JAMMING THE ENEMY’S SCANNER
- 3.9 LAUNCHING REMOTE SCANNERS
- SECTION 4 - USING THE WEAPON
- 4.1 WEAPON DAMAGE AND REPAIR
- 4.2 DETERMINING IF AN OBJECT IS WITHIN RANGE
- 4.3 FIRING THE WEAPON
- SECTION 5 - MISCELLANEOUS COMMANDS
- 5.1 REPAIRING DAMAGE
- 5.2 DEFENSE SHIELD
- 5.3 DETERMINING FUEL LEVEL
- 5.4 WHEN ALL ELSE FAILS
- 5.5 GENERALLY USEFUL COMMANDS
- 5.6 SETTING A "BREAKPOINT"
- 5.7 ATTAINING MANUAL CONTROL
- 5.8 SEQUENCE COMMANDS
- 5.9 INCLUDING CAPSULE ROUTINES
- SECTION 6 - USING THE COMMUNICATIONS LINK
- 6.1 TURNING THE COMMLINK ON AND OFF
- 6.2 TRANSMITTING AND RECEIVING ON THE COMMLINK
SECTION 1 - CYBERTANK COMMAND LANGUAGE
Before moving right into the CCL commands, several basic and fundamental concepts
must be covered.
1.1 GENERAL DEFINITIONS
The Cybertank Command Language (CCL) was designed by OSI language engineers
to facilitate the creation of cybertank artificial intelligence (Al). The Cybertank
Command Language was modeled after the English language for maximum comprehension
and utilization.
There is usually more than one command that can be used to perform a given function.
The CCL designers created simple commands for common functions normally executed
using traditional programming structure. Take, for example, the need to turn your
cybertank to face in the direction of a scanned enemy. The traditional command structure
requires the use of “System Variables” as follows:
Turn Tank To EnemyX EnemyY
Noting the frequency that cybertank engineers utilized the above command, OSI
designers added the following command to the CCL to perform the same function:
Turn Tank To Face Enemy Tank
Obviously, this command is easier to understand.
1.2 CYCLE COUNT
All commands require a period of time to execute. Command execution time is
measured in cycles. There are two fundamental types of commands in the CCL:
-
Action Commands that require physical or mechanical actions by the
cybertank, such as turning to face a new direction, and
-
Logic Commands that do not have the cybertank perform physical or
mechanical actions. logic commands execute in 1 cycle, while action commands
vary in execution time. Rotating the scanner, for example, requires less time
than turning the entire cybertank.
Always keep cycle counts in mind when designing your cybertank’s Al. For example,
a cybertank using 10 cycles in its firing intelligence fires twice as fast as one
with 20 cycles. Reducing cycle counts usually improves performance, It should also
be noted that the cycle counts given in this handbook are base figures. For example,
the command ROTATE SCANNER LEFT 1 takes 10 cycles to execute, but the command
ROTATE SCANNER LEFT 4 takes 40 cycles to execute (10 cycles per angle of
rotation times 4 angles.)
1.3 RESERVED WORDS
CCL commands, operators, and System Variables are “reserved” for specific purposes
and cannot be incorporated in user-defined variables. See Appendix 1 for a list
of Reserved Words.
1.4 STRUCTURE CONVENTIONS
The following conventions are used throughout this section for descriptive purposes:
| Convention |
Description |
| "Tank" |
For the sake of brevity, all CCL commands refer to
cybertanks as tanks. |
| [] |
Optional words in CCL commands are enclosed in square
brackets. Commands will execute correctly with or without the bracketed
words |
| "User Variable" |
This designates where a User Variable name is to
be used. |
| "Any Variable" |
This designates where either a User Variable name
or a System Variable name is to be used. |
| "#" |
This designates where a User Variable name, a System
Variable name, or a numeric digit is to be used. |
| "Label" |
This designates where a label name is to be used. |
| : (colon) |
This designates an alternative. For example [Branch
To : Do] indicates that either Branch To or Do can be
used. |
| cyc |
This designates a command’s cycle count. All initial
command definitions include their cycle count. |
| "X" |
This designates that an X-coordinate on the map is
to be used. |
| "Y" |
This designates that a Y-coordinate is to be used
on the map. |
1.5 LABELS
Labels used to designate the beginning of an Al segment can be executed with
either the Do (Gosub) or Branch To (Goto) commands. A label may be composed of any
alphanumeric character or symbol, with a. 10 character maximum length. A label may
contain a reserved word. If, during the Authorization process (discussed in Part
2, Section 2.61, you receive an “Out of label memory space” error message, try shortening
the length of your labels. For a description of all possible Authorization errors,
see Appendix 5
1.6 SYSTEM VARIABLES
System Variables are used by the CCL for internal operations. They can be used
in computations, but cannot be altered. System Variables are very useful, and Often
necessary, in designing cybertank Al. See Appendix 2 for a list of all of the System
Variables.
1.7 USER VARIABLES
A User Variable is defined by the employee. Unlike System Variables, User Variables
can be altered, can be composed of any alphanumeric character or symbol, and can
be up to 15 characters in length. A User Variable name can Contain a reserved word,
but cannot consist of a reserved word alone. For example, “Turn” is a reserved word
while “MyTurn” is a legal User Variable name.
1.8 OPERATORS
CCL supports the operators:
|
“+” |
(addition) |
|
“-” |
(subtraction) |
|
“<” |
(less than) |
|
“>” |
(greater than) |
|
“=” |
(equals) |
|
“<=” |
(less than or equal) |
|
“>=” |
(greater than or equal) |
|
“<>” |
(not equal) |
The operators are used as shown below.
|
1 cyc |
“User Variable” = “#” |
|
1 cyc |
“User Variable” = “Any Variable” + “#” |
|
1 cyc |
“User Variable” = “Any Variable” - “#” |
The above commands are called Assignment statements because the left side of
the "=" is “assigned” the value of the right side.
|
1 cyc |
If “Any Variable” = "#" Then [Branch To : Do] “Label” |
|
1 cyc |
If “Any Variable” = “Any Variable” + “#” Then [Branch To : Do] “Label” |
|
1 cyc |
If “Any Variable” = “Any Variable” - "#" Then [Branch To : Do] “Label” |
The above commands are called Conditional statements (or IF/THEN statements.)
These statements help control the flow of AI by checking various settings or conditions.
Note that anywhere the "=" Is used in the above Conditional examples, any of the
operators (“<”, “>”, “<=”, “>=”, “<>”) can be substituted.
Now for a few examples:
MyTurn = TankDir + 1
This sets the User Variable “MyTurn” to the System Variable "TankDir" plus one.
So, if "TankDir" is currently equal to three, then “Myturn” would be assigned the
value of four.
If Myturn >= 2 Then Branch to Done
This example causes the Al to branch to the label “Done” if and only if the
User Variable “MyTurn” is greater than or equal to two. Based upon the first example,
“Myturn” was set to four; therefore, the Al would indeed branch to the label ‘“Done.”
If Myturn = TankDir + 1 Then Branch to Done
This line causes the Al to branch to the label ‘“Done” if and only if the User
Variable “MyTurn” is equal to the System Variable "TankDir" plus one. So, the cybertank
logic unit retrieves the value of "TankDir" and adds one to it. It then compares
this value to “MyTurn.” If they are equal, then the branch is taken.
Note: Adding one to “TankDir” is only for purposes of comparison. The value
of “TankDir” does NOT change until an instruction is encountered which directs the
cybertank to turn
SECTION 2 - MOVING THE CYBERTANK
Mobilizing your cybertank is a rather simple task, but one of extreme importance.
With superb tactical maneuvering, your cybertank can sneak-up on the enemy without
the enemy ever knowing what hit it. By the same token, bad judgment in movement
can mean a quick termination of your cybertank. Many factors must be weighed when
designing a path of movement: movement consumes fuel, a cybertank’s treads must
be functional, and obstacles must be avoided. With all this to consider, a cybertank
must still be aware of its prime objective -- survival.
2.1 TREAD DAMAGE AND REPAIR
COMMAND STRUCTURE
|
1 cyc |
If [Tank] Treads [are] Functional Then [Branch To : Do] “Label” |
|
1 cyc |
If [Tank] Treads [are] Not Functional Then [Branch To : Do] “Label” |
|
60 cyc |
Repair Treads |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
CheckTread
If Tank Treads Are Functional Then Branch To
CT_Exit
Repair Treads
CT_Exit
Resume
Cybertanks use treads for MOVING and turning. When treads are destroyed, cybertanks
cannot move. Repair kits, if purchased, can be used at any time to repair damaged
treads. Refer to Section 5.1 for detailed information on cybertank repair.
2.2 MOVING
COMMAND STRUCTURE
|
40 cyc |
Move [Tank] Forward “#” |
|
40 cyc |
Move [Tank] Backward “#” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
MoveClear
Detect Obstruction at Tank Direction
If Movement is Not Obstructed Then Branch To MC_Move
Fire Weapon at Obstruction
Branch To MoveClear
MC_Move
Move Tank Forward 1
Resume
Cybertanks can move forward (the direction they are facing) or backward (opposite
the direction they are facing). You must specify the number of hectometers your
cybertank is to move. Movement can range from 0 (useless) to 62 (dangerous).
Once instructed to move, your cybertank will not stop until it either reaches
its destination or runs into an obstruction. If an obstruction is encountered, your
cybertank incurs damage and stops. The amount of damage is determined by the object
hit: buildings cause more damage than trees. Some objects (e.g. trees, bushes, houses,
and headquarters) can eventually be destroyed if you continually ram them, while
others, such as the battlefield barrier (resembling a brick wall) and reinforced
buildings are indestructible. Your cybertank Will eventually destroy itself if it
continues to ram indestructible objects.
Moving a cybertank requires fuel. If your cybertank is instructed to move without
fuel available, precious time is spent uselessly trying to start the engines.
Movement also requires functional treads. If a movement command is encountered
and the treads are inoperable, the cybertank will waste time “spinning its wheels.”
2.3 TURNING
COMMAND STRUCTURE
|
16 cyc |
Turn [Tank] Left "#" |
|
16 cyc |
Turn [Tank] Right “#” |
|
16 cyc |
Turn [Tank] To “angle” |
|
16 cyc |
Turn [Tank] To "X " "Y" |
|
16 cyc |
Turn [Tank] To Face [Enemy] Tank |
|
16 cyc |
Turn [Tank] To Face Enemy HQ |
|
16 cyc |
Align Tank [with Scanner] |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
FindOpen
Detect Obstruction at Tank Direction
If Movement is Not Obstructed Then Branch To FO_Move
Turn Tank Right 1
Branch To FindOpen
FO_Move
Move Tank Forward 1
Resume
Cybertanks turn in eighths of a circle (45* increments). When commanding a turn,
the number of eighths to turn is specified. The following command will turn the
Cybertank one eighth (45*) to the right:
Turn Tank Right 1
The following command turns the cybertank three eighths (135 degrees) to the
left:
Turn Tank Left 3
Cybertanks can also turn to specific angles. The angles are illustrated below
in Diagram 2.3.

Diagram 2.3 - The eight possible directions
The following command turns the cybertank to face northwest, regardless of the
direction it is currently facing:
Turn Tank To 7
There are many instances where you need to have your cybertank move to a known
location, but are not sure of the needed direction. Four different commands in the
CCL will automatically turn your cybertank in the nearest direction to face a known
location
The following command will turn your cybertank in the nearest direction to face
coordinates X=20 and Y=14:
Turn Tank To 20 14
Always list the X coordinate first, followed by a space and then the Y coordinate.
Do not use a comma to separate the coordinate pair.
Use the following command to turn your cybertank to the closest direction to
face an enemy cybertank at its last scanned position:
Turn Tank To Face Enemy Tank
Similarly, the following command will turn your cybertank toward the closest
direction to face the enemy headquarters, if found:
Turn Tank to Face Enemy HQ
The following command will turn your cybertank to the direction its scanner
is pointing:
Align Tank with Scanner
2.4 DETECTING MOVEMENT OBSTRUCTIONS
COMMAND STRUCTURE
|
4 cyc |
Detect [Obstruction] at “#” |
|
4 cyc |
Detect [Obstruction] at Tank Direction |
|
4 cyc |
Detect [Obstruction] at Scanner Direction |
|
1 cyc |
If [Movement is] Obstructed Then [Branch To : DO] “Label” |
|
1 cyc |
If [Movement is] Not Obstructed Then [Branch To : Do] “Label” |
|
1 cyc |
If Obstruction [is] Enemy HQ Then [Branch To : Do] “Label”
|
|
1 cyc |
If Obstruction [is] Ally HQ Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
- ObstacleX
- ObstacleY
- ObstacleDist
- ObstacleType
EXAMPLE USAGE
MoveClear
Detect Obstruction at Tank Direction
If Movement is Not Obstructed Then Branch To
MC_Move
Fire Weapon At Obstruction
Branch To MoveClear
MC_Move
Move Tank Forward 1
Resume
All cybertanks are equipped with a Movement Obstruction Sensor (MOS). This sensor
determines whether an obstruction is in a specified direction. Any objects that
can inflict damage to your cybertank in a collision are movement obstructions.
Using the MOS is different than using your scanner to find the closest object.
Since scanners cover a large area, you would have to perform a series of complicated
calculations to determine whether an object found in a scanner’s area would impede
movement. The MOS detects only obstacles between 1 and 3 hectometers from your cybertank’s
location in a specified direction.
The above example uses the “Detect Obstruction at Tank Direction” command. Once
a “Detect . . .” command has been executed, you should use one of the “If .” commands
to determine the results of the detection.
A common technique in the use of the sensor is to destroy an obstacle in your
path. This is usually faster than trying to move around it. The above example illustrates
this technique. An inherent problem in the example is that some obstacles cannot
be destroyed. You could end up repeatedly trying to destroy an indestructible object
This problem is overcome by checking the value of the System Variable ObstacleType
to identify the obstacle. If it is indeed indestructible, you can design your Al
to move around it. Refer to Appendix 3 for a complete description of object types.
It is important to note that a cybertank’s MOS is operational even when the Scanner
is destroyed, but is not when your cybertank runs out of fuel.
2.5 DETERMINING CYBERTANK FACING
COMMAND STRUCTURE
|
1 cyc |
If Tank [is] Facing [Enemy] Tank Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Not Facing [Enemy] Tank Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Aligned [with Scanner] Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Not Aligned [with Scanned Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Facing Enemy HQ Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Not Facing Enemy HQ Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Facing “X” “Y” Then [Branch To : Do] “Label” |
|
1 cyc |
If Tank [is] Not Facing "X" “Y” Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
MoveClear
Detect Obstruction at Scanner Direction
If Movement is Not Obstructed Then Branch To MC_ChkDir
Fire Weapon at Obstruction
Branch To MoveClear
MC_ChkDir
If Tank is Aligned with Scanner Then Branch To
MC_Move
Align Tank with Scanner
MC_Move
Move Tank Forward 1
Resume
The relevance of these commands may not be readily apparent, but will become
so when considering the impact of cycle counts.
The above example has the cybertank trying to move in the direction the scanner
is facing. If you remove the command that checks alignment with its scanner, then
the command “Align Tank with Scanner” is executed. This is extremely undesirable
since turning a cybertank requires many cycles. It is more efficient to expend one
cycle checking the cybertank’s alignment than to waste numerous cycles turning the
cybertank.
SECTION 3 - USING THE SCANNER
All cybertanks are equipped with the Cybertank Scanner System (CSS), an essential
piece of hardware. Various equipment can be built into the CSS, including a Scanner,
a Remote launcher, a Scanner Lock, a Listening Device, in addition to a Jammer.
Scanners vary in angle of effectiveness (or sweep angle) and range. The primary
function of a Scanner is to quickly probe an area and return the results to the
cybertank’s main computer systems. Scanners are capable of detecting enemy cybertanks,
headquarters, and various terrain features, and play an important role in cybertank
design. Without a scanner, a cybertank is very limited in its range of sight (the
MOS has a range of 3 hectometers with a one degree wide sweep angle -- see Section
2.4).
NOTE: The use of a defense shield halves the range of all scanners. (For
more information on Defense Shields. See Section 5.2.)
3.1 SCANNER DAMAGE AND REPAIR
COMMAND STRUCTURE
|
1 cyc |
If Scanner [is] Functional Then [Branch To : Do] “Label” |
|
1 cyc |
If Scanner [is] Not Functional Then [Branch To : Do] “Label” |
|
60 cyc |
Repair Scanner |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
CheckScan
If Scanner is Functional Then Branch To CS_Exit
Repair Scanner
CS_Exit
Resume
The cybertank uses its scanner to find enemy cybertanks and locate objects.
When its scanner is destroyed, a cybertank is essentially blind and normally doomed
to fail. Repair kits, if purchased, can be used at any time to repair a damaged
scanner. Scanners are reliable until they are completely destroyed.
3.2 SCANNING FOR ENEMY CYBERTANKS
COMMAND STRUCTURE
|
8 cyc |
Scan for [Enemy] Tank |
|
1 cyc |
If [Enemy] Tank [was] Found Then [Branch To : Do] “Label” |
|
1 cyc |
If [Enemy] Tank [was] Not Found Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
FindTank
Rotate Scanner Right 1
Scan For Enemy Tank
If Enemy Tank Was Not Found Then Branch To
FindTank
FT_FoundIt
Resume
These commands are used to locate enemy cybertanks. It is necessary to execute
the “Scan For Enemy Tank” command first, then use one of the ‘“If. . ." commands
to determine the results. The above example has the cybertank continuously scanning
in all directions until an enemy cybertank is found.
3.3 SCANNING FOR OBJECTS
COMMAND STRUCTURE
|
8 cyc |
Scan for [Closest] Object |
|
1 cyc |
If [Closest] Object [was] Found Then [Branch To : Do] “Label” |
|
1 cyc |
If [Closest] Object [was] Not Found Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
- ObjX
- ObjY
- ObjType
- ObjDist
EXAMPLE USAGE
ClearArea
Tree = 4
House = 5
Align Tank with Scanner
CA_Loop
Scan For Closest Object
If Closest Object Was Not Found Then Branch To
CA_Rotate
If ObjType = Tree then CA_Destroy
If ObjType = House then CA_Destroy
CA_Rotate
Rotate Scanner Right 1
If Scanner Not Aligned with Tank Then Branch TO CA_Loop
CA_Exit
Resume
CA_Destroy
If Closest Object is Beyond Weapon Range then CA_Rotate
Fire Weapon at Closest Object
Branch To CA_Loop
These commands are used to locate the closest object to your cybertank. You
must first execute the “Scan For Closest Object” command, then use one of the “If
...” commands to determine the results.
One of the more common uses of these commands is to clear objects out of the
way that might be interfering with your cybertank’s ability to ‘“see” an enemy tank.
The above example illustrates this use. See Appendix 3 for a complete list of Object
types.
3.4 FINDING THE HEADQUARTERS
COMMAND STRUCTURE
|
8 cyc |
Scan for Enemy HQ |
|
1 cyc |
If Obstruction [is] Enemy HQ then [Branch To : Do] "Label" |
|
1 cyc |
If Obstruction [is] Ally HQ then [Branch To : Do] “Label” |
|
1 cyc |
If Enemy HQ [was] Found then [Branch To : Do] "Label" |
|
1 cyc |
If Enemy HQ [was] Not Found then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
- EnemyHQX
- EnemyHQY
- EnemyHQDist
EXAMPLE USAGE
CheckBase
Scan for Enemy HQ
If Enemy HQ was Found Then ShootIt
Rotate Scanner 1
Branch to CheckBase
ShootIt
Fire Weapon at Enemy HQ
Resume
All cybertanks are equipped with a special Headquarters Sensing Device (HSD)
that allows the scanner to detect the presence of an enemy or allied base station.
Once a base is detected and identified as friend or foe, a cybertank can decide
whether to attack or defend it. The above commands are primarily used during team
combat where the destruction of an enemy base Station results in a victory.
3.5 ROTATING THE SCANNER
COMMAND STRUCTURE
|
16 cyc |
Rotate [Scanner] Left "#" |
| |
16 cyc |
Rotate [scanned Right “X” |
| |
16 cyc |
Rotate [Scanner] To "angle" |
| |
16 cyc |
Rotate [Scanner] To "X" "Y" |
| |
16 cyc |
Rotate {Scanner] To Face [Enemy] Tank |
| |
16 cyc |
Align Scanner [with Tank] |
| |
1 cyc |
If Scanner [is] Aligned [with Tank] Then [Branch TO : Do] “Label” |
| |
1 cyc |
If Scanner [is] Not Aligned [with Tank] Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
FindTank
Rotate Scanner Right 1
Scan For Enemy Tank
If Enemy Tank was Found Then Branch To FT_FoundIt
Branch To FindTank
FT_FoundIt
Resume
Scanners rotate in eighths of a circle (45* increments). When commanding rotation,
the number of eighths to turn is specified. The following command rotates the scanner
one eighth (45 degrees) to the right:
Rotate Scanner Right 1
The following command will rotate the scanner three eighths (135 degrees) to
the left:
Rotate Scanner Left 3
Scanners can also rotate to specific directions. The directions are illustrated
in Diagram 3.5 below.
Diagram 3.5 - The eight possible directions
The following command will rotate the scanner to face northwest, regardless
of the direction it is currently pointing:
Rotate Scanner To 7
There are many instances where you need to point your scanner toward a known
location, but are not aware of the proper direction. Many CCL commands automatically
rotate your scanner in the nearest direction to face a known location.
The following command will rotate your scanner in the nearest direction to face
the coordinates X=20 and Y=14:
Rotate Scanner To 20 14
Always list the X coordinate first, followed by a space and then the Y coordinate.
go not use a comma to separate the coordinate pair
Use the following command to rotate your scanner to the nearest angle to face
an enemy cybertank at its last scanned position:
Rotate Scanner To Face Enemy Tank
The following command rotates your scanner to the direction the cybertank is
facing:
Align Scanner with Tank
3.6 LOCKING THE SCANNER ON A TARGET
COMMAND STRUCTURE
|
5 cyc |
Lock [Scanner] |
| |
5 cyc |
Unlock [Scanner] |
| |
1 cyc |
If [Scanner is] Locked then [Branch To : Do] “Label” |
| |
1 cyc |
If [Scanner is] Unlocked then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
FindTank
Scan for Enemy Tank
If Enemy Tank was Found then FT_Found
Rotate Scanner Right 1
Branch to FindTank
FT_Found
Lock Scanner
If Scanner is Unlocked Then Branch To FindTank
Resume
The Scanner lock, a special item built into the CSS, can be purchased in the
Chassis Design Module (CDM) if you have enough credits in your budget. Whenever
a “lock Scanner” instruction is executed, your cybertank’s scanner locks onto the
last scanned object, whether it is a tree, house, or another cybertank. Since trees
and houses do not move, the most useful application for the scanner is to track
the movement of enemy cybertanks.
NOTE: If an obstacle comes between your scanner and the scanned object, the
scanner can no longer “see” the object and Will automatically unlock. Also, enemy
cybertanks may be equipped with Jammers that can “unlock” your scanner. Once your
scanner is unlocked, you must continue scanning and try to detect the cybertank
again.
3.7 DETECTING A SCANNER LOCKED ON YOU
COMMAND STRUCTURE
|
1 cyc |
If [Tank is] Being Scanned Then [Branch To : Do] “Label” |
| |
1 cyc |
If [Tank is] Not Being Scanned Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
Detect
If Tank is Not Being Scanned Then Branch To DT_No
Jam Scanner Signal
DT_No
Resume
Determining if another cybertank is locked onto your cybertank requires a special
listening Device available in the Chassis Design Module. When activated, the Listening
Device checks whether or not your cybertank has been locked onto by another cybertank’s
scanner. The above example assumes the cybertank is equipped with a Listening Device
and a Jammer (see Section 3.8), both of which are fairly expensive items.
3.8 JAMMING THE ENEMY’S SCANNER
COMMAND STRUCTURE
|
8 cyc |
Jam [Scanner Signal] |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
Detect
If Tank is Not Being Scanned Then Branch To DT_No
Jam Scanner Signal
DT_No
Resume
The Jam Scanner Signal command is useful only if your cybertank is equipped
with a Jammer, a special device available in the Chassis Design Module (CDM). The
Jammer will automatically unlock all enemy cybertank scanners which have locked
onto your cybertank. This provides an opportunity for escape (hopefully) while enemy
cybertanks try to re-scan and detect your new location.
3.9 LAUNCHING REMOTE SCANNERS
COMMAND STRUCTURE
|
15 cyc |
Launch [Remote Scanner] |
|
1 cyc |
If Remote [Scanner is] Available Then [Branch To : Do] “Label” |
|
1 cyc |
If Remote [Scanner is] Unavailable Then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
- EnemyX
- EnemyY
- EnemyDist
- RemotesLeft
EXAMPLE USAGE
TryLaunch
If Remote Scanner Is Unavailable Then Branch To
TL_No
Launch Remote Scanner
TL_No
Resume
A Remote Scanner is a special device available in the Chassis Design Module
(CDM). When you purchase a Remote Scanner launcher it is built into the CSS.
Remote launchers hold four Remote Scanners. When the “launch Remote Scanner”
command is executed, the Remote launcher hurls a Remote Scanner into the air. Remote
Scanners are links between your cybertank and the OSICOM I satellite.
Once a Remote Scanner is airborne and linked to the satellite, it obtains the
location of the enemy cybertank nearest your cybertank. Remote Scanners are single
use items since they are destroyed upon impact with the ground. At the start of
each battle, your cybertank is loaded with four Remote Scanners if it has been equipped
with a Remote launcher
SECTION 4 - USING THE WEAPON
Effective use of the Cybertank Weapon System (CWS) is crucial to the design
of a potent fighting machine. Knowing when and where to fire is critical, and weapon
maintenance plays an important role in your survival. Some weapons fire faster than
others, and the amount and type of damage inflicted on the enemy depends on weapon
type.
Note: No cybertank weapon can fire through its own Defense Shield.
With all the variables that affect a weapon, it is important to be thorough
and exercise caution before deciding to “pull the trigger.”
4.1 WEAPON DAMAGE AND REPAIR
COMMAND STRUCTURE
|
1 cyc |
If Weapon [is] Functional Then [Branch To : Do] “Label” |
|
1 cyc |
If Weapon [is] Not Functional Then [Branch To : Do] “Label” |
|
60 cyc |
Repair Weapon |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
CheckWeap
If Weapon Is Functional Then Branch To CW_Exit
Repair Weapon
CS_Exit
Resume
The CWS is used to damage and destroy the enemy as well as ravage the landscape.
A well maintained weapon is one of the keys to survival. When the CWS is destroyed,
your cybertank is defenseless and generally doomed to oblivion. Repair kits are
available in the Chassis Design Module (CDM) and, if purchased, can be used at any
time to reconstruct the CWS.
4.2 DETERMINING IF AN OBJECT IS WITHIN RANGE
COMMAND STRUCTURE
|
1 cyc |
If [Enemy] Tank [is] Within [Weapon] Range then [Branch To : Do] “Label” |
|
1 cyc |
If [Enemy] Tank [is] Beyond [Weapon] Range then [Branch To : Do] “Label” |
|
1 cyc |
If [Closest] Object [is] Within [Weapon] Range then [Branch To : Do]
“Label” |
|
1 cyc |
If [Closest] Object [is] Beyond [Weapon] Range then [Branch To : Do]
“Label” |
|
1 cyc |
If Enemy HQ [is] Within [Weapon] Range then [Branch To : Do] “Label” |
|
1 cyc |
If &my HQ [is] Beyond [Weapon] Range then [Branch To : Do] “Label” |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
FindTank
Scan for Enemy Tank
If Enemy Tank Was Found Then Branch To CheckRange
Rotate Scanner Right 1
Branch to FindTank
CheckRange
If Enemy Tank is Beyond Weapon Range Then TooFar
Fire Weapon at Enemy Tank
Branch to FindTank
TooFar
Resume
Scanners range from 20 to 50 hectometers, while the weapons have only a four
(4) hectometer maximum range. CCL designers developed the above commands to determine
whether the last scanned object, enemy cybertank or enemy headquarters, is within
(or beyond) your cybertank’s weapon range. The above example first scans to find
an enemy cybertank. Once found, it checks to see if the enemy is beyond its maximum
weapon range. If the enemy is beyond range, the cybertank resumes-normal operation.
If an enemy is within range, the cybertank fires a shot and returns to scanning.
4.3 FIRING THE WEAPON
COMMAND STRUCTURE
|
40 cyc |
Fire [Weapon] at [Enemy] Tank |
|
40 cyc |
Fire [Weapon] at [Closest] Object |
|
40 cyc |
Fire [Weapon] at Obstruction |
|
40 cyc |
Fire [Weapon] at "X" “Y” |
|
40 cyc |
Fire [Weapon] at Tank Direction |
|
40 cyc |
Fire [Weapon] at Scanner Direction |
|
40 cyc |
Fire [Weapon] at Enemy HQ |
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
ClearPath
Detect Obstruction at Tank Direction
If Movement is Not Obstructed then LetsMove
Fire Weapon at Obstruction
LetsMove
Move Tank Forward 1
Resume
The CWS is a very intelligent apparatus. Using the many possible variations
of the above command, your cybertank can handle a wide variety of combat scenarios.
For example, when the command “Fire Weapon at Enemy Tank” is executed, your CWS
obtains the coordinates of the last scanned enemy cybertank from the Cybertank Scanner
System (CSS). The weapon system turns the turret to the correct direction and fires
the weapon. The same procedure is used to fire at specific locations. When firing
at either the Tank Direction or Scanner Direction, the CWS first aligns the turret
to the tank or the scanner direction.
After firing in a given direction, the projectile or laser hits the first object
in its path. If no object is in the path, the projectile hits whatever is at the
maximum weapon range (if anything). When a shot impacts an object, that object is
damaged according to the type of weapon used. Most objects, like trees and houses,
are easily demolished. Enemy cybertanks, on the other hand, are more difficult to
destroy. Brick walls and large buildings are impervious to a cybertank’s firepower
due to their reinforced design and construction. Attempting to move through an indestructible
object is futile, and very damaging to your cybertank.
Special Note: The CWS WILL NOT fire the weapon if your Defensive Shield is
up (see Section 5.2 for more information on the Defense Shield)
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
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
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:
- The MOS, CSS, and CWS are inoperable.
- All movement is terminated.
- All CommLink communications are halted.
- 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
SYSTEM VARIABLES AFFECTED
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
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
SYSTEM VARIABLES AFFECTED
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
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
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:
-
The routine “MakePath” is called with the “Do MakePath” command.
-
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).
-
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."
-
The command “Do MoveFwrd” sends execution to the routine “MoveFwrd”.
-
The “MoveFwrd” routine simply moves the cybertank forward 1 hectometer.
-
The “RESUME” command sends execution back to the line directly after the
‘“Do MoveFwrd" command, which is the “Do ScanEnemy” command.
-
The “DO ScanEnemy” command sends the AI to the routine called “ScanEnemy”.
-
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.
-
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.”
-
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
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
SECTION 6 - USING THE COMMUNICATIONS LINK
The cybertank Communications Link (Commlink), a special device which can purchased
in the Chassis Design Module (COM), enables communication between cybertanks on
the same team. When using cybertanks in the Team mode, it is often useful to transmit
various data or instructions to other members of the team. Effective use of the
Commlink aids in the performance of complicated tactical maneuvers by a team of
cybertanks.
6.1 TURNING THE COMMLINK ON AND OFF
COMMAND STRUCTURE
|
1 cyc |
Switch [CommLink] On
|
|
1 cyc |
Switch [CommLink] Off
|
SYSTEM VARIABLES AFFECTED
EXAMPLE USAGE
CheckBase
Scan for Enemy HQ
If Enemy HQ was Found Then TellTeam
Resume
TellTeam
Switch CommLink On
Transmit Code 1 To Team
Switch CommLink Off
Resume
The above commands switch your cybertank’s CommLink on and off. When on, your
cybertank can send and receive team member transmissions. When off, your cybertank’s
CommLink can neither send nor receive transmissions
6.2 TRANSMITTING AND RECEIVING ON THE COMMLINK
COMMAND STRUCTURE
|
1 cyc |
Transmit [Code] “#” [To Team]
|
|
1 cyc |
Clear [CommLink] Data |
|
1 cyc |
Copy [CommLink] Data |
SYSTEM VARIABLES AFFECTED
- AllyNum
- AllyCode
- AllyEnemyX
- AllyEnemyY
- AllyX
- AllyY
- AllyDist
- AllyDir
- AllyEnemyDist
- AllyEnemyDir
- CopyX
- CopyY
- CopyDist
- CopyDir
- CopyNum
- CopyCode
- CopyEnemyX
- CopyEnemyY
- CopyEnemyDist
- CopyEnemyDir
(For a complete description of these System Variables, see Appendix 2.)
EXAMPLE USAGE
CheckComm
If AllyCode <> then CodeHere
Clear CommLink
Branch to CheckComm
CodeHere
Switch CommLink Off
Copy CommLink Data
Switch CommLink On
If CopyCode = 1 Then EnemyFound
If CopyCode = 2 Then BaseFound
Resume
The three commands listed above are essential in the operation of the Commlink.
By transmitting various codes, a team of cybertanks can consolidate its forces and
knowledge, forming a colossal army. The code actually transmitted via CommLink can
range from 0 to 100. Cybertanks on a team have the option of ignoring any signal
transmitted. For example, if the third cybertank on a team sends a code of 7, which
all members of the team have designated as a distress call, any cybertank on the
team can either ignore the distress call or speed to the rescue.
It is important to remember that all incoming transmissions update all of the
System Variables in the Commlink (only if your cybertank’s Commlink is switched
on). To effectively use the Commlink as a receiver, a cybertank should:
-
After checking the ‘“AllyCode”, turn off the Commlink with the Switch Commlink
Off command.
-
Use the Copy Commlink Data command to establish a copy of all transmitted
variables
-
Use the Switch Commlink On command to re-establish communications.
When the Copy CommLink command is executed, all of the System Variables within
the Commlink are copied over to the “Copy...” System Variables. All of the new copied
System Variables begin with the word “Copy” and should be used in any subsequent
Al commands. Based upon the above distress call, a cybertank which is instructed
to attempt a rescue should do the following:
-
Check to see if the System Variable "AllyCode" equals 7.
-
If "AllyCode" is 7, then Switch CommLink Off to prevent any incoming transmissions
which would overwrite the needed System Variables.
-
Use the Copy CommLink Date command to make a copy of the needed System Variables.
-
Switch CommLink On to allow the checking of new incoming transmissions.
This allows the cybertank to change its duties based upon new information. For
example, the discovery of enemy headquarter’s by another team member may be
more important than saving the team member in distress. Remember, as the Al
designer, it is up to you to determine your cybertank’s priorities
-
use the “Copy...” System Variables (CopyX, CopyY, etc.) to home in on the
team member in distress.
The above, written in CCL, would resemble the following:
Checkcomm
* An AllyCode of 7 means team-member being attacked
* An Allycode of 1 means enemy HQ found
If AllyCode = 7 then Branch To Rescue
If AllyCode = 1 then Branch To FoundHQ
Resume
Rescue
* The cybertank now knows that a team-member is being
* attacked.
Switch CommLink Off
Copy CommLink Data
Switch CommLink On
* The CommLink is turned off to ensure that new incoming
* transmissions do not over-write the current values in the
* CommLink. The CommLink data is copied into another set
* of System Variables that are NOT over-written by incoming
* CommLink transmissions. It is this second set of System
* Variables that is used in subsequent Al commands. The
* CommLink is turned back on so that the cybertank can
* continue monitoring in case a more important transmission
* is received (like the Enemy HQ being found).
GoToTank
* This small routine moves the cybertank toward the team-
* member that sent the distress signal. Since the Copy
* CommLink Data command was issued, the System Variables
* CopyX and CopyY are used as the cybertank’s destination.
* Along the way, the cybertank continues checking the
* AllyCode System Variable in the CommLink to see if any
* team-member has found the enemy HQ.
Turn Tank to CopyX CopyY
Detect Obstruction at TankDir
If Movement Is Not Obstructed Then Branch To Move
Fire Weapon at TankDir
Move
Move Tank Forward 1
* Now, check to see if anyone has found the enemy HQ
If AllyCode = 1 then Branch To FoundHQ
* Now, check to see if the cybertank is at its destination
If TankX <> CopyX Then Branch To GoToTank
If TankY <> CopyY Then Branch To GoToTank
* If at destination, then return to the main Al
Resume
FoundHQ
* If the enemy HQ was found, the cybertank should perform the
* same procedure as when moving to a team-member in
* distress
Switch CommLink Off
Copy CommLink Data
Switch CommLink On
Branch To GoToHQ
* Now, the cybertank is free to use the "Copy..." System
* Variables to proceed to the team-member which found
* the enemy HQ. Since this routine is a great deal like the
* GoToTank routine used above, we will just assume the
* routine is written and is called GoToHQ.
|