Home
Documents
Training Guide

SECTION 6 - FULL CUSTOM DESIGN

SECTION BRIEF - This section describes the development of AI from the ground up. It provides information on how cybertanks operate, and are simulated. In addition, the Cybertank Command Language (CCL) is presented in more detail.

6.1 GENERAL INFORMATION

In the previous sections, cybertank Al was developed Using semicustom design techniques. Predefined sequences of CCL commands, called Library Capsules, were Used as building blocks in the AI construction. In this section, cybertank AI will be developed using Full Custom Design techniques. The AI is created entirely using individual CCL commands.

6.2 THE SIMULATED WORLD OF THE CSM

The CSM, like all simulators, attempts to approximate a real-world system by using an artificial model. As a cybertank engineer, it is important for YOU to understand the specific details of that model.

6.2.1 Battlefield Coordinate System

A battlefield is divided into a 64 x 64 grid of cells, each representing an area equal to one square hectometer (hm).
Each cell contains one of several types of terrain, such as grass, water, trees, buildings, etc. The cells surrounding the battlefield form an impenetrable wall which mark the battlefield boundaries. Each cell is identified by two numbers which are called its ‘H’ and ‘Y’ coordinates (see Diagram 6.2.1). The H-coordinate specifies the cell’s east-west position and ranges in value from zero (west wall) to sixty-three (east well). Similarly, the Y-coordinate specifies the cell’s north-south position and ranges in value from zero (north wall) to sixty-three (south wall). Many CCL commands use these coordinates. It should be noted that since the battlefield wall occupies the outer edges of the battlefield, employees should only be concerned with coordinate values from 1-62.

Diagram 6.2.1 - 64x64 battlefield grid

6.2.2 The Eight Standard Directions

Diagram 6.2.2 illustrates the eight standard directions. A cybertank can move, detect obstacles, and scan in any of these eight directions. These eight directions represent the 45’ angles of a circle.

Diagram 6.2.2. - The eight possible facing directions

6.2.3 Distance

Each cell is adjacent to eight other cells, one in each of the standard directions. When calculating distance, any two adjacent cells are considered to be one hectometer apart.

6.3 THE SIMULATED CYBERTANK

As you have learned in your previous design experience, all cybertanks have standard equipment. The following Provides insight into how these devices are simulated.

6.3.1 Movement

Movement is simulated by changing the X- and Y-Coordinates of the cybertank. A cybertank’s movement is limited to the eight standard directions. Each move of one hectometer consumes a certain amount of time, which is based on the weight of the cybertank and the speed of the drive system.

6.3.2 The Movement Sensor and the Scanner

The cybertank has a built-in movement sensor and scanner. Both devices constitute parts of the Cybertank Scanner System (CSS), but they are independent mechanisms and operate differently.
The movement sensor, referred to as the Movement Obstruction Sensor (MOS), which can be aimed in any of the eight standard directions, detects obstacles which can impede the cybertank’s movement. It is limited to a range of three hectometers and covers a one degree area (a straight line) in the direction aimed. It covers a very small area. If more than one obstacle exists along the line, the MOS always detects the one nearest the cybertank.
The scanner can be instructed to find one of three things: 1) an enemy cybertank, 2) the enemy headquarters, or 3) the nearest object. Mounted on a rotating base, the scanner can face any of the eight standard directions. It continues to face that direction until it is instructed to rotate. Scanners are available in 20, 35, and 50 hectometer ranges, with sweep angles from 30 to 90 degrees. The scanner cannot “see through” all objects. Some objects block scanner signals.

6.3.3 The Weapon System

Cybertanks can be equipped with various weapons. Each weapon type has its own characteristics. All weapons have a maximum firing range of four (4) hectometers. They can be fired at enemy cybertanks, enemy headquarters, obstructions, at the closest object, or at any specific location within range. For ease of design, they can also be fired in the direction the scanner is facing, or the direction the cybertank is currently facing.

6.4 ELEMENTS OF THE CYBERTANK COMMAND LANGUAGE

As described previously, the Cybertank Command language (CCL) is the language used to develop cybertank AI. Full Custom Design incorporates the various CCL commands individually to create the cybertank’s AI. This subsection reviews and defines some basic elements of the CCL.
The following are brief descriptions of the basic elements. Do not be alarmed as they will be fully explained, with examples, later in this section.

6.4.1 Labels

Labels are used to designate the beginning of an Al segment (or routine) that can be executed using either the Do or Branch commands. The label provides a way to reference the segment of Al It names. In ALPHA and BETA, the label Start names the entire AI for the cybertank.
Some of the characteristics of labels follow:
  • A label always begins flush with the left margin of the edit window
  • A label is always on a line by itself
  • A label names the segment of Al that follows (up until the next Label)
  • A label is usually referenced at least once by a Branch or Do command
  • A label is a maximum of ten characters long
  • A label is defined by the designer, and can be almost anything.

6.4.2 Reserved Words

The CCL commands, operators, and system variables are ‘reserved” for specific purposes and cannot be utilized as User Variables (see Section 6.4.4). See Appendix 1 for a list of Reserved Words.

6.4.3 System Variables

System Variables are used by the CCL for internal operations and represent the state of the cybertank. They may be used in computations, but cannot be altered. System variables are very useful, and often necessary, in designing cybertank Al. Examples include: TankX and TankY, which specify the cybertanks coordinates; FuelLevel, the amount of fuel remaining; and EnemyDist, the distance to the enemy. See Appendix 2 for a list of the System Variables.

6.4.4 User Variables

User Variables are defined by the AI designer. Unlike System Variables, User Variables can be altered. For example, you might make up a user variable called FuelStart. At the beginning of the AI you could store the value of FuelLevel in FuelStart. Later, you could subtract the current value of FuelLevel from FuelStart to calculate how much fuel your cybertank had consumed.

6.4.5 Action Commands

Action Commands cause the cybertank to perform a mechanical action, such as firing the weapon or rotating the scanner. These are, for the most part, self-explanatory.

6.4.6 Computation Commands

Computation commands, or logic commands, cause the on-board computer to perform computations such as arithmetic calculations. These commands are processed quickly since they do not involve mechanical activity.

6.4.7 Sequence Commands

Sequence Commands change the order in which commands are processed. When a simulation begins, the on-board computer begins processing commands starting with the first line in the cybertank’s Al. Commands are normally processed in order, beginning to end.
Sequence Commands can be used to alter the order, usually to repeat a segment of Al. For example, the command Branch to Start in BETA forces the on-board computer to "loop pack” to the beginning of the AI. As another example, Do Search causes the on-board computer to begin processing commands in the routine labeled Search. At the end of Search, another Sequence Command, Resume, causes the on-board computer to resume processing instructions from where it left off, the line immediately following the Do Search line.

6.4.8 Decision Commands

Decision Commands allow the cybertank’s on-board computer to make decisions. These commands always begin with the word If. The last part of a Decision Command is actually a Sequence Command, only processed if a specified condition is met.

6.5 THE CCL CONSTRUCTION PANEL

The CCL Construction Panel (CP) is helpful in Full Custom Design. CCL commands can be constructed by simply selecting the plaques on the CP. To get to the Al Module and the CP. select DESIGN A CYBERTANK from the DESIGN selection menu. If the File Retrieval Panel (FRP) appears, select ALPHA. At this point, you should be transferred to the Al Module.

6.5.1 Experimenting with the CCL

If you are using a mouse or joystick, you can select the CP Plaques in the usual way --by clicking on them.
If you are using the keyboard, you can use the CP as follows:
  1. Press the CONNECT key to connect to the CP.
  2. Use the CURSOR keys to highlight the desired plaque.
  3. Press RETURN.
  4. When you are through using the CP, press the CONNECT key to disconnect from the CP. Check the OSI/CACD System 2 Reference Card to determine the CONNECT key for your particular terminal type.
Try the following example. Move the Insertion Cursor (IC) to the end of the text. Select the following plaques from the CP located at the bottom of the screen:
MOVE
FORWARD
3
Notice that the command MOVE TANK FORWARD 3 has been entered into the text. Now select these plaques:
ROTATE
TO ENEMY TANK
Notice that the command ROTATE SCANNER TO FACE ENEMY TANK has been entered. Now try one more example:
IF
WEAPON
WEAPON RANGE
ENEMY WITHIN
DO
At this point, the CP is prompting you to enter a label name. Type in BLASTEM and press RETURN. Notice that the command IF ENEMY TANK IS WITHIN RANGE THEN DO BLASTEM has been entered. The CP prompts you to enter label names, variable names, or X-Y coordinates when needed to complete a particular command.

NOTE: In all of the subsections below, User Variable names are being referenced in the commands. They are being used Only as examples and have no material relevance in the CCL. System Variables can also be used in place of the User Variables in all of the below commands.

All User Variables are printed in upper and lowercase so they will stand out from the CCL commands.

6.5.2 MOVE Commands

Cybertank movement is accomplished by turning the cybertank to face one of the eight standard directions and then moving it forward or back. It is advisable to use the Movement Obstruction Sensor (MOS) before moving to avoid collision damage.
MOVE commands can specify either a fined or variable distance for the cybertank to move. A fixed distance is indicated by a number in the 1 to 62 hectometer range. A variable distance is specified by using a variable name when a variable is used, the value of the variable determines the distance the cybertank will move.
The CP can construct four different types of MOVE commands. Try building each of these:
MOVE TANK FORWARD 3
MOVE TANK FORWARD AdvanceAmount
MOVE TANK BACKWARD 2
MOVE TANK BACKWARD RetreatAmount

6.5.3 TURN Commands

TURN commands change the direction the cybertank Is facing. There are several ways to turn the cybertank. Each is discussed below. Try to construct each of the commands with the CP.
The following two commands will face the cybertank in one of the eight standard directions. For example, TURN TANK TO 5 Will turn the cybertank to face direction 5 (southwest). If a variable is used, the value of that variable determines the direction the tank will turn.
TURN TANK TO 7
TURN TANK TO NewBearing
The following group of commands turn the cybertank a specified amount relative to its current heading. For example, suppose the cybertank is facing direction 6 (west).
If the command TURN TANK RIGHT 1 is processed, the cybertank will be turned to face direction 7 (northwest).
TURN TANK LEFT 1
TURN TANK LEFT ThisMuch
TURN TANK RIGHT 2
TURN TANK RIGHT ThatMuch
The following commands turn the cybertank to face a particular object or battlefield location. The on-board computer calculates the direction that best approximates the actual direction to the object or location.
TURN TANK TO FACE ENEMY TANK
TURN TANK TO FACE ENEMY HQ
TURN TANK TO Xcoordinate Ycoordinate
Finally, the cybertank can be turned to face the same direction as its scanner.
ALIGN TANK WITH SCANNER

6.5.4 DETECT OBSTRUCTIONS Commands

The DETECT OBSTRUCTION commands tell the MOS to probe in a specified direction the nearby cells on the battlefield. The effect is to set System Variables which can then be tested. The System Variables affected are ObstacleX, ObstacleY, ObstacleType, and ObstacleDist. These variables provide the obstacle’s location, type, and distance from the cybertank. The cybertank can make decisions by testing these variables with If statements.
There are four types of DETECT OBSTRUCTION commands. Each is listed below. Try constructing each with the CP.
DETECT OBSTRUCTION AT 4
DETECT OBSTRUCTION AT ThataWay
DETECT OBSTRUCTION AT TANK DIRECTION
DETECT OBSTRUCTION AT SCANNER DIRECTION

6.5.5 SCAN Commands

The SCAN commands cause the scanner to scan an area around the cybertank for a specified type of object. The scanner can scan for enemy cybertanks, enemy headquarters, or the closest object to the cybertank. The area scanned is dependent upon the scanner’s maximum range, sweep angle, and current direction.
The scanner cannot "see" through certain types of objects such as buildings, and it is possible for an enemy cybertank or headquarters to be hidden from view. The scanner’s visibility may be improved by destroying intervening objects. For a complete list of objects and obstructions and their impact on the scanner, see Appendix 3.
The effect of scanning is to set System Variables which can then be tested. This process is similar to that of the movement sensor. The System Variables affected depend on the type of scan performed.
When scanning for enemy cybertanks, EnemyX, EnemyY, and EnemyDist are affected. These System Variables provide the enemy’s location and its distance from the cybertank.
When scanning for enemy headquarters, EnemyHQX, EnemyHQY, and EnemyHQDist are affected. These System Variables provide the headquarter’s location and its distance from the cybertank.
When scanning for the closest object to the cybertank, ObjX, ObjY, ObjType, and ObjDist are affected. These System Variables provide the object’s location, type, and distance from the cybertank.
The three SCAN commands are listed below. Try constructing each with the CP.
SCAN FOR ENEMY TANK
SCAN FOR ENEMY HEADQUARTERS
SCAN FOR CLOSEST OBJECT

6.5.6 ROTATE Commands

ROTATE commands change the direction the scanner is facing. There are several ways to rotate the scanner. Each is discussed below. Try to construct each of the ‘commands with the CP.
The following two commands face the scanner in one of the eight standard directions. For example, ROTATE SCANNER TO 3 will rotate the scanner to face direction 3 (southeast). If a variable is used, the value of the variable will determine the direction.
ROTATE SCANNER TO 7
ROTATE SCANNER TO OldBearing
The following commands rotate the scanner a specified amount relative to its current heading , For example, suppose the scanner is facing direction 4 (south). If the command ROTATE SCANNER LEFT 3 is processed, the cybertank will be turned to direction 1 (northeast).
ROTATE SCANNER LEFT 1
ROTATE SCANNER LEFT ThisMuch
ROTATE SCANNER RIGHT 2
ROTATE SCANNER RIGHT ThatMuch
The following commands rotate the scanner to face a particular object or battlefield location. The on-board computer calculates the standard direction which best approximates the actual direction to the object or location.
ROTATE SCANNER TO FACE ENEMY TANK
ROTATE SCANNER TO FACE ENEMY HQ
ROTATE SCANNER TO 52 13
ROTATE SCANNER TO Xcoordinate Ycoordinate
Finally, the scanner can be rotated to face in the same direction as the cybertank.
ALIGN SCANNER WITH TANK

6.5.7 FIRE Commands

Cybertanks can fire their weapons at specific objects, battlefield locations, or in a specified direction. When firing at either an object or a location, the direction of fire is not limited to the eight standard directions ; however , the weapon has a maximum range of four hectometers. Although the cybertank has an unlimited supply of ammunition, the Cybertank Weapon System (CWS) must be operational to use it.
The various FIRE commands are listed below. Try to construct each with the CP.
This command instructs the cybertank to fire its weapon at an obstruction previously detected by the Movement Obstruction Sensor (MOS).
FIRE WEAPON AT OBSTRUCTION
These commands fire at specific targets previously scanned by the scanner. Important: When firing at an enemy cybertank, it is possible to miss since it may move out of the way.
FIRE WEAPON AT ENEMY TANK
FIRE WEAPON AT ENEMY HQ
FIRE WEAPON AT CLOSEST OBJECT
These following commands fire at a battlefield location specified by X- and Y-coordinates.
FIRE WEAPON AT 23 46
FIRE WEAPON AT Xcoordinate Ycoordinate
The last two commands cause the weapon to fire in a specified direction.
FIRE WEAPON AT TANK DIRECTION
FIRE WEAPON AT SCANNER DIRECTION

6.5.8 Special Commands

The majority of special commands involve special equipment which is not covered in this Training Guide. For detailed information about their function, refer to CCL Reference Guide in the Engineer’s Handbook.
The special commands are listed below.
SELF DESTRUCT

LAUNCH REMOTE SCANNER
   (requires the Remote Launcher)

RAISE SHIELD

LOWER SHIELD
   (requires the Defense Shield)

JAM SCANNER SIGNAL
   (requires the Jamming Device)

LOCK SCANNER

UNLOCK SCANNER
   (requires the Scanner Lock)

REPAIR INTERNAL

REPAIR TREADS

REPAIR WEAPON

REPAIR ARMOR

REPAIR SCANNER
   (requires the Repair Kit)

6.5.9 Decision Commands

Decision Commands, also known as IF commands, are too numerous to discuss individually. All IF commands have the following form:
IF <decision condition> THEN <sequence command>
When an IF command is processed, the decision condition is tested. If the decision condition is met, then the sequence command is processed.
A few of the decision conditions are listed below. The sequence command is either a BRANCH TO “Label” command or a DO “label” command. Both are discussed in the following subsection.
TANK TREADS ARE NOT FUNCTIONAL
MOVEMENT IS OBSTRUCTED
TANK IS NOT FACING ENEMY TANK
TANK IS FACING ENEMY HO
TANK IS ALIGNED WITH SCANNER
FUEL IS EMPTY
SCANNER IS NOT FUNCTIONAL
SCANNER IS LOCKED
ENEMY TANK WAS FOUND
ENEMY HQ WAS FOUND
CLOSEST OBJECT WAS NOT FOUND
TANK IS NOT ALIGNED WITH SCANNER
WEAPON IS NOT FUNCTIONAL
ENEMY TANK IS WITHIN RANGE
ENEMY HQ IS BEYOND RANGE
CLOSEST OBJECT IS WITHIN RANGE
REMOTE SCANNER IS AVAILABLE
SHIELD IS UP
REPAIR KIT IS UNAVAILABLE
Several examples of the above decision commands follow:
IF TANK TREADS ARE NOT FUNCTION THEN BRANCH TO CantMove
IF ENEMY TANK IS WITHIN RANGE THEN DO Killit
In addition to the IF commands discussed above, there are three other forms:
IF <var> <op> <value> THEN <sequence command>
IF <var> <op> <var> + <value> THEN <sequence command>
IF <var> <op> <var> - <value> THEN <sequence command>
<var> -Represents a variable. It can either be a System or User Variable
<op> -Represents a relational operator. It can be any of the following:
< (less than)
> (greater than)
= (equal to)
<= (less than or equal to)
>= (greater than or equal to)
<> (not equal to)
<value> -Represents a value. It can be either a number, a System Variable, or a User Variable
<sequence command> -Can either be a BRANCH TO “Label” command or a DO “Label” command
Some examples of these types of IF commands follow:
IF TankY = 1 THEN BRANCH TO FoundTop
IF NewDamage > OldDamage THEN DO BeenHit
IF ScanDir = TankDir + 4 THEN BRANCH TO WatchRear
IF EnemyDist <= 4 THEN BRANCH TO FireAway
IF Delta <> NewVal - OldVal THEN BRANCH TO Error

6.5.10 Sequence Commands

Al Commands are normally processed in the order in which they appear: however, Sequence Commands can change the processing order. There are three Sequence Commands: BRANCH TO, DO, and RESUME.
The BRANCH TO command changes the processing order by redirecting the on-board computer to a specified Label. After encountering a BRANCH TO Label, the on-board computer processes the first command following the specified Label. It will continue to process commands in order from that point on. This can be used to form a loop, as in BRANCH TO START, or to skip past a segment of AI. BRANCH TO can also be written as GOTO.
The DO and RESUME commands work together. They are used primarily with routines. In Section 2, a routine was defined as “a sequence of CCL commands which causes the cybertank to perform a particular task.” To be more precise, a routine is a sequence of CCL commands beginning with a Label and ending with a RESUME command.
When the On-board computer encounters a DO “Label” command, it remembers the command’s location within the AI and then begins processing the commands following the specified Label. when the on-board computer encounters a RESUME command, it recalls the location of the DO “Label” command which called the routine and branches back to the command immediately following the DO “Label”.
In summary, the DO command causes a routine to be processed, and the RESUME command marks the end of the processed routine.

6.5.11 Assignment Commands

Assignment Commands alter the values of User Variables.
These commands are used in the following three forms:
<user var> = <value>
<user var> = <var> + <value>
<user var> = <var> - <value>
<user var> -Represents any User Variable.
<var> -Represents a variable. It can either be a System or User Variable.
<value> -Represents a value. It can be either a number, a System Variable, or a User Variable.
When an Assignment Command is processed, the User Variable on the left side of the equals sign is assigned the value of the right side.
Some examples of Assignment Commands are as follows:
MyVariable = 100
NewCount = OldCount + 5
CountDown = CountDown - 1
DirTemp = TankDir
DeltaVal = NewVal - OldVal
All variables have values from 0 to 100. Any operation that results in a number greater than 100 is automatically assigned a value of 100. Any operation that results in a number less than 0 is automatically assigned a value of 0.

6.6 DESIGNING A CYBERTANK FROM THE GROUND UP

In previous sections, predefined sequences of CCL commands, called library Capsules, were used as building blocks in AI construction. In this section, cybertank Al is developed entirely from individual CCL commands.
So far, you have designed two cybertanks. You have also designed and executed simulations. Hopefully, you are fairly comfortable with the operation of the AI Module, the Simulation Design Module (SDM), and the Combat Simulation Module (CSM). If you need further help with any of these review the appropriate section of this Training Guide.

6.6.1 Designing a Chassis

At this time, select NEW from the CYBERTANK selection menu. When the OSI/CACD System 2 asks if you want to save the changes to Alpha, select NO.
When the File Storage Panel (FSP) appears, name your new cybertank GAMMA. Once in the AI Module, select CHASSIS from the CYBERTANK selection menu to proceed to the Chassis Design Module (CDM).
While in the CDM, select whichever cybertank components you like. Keep an eye on the credits remaining. Try not to spend too much on any single item. Remember - you have a lot to choose.
After selecting GAMMA's Tank Class, Fuel Cells, Drive System, Weapon Type, and Scanner, you should proceed to the AI Module.

6.6.2 A Cybertank’s Perspective

To successfully design a cybertank’s Al, you must begin thinking about all of the tasks a cybertank must perform. YOU must begin asking yourself, “If I were a cybertank, what would I do?” To answer this question, you should ascertain exactly what it is that makes a cybertank function and then decide how to implement that function. During most battle simulations, a cybertank must accomplish three basic tasks to be effective; moving around the battlefield, searching for an enemy, and eliminating the enemy. Each of these tasks is covered in detail in the fallowing sections.

6.6.3 Moving Around the Battlefield

Like a baby, a cybertank must learn to walk before life becomes very interesting. Movement is THE most basic function used in cybertank operation.
Before tackling cybertank movement, try a simple experiment. Close your eyes and put your hands in your Pockets. Now try to walk around the room. If you are like most people, you probably ran into a few walls, chairs, or other obstructions. What you just did is visually represented in Diagram 6.6.3.1.

Diagram 6.6.3.1 - Process flow of simple movements

As you can see, the above process does not require any thinking other than that used to move forward. From the experiment, you con also tell that the process is not very effective. To move more effectively, you should leave your eyes open and your hands out of your pockets. If that were the case, then the thought process could be depicted like that shown in Diagram 6.6.3.2.

Diagram 6.6.3.2 - Process flow of complex movements

The above diagram shows the flow of your thinking while attempting to move around a room.
To See how this flow diagram works, try a specific Situation. Suppose that you ore in the corner of a room. To your left is a wall and Straight ahead is a wall. So, starting at the top of the diagram and following the arrows, you ask yourself “Is Something in my way?” The answer is “Yes, there is a wall in my way”, therefore, you follow the arrow labeled ‘“YES” and then ask yourself, “Can I move the obstruction?” Since the obstruction is a solid wall, the answer is ‘“No.” Since the wall cannot be moved. follow the arrow labeled ‘“NO” and you turn either to the left or right and repeat the process.
Since a cybertank cannot physically pick up and move an object in its path, a commonly used technique is to attempt to destroy it. If after shooting on obstruction it is Still intact, then it is known to be an indestructible object (like a wall, fortified building or water) and the cybertank must move around it.
The result of converting all the above ideas into cybertank terminology is shown below in Diagram 6.6.3.3.

Diagram 6.6.3.3 - Process flow of cybertank movement

Once you have determined the thought process for some function, converting that process to CCL commands is a fairly simple process. For example, the above flow diagram can be written in CCL as follows:
A ==> SMARTMOVE
B ==>    DETECT OBSTRUCTION ATTANK DIRECTION
         IF MOVEMENT IS NOT OBSTRUCTED THEN BRANCH
            TO GO
C ==>    FIRE WEAPON AT OBSTRUCTION
D ==>    DETECT OBSTRUCTION ATTANK DIRECTION
         IF MOVEMENT IS NOT OBSTRUCTED THEN BRANCH
            TO GO
E ==>    TURN TANK LEFT 1
         BRANCH TO SMARTMOVE
F ==> GO
         MOVE TANK FORWARD 1
G ==>    RESUME
The letters along the left side correspond to the circled letters in the flow diagram. For example, the box labeled "B" represents the instructions “DETECT OBSTRUCTION ATTANK DIRECTION” a n d “IF MOVEMENT IS NOT OBSTRUCTED THEN BRANCH TO GO”. You may have noticed that the label “GO” was included. This is because all boxes that have more than one arrow coming into them need to be preceded by a label. Since box “F” can be entered from boxes “B” and "D", it needs a label.
When developing an idea to use in a cybertank’s AI, it is a good idea to use the following three step procedure:
  1. Determine the thought process required for you as a human to accomplish the goal.
  2. Convert your human thought process to that of a cybertank. Always keep in mind the limitations of a cybertank. In the above examples, a person could have picked up a chair and moved it out of his or her path. A cybertank does not have the luxury of arms with which to physically move objects; therefore, a cybertank must accomplish the needed action the best way it can. Since a cybertank cannot physically move the obstruction, it would attempt to shoot and destroy it.
  3. The last step in developing an AI routine is converting the thought process to CCL instructions that the cybertank can understand. If you use the type of flow diagrams shown in the above examples, this conversion process should be painless.
To aid in your design training, this three step procedure will be used in the next two sections.
The above SMARTMOVE routine is going to be an integral part of your first cybertank created from scratch, so go ahead and enter it into the AI editor and AUTHORlZE it. When Authorization is complete, proceed to the ECM. When the File Modification Panel (FMP) asks if you want to save the changes you have made to GAMMA, select YES.
Once you are in the ECM, proceed to the Simulation Design Module (SDM) and design a battle simulation using your new cybertank, GAMMA. Include all of the other tanks you have worked on in previous sections of this Training Guide. Choose Austin as the battlefield. Austin has a lot of trees and buildings which GAMMA will have to maneuver around, Save the simulation design as GAMMASIM.
After designing the simulation, proceed to the Combat Simulation Module (CSM) and select the GAMMASIM simulation design. If you did everything correctly, you should see GAMMA mooing around the battlefield. GAMMA should be shooting its way through trees and small buildings, but should be turning away from large buildings, brickwalls, and water. If GAMMA does not seem to function Correctly, go back to the Al Module and check the Al you entered.
After watching GAMMA for a while, you will notice that it does not search for enemy cybertanks and does not fight back when an enemy attacks it. That is because no A I has yet been designed to handle these situations. This is what will be covered in the next section.
At this time, proceed back to the Al Module.

6.6.4 Searching For an Enemy

Searching for an enemy cybertank is actually One of the easier tasks in designing Al. Think of a battle simulation as a game of “Hide and Seek.” Your cybertank is ‘“IT” and all the other cybertanks are somewhere out on the battlefield hiding. It is your job to find them.
If you were ‘“IT” in a game of hide and seek, how would you go about finding the other players? If you are like most people, you would go from area to area, always looking around YOU for any sight of a head bobbing up from behind a table or a foot sticking out from under the curtains. This thought process is depicted in Diagram 6.6.4.1.

Diagram 6.6.4.1 - Process flow of Hide and Seek

When converting the above process flow into cybertank terminology, you must take into account the differences between humans and cybertanks. Whereas a human has eyes, a cybertank has a scanner mechanism. It uses the scanner to “look” in a particular direction. If the scanner detects an enemy cybertank, it informs, the on-board computer system just as the eyes would inform the brain that a person has been seen hiding under a table. With this in mind, the above human thought process can be converted to cybertank terminology as shown in Diagram 6.6.4.2.

Diagram 6.6.4.2 - Process flow of Cybertank Search

There are several points regarding the cybertank thought process that bear further discussion. The box labeled “F” uses the SMARTMOVE routine which was designed in the previous section. It is analogous to the "Move to a new area and start looking again” box in the Hide and Seek thought process. By moving the cybertank forward (or possibly off in a new direction due to obstacles), it is better able to cover a larger area of the battlefield in search of enemy cybertanks than it would if it just sat in one place. Going back to the Hide and Seek example, if a human stayed in one spot continually looking for people, the game would never end.
Another item that warrants further discussion is Box “E”. Box “E” performs the same function as the “Have you already looked in this direction?” in the Hide and Seek thought process. Bon “E” is only true fan answer of yes) when the scanner has made a complete 360° revolution. When this is true, Box “F” will be performed and the whole process will repeat. Going back to the Hide and Seek example, assume that your head can rotate a complete 360" revolution. If you walked into a new area to search, you could continually scan the area for people as you slowly rotated your head. As soon as your head returned to its “normal” position (i.e., straight ahead), you would know that you had scanned the entire area and could therefore move on to another area. This same type of procedure can be used with cybertanks. By checking to see if the scanner is aligned with the chassis of the cybertank, it is possible to determine if the scanner has rotated 360°.
With these facts in mind, the above cybertank search process can be converted to CCL instructions as follows:
A ==> SEARCH
B ==>    SCAN FOR ENEMY TANK
C ==>    IF ENEMY TANK WAS FOUND THEN BRANCH TO
            ENDSEARCH
D ==>    ROTATE SCANNER LEFT 1
E ==>    IF TANK IS NOT ALIGNED WITH SCANNER THEN
            SEARCH
F ==>    DO SMARTMOVE
         BRANCH TO SEARCH
G ==> ENDSEARCH
         RESUME
Go ahead and enter this SEARCH routine into GAMMA's AI. Since this is a "routine", we need a few instructions which "use" or call it. You can accomplish this with the following lines:
START
   DO SEARCH
   BRANCH TO START
These lines should be the first instructions in GAMMA’s AI. Since the routine SEARCH exits (or ends) when an enemy cybertank is found, the BRANCH TO START instruction is used to send the cybertank’s on-board computer back to the beginning of the AI (the label START).
With these three lines, the SMARTMOVE routine, and the SEARCH routine entered into GAMMA's AI, GAMMA should be able to move around the battlefield searching for an enemy. At this time, go ahead and AUTHORIZE GAMMA. If your version of GAMMA did not AUTHORIZE properly, check your Al commands to make sure you entered them correctly.
Once you have an AUTHORIZED version of GAMMA, proceed to the Combat Simulation Module (CSM). When the File Modification Panel (FMP) asks if you want to save the changes you have made to GAMMA, select YES.
When the CSM asks which simulation to use, you should Select GAMMASIM.
Once the simulation begins, you will see GAMMA moving around the battlefield. Since your cybertank’s turret always rotates with the scanner, when a new direction is specified, you should see GAMMA's turret turning in a counter-clockwise direction. If GAMMA happens to detect on enemy cybertank, it will stop moving and continually scan in the direction of the detected enemy cybertank. This is because there is no Al in GAMMA that is designed to hunt or track down on enemy. As soon as the SEARCH routine detects an enemy cybertank, it exits and the on-board computer system returns to the line directly after the "DO SEARCH” instruction. Since the next instruction after the “Do SEARCH” is a “BRANCH TO START” instruction, the on-board computer system begins executing the instructions directly after the label "STAR". Since the instruction directly after the label “START” is “DO SEARCH", the computer system directs AI execution to the routine SEARCH. The first instruction in the SEARCH routine is “SCAN FOR ENEMY TANK”. At this point, there is a very good chance that the enemy cybertank found earlier will be found again. If the enemy cybertank is found again, then the SEARCH routine exits, the computer system directs AI execution back to the “BRANCH TO START” instruction, and the process repeats., In this situation, GAMMA’s on-board computer system will continue this loop until the enemy cybertank moves out of GAMMA's view. When (and if) the enemy cybertank moves out of GAMMA’s view, GAMMA will go back to its normal scanning pattern until it detects another enemy cybertank. To solve this problem, the next section describes the creation of a “HUNT” routine.
After watching GAMMA search for enemy cybertanks for a while, proceed to the Al Module to create the last basic function of a cybertank.

6.6.5 HUNTING THE ENEMY

Now that your cybertank is moving around the battlefield and searching for enemy cybertanks, it is time to tackle the last aspect of designing a cybertank from scratch -- hunting down and destroying the enemy.
Going back to the example game of “Hide and Seek,” assume that you not only have to find the people hiding, but you must also “tag” them before they make it back to home base. Under this situation, you must ask yourself “Once I have found someone, how do I get close enough to tag him?" If you are like most people, you would move in the direction in which you last sow the person. For example, if you walk into a room und see someone in the bock-right corner, you will begin moving towards the bock-right corner. As long as the person stays in that corner, you will continue moving towards him. If, however, the person sees you coming and starts to run away, you would change your direction of pursuit to follow the person. Once you move to Within arms-reach of the person, you would reach out and attempt to “tag” him.
The above human thought process could be represented like that shown in Diagram 6.6.5.1

Diagram 6.6.5.1 - Human thought process of tagging an opponent

When converting the above human thought process to that of a cybertank, you must remember that the purpose of the cybertank is to destroy the enemy, not simply “tag” it.
Converted to cybertank terminology, the above Diagram would look something like Diagram 6.6.5.2.

Diagram 6.6.5.2 - Process flow of cybertank HUNT

Your cybertank’s HUNT routine will only be called when the SEARCH routine (designed in Section 6.6.4) has succeeded in detecting a cybertank. It should be noted that the HUNT routine will abort if the enemy cybertank manages to elude it. In other words, if the HUNT routine loses sight of the enemy, it will abort and execution will go back to the SEARCH routine.
It should also be noted that a cybertank’s weapon has a maximum range of four (4) hectometers, therefore a cybertank must move very close to the enemy before firing at it is practical.
Once the cybertank process flow is created, it can be converted to actual CCL commands as follows:
A ==> HUNT
B ==>    SCAN FOR ENEMY TANK
C ==>    IF ENEMY TANK WAS NOT FOUND THEN BRANCH
            TO HUNTDONE
D ==>    IF ENEMY TANK IS BEYOND WEAPON RANGE THEN
            BRANCH TO CLOSEIN
E ==>    FIRE WEAPON AT ENEMY TANK
         BRANCH TO HUNT
F ==> CLOSEIN
         TURN TANK TO FACE ENEMY TANK
G ==>    DO SMARTMOVE
         BRANCH TO HUNT
H ==> HUNTDONE
         RESUME
Go ahead and enter this HUNT routine into GAMMA’s AI. Since this is another routine, you need another instruction to “use” or call it when necessary. This is accomplished by inserting the line "DO HUNT” before the “BRRNCH TO START" instruction at the beginning of GAMMA’s AI. The beginning of GAMMA's AI should look like the following:
START
DO SEARCH
DO HUNT
BRANCH TO START
With these instructions, the SMARTMOVE routine, the SEARCH routine, and the newly created HUNT routine entered into GAMMA's AI, GAMMA will now be able to move around the battlefield, search for enemy cybertanks, move towards any enemy cybertanks found, and attempt to destroy them. At this time, go ahead and AUTHORIZE GAMMA. If your version of GAMMA does not AUTHORIZE properly, check all of your AI commands to make sure you have entered them correctly.
Once you have an AUTHORIZED version of GAMMA, proceed to the Combat Simulation Module (CSM). When the OSI/CACD system 2 asks if you want to save the changes you have made to GAMMA, select YES.
When the CSM asks which simulation is to be used, you should select GAMMASIM.
once the simulation begins, you should see GAMMA moving around the battlefield searching for enemy cybertanks. When GAMMA detects an enemy cybertank, It should turn to face it and begin moving towards it. Remember, if an obstruction blocks GAMMA's scanner the HUNT routine will “give up” end quit hunting. At that point, GAMMA will resume searching for other enemy cybertanks. Once GAMMA finds a clear path to an enemy cybertank, it should move to within weapon range (4 hectometers) and then begin firing. GAMMA will continue to fire at the enemy cybertank until one of three conditions is met:
  1. GAMMA is destroyed.
  2. The enemy cybertank is destroyed.
  3. The enemy cybertank moves in such a way that it is no longer detected by GAMMA.
Of course, the condition we are most interested in is the destruction of the enemy cybertank.
After watching GAMMA search for enemy cybertanks and (hopefully) destroy a few, pat yourself on the back for a job well done. You have successfully designed and implemented a cybertank from scratch. You have seen what it takes to Create a cybertank without the use of library Capsules and you have done well. If you keep in mind the three steps outlined in the previous sections in regards to creating a cybertank’s Al, you will do very well when creating future cybertank designs. Remember to always ask yourself the basic question “If I were a cybertank, what would I do?”

6.7 GOING AT IT ALONE

Now you are ready to design your own cybertanks using the Full Custom Design techniques discussed in the previous three sections. Use what you have learned to design the best AI you can. Borrow ideas from other designs and add your own. Remember to use the three step procedure outlined in the above sections.
  1. Determine the thought process necessary for a human to accomplish the task.
  2. Convert the human thought process to that of a cybertank.
  3. Convert the cybertank thought process to actual CCL commands.
You will probably have problems getting your first few designs authorized. If this happens, do not panic. Check your commands carefully and try again.
Once your cybertank design has been successfully authorized, save it. Next, you should create a new simulation design using your new cybertank as the primary cybertank, and with GAMMA, ALPHA, BETA, and VIPER as the other cybertanks. Choose a battlefield and save the simulation design.
Run the simulation and see how your new cybertank fares.
If you do not like it, transfer back to the Design Control Module (DCM) and improve it. Testing your cybertank design is the topic of the next section.

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