Day 0

So you want to be a Combat AI Programmer? Sure, what kid hasn’t dreamed of controlling a massive robot with enough power to level a small town? Few things match the joy of watching your ideas and thoughts take form as the robot running your carefully thought out instructions lays waste to its opponents.

Over the next couple of days I’m going to cover everything you need to know to make a killer robot script and enter it into the upcoming (June 21, 2002) contest. Follow the examples presented, add some of your own ideas, and you could easily walk away with the $100 gift certificate good for any Conitec software or update.

In today’s workshop we will get you started by showing you how to download and install the Arena software, how to start a game, and how to format your own robots.

Loading the game

3DGameStudio Arena (aka 3DGSA) makes use of the 3DGameStudio development engine to run. Since the development engine can not be released by itself, this means you have to have a copy of 3DGameStudio already installed on your computer. Does this eliminate non-3DGameStudio owners? No. You can use the free 30-day trial to run 3DGSA. Simply download and install the trial from our website: http://www.conitec.net/a4update.htm

Once you have 3DGameStudio installed you should download the latest version of 3DGSA and run the install program. If all went well, you should be able to launch the "Arena Launcher" (aka GLauncher) program from your start menu. This utility will allow you to select robots, screen settings, and game types to play.

The first time you launch GLauncher you will be asked to find your "acknex.exe" file. This file is located in your 3DGameStudio ‘Bin’ folder (normally "C:\Program Files\GStudio\BIN"). You only have to do this once. Once you locate this file GLauncher will load up and you are ready to play.

 

Running a Match

To run a single match, you need to select two robots. With GLauncher open, press the "Select Robot #1" button. You will get a dialog box that allows you to select a single robot file. We’ve included several ‘demo’ robots for you to choose from. Select one of these robots by double clicking its name. Do the same for your second robot by pressing "Select Robot #2".

Once you have two robots selected, you can press the "Launch Game" button and the fight begins. You can sit back and enjoy the action, or you can control the cameras to focus on what you want to see. Complete instructions on camera and game settings are including in the online manual: http://www.conitec.net/arena/manual.htm

You can quit a game at any time by pressing the escape key.

 

Making your robot

After you run a couple of games you’ll probably want to design your own robot AI. A robot’s AI is just a simple text file containing instructions. If you have done any 3DGameStudio programming in the past most of these instructions should be familiar since Robots use a subset of the C-Script laungage ( http://www.conifiles.de/wdlman.pdf ) plus a couple of Arena specific commands and variables. The complete list of commands can be found in the online Arena Manual: http://www.conitec.net/arena/manual.htm

Note! Many C-Script commands and variables have been excluded from the Robot AI. Commands like "wait", "ent_create", "ent_remove", etc. are not valid commands because they can be abused by your robot. It wouldn’t be much fun if a robot could just "ent_create" a wall to block an opponent, or just "ent_remove" the opponent entirely! Make sure you only use the commands and variables given in the Arena Manual ( http://www.conitec.net/arena/manual.htm ) or your robot will be disqualified from the contest.

To make a robot script, use any "plain text" editor (I use Notepad) to create a simple text file. Save that text file as any name but make sure it has a ".rs" suffix. Depending on your Windows system settings, you may have difficulties changing your suffix. If you have problems changing your suffix in Windows, please check your Windows documentation or post a question on the Arena Forum ( http://www.conitecserver.com/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=forum;f=16; ).

The first four lines of any robot script should include the following:

// Name: <your real name>

// Alias: <optional name for yourself, we will use this in the contest>

// Email: <your email address>

// Robot Name: <name of your robot>

This is the robot "header". It will be used in the contest to specify your robot (we already have 3 "striker" robots entered ;)) and to notify you if you win.

The next thing you need to add is your "LOAD_ROBOT" function.

function LOAD_ROBOT()
{
robot_type = 1; // use robot #1
}

LOAD_ROBOT is one of two special functions required for every robot script. It sets the robot type to one of four robot chassis. This value can only be set inside this function and this function is only called once.

The robot types are as follows:

     1 – Cannon/MG Robot (aka Tank)
     2 – Rocket/MG Robot (aka Launcher)
     3 – Dual MG Robot (aka Fast Attack)
     4 – Dual Laser Robot (aka Hover)

The other required function is "AI_ROBOT".

function AI_ROBOT()
{
   // do stuff…
}

This function gets called 30 times a second. This is the function you will use to control your robot. The rest of the workshops will cover different things to put in this function but, for right now, lets just make your robot move forward.

function AI_ROBOT()
{
   // move forward half speed
   force_left = 50;
   force_right = 50;
}

That’s it! Save this script in your "Robot Folder" (3DgameStudio Arena (v1)\rscripts) and select it as Robot #1. You now have your very own robot!

Right now, your robot is as dumb as a rock. Don’t worry, in the next couple of days we will ‘train’ him to become a fighting machine!