BASICS
Welcome to my (Austin Barton's, not Kevin Hertzberg's) tutorial on how to program a robot for Robowar. If you have any questions that are unanswered on my Robowar page please go to the HELP section.
Creating A Robot
You have your robot now for the programming. To program this robot you must
open the drafting board which is located under VIEW. The typing area is
basically the heart of your robot. Except now it is empty. Everytime you
make a change to your robot remember to compile it or it won't notice.
Compile is found under VIEW.
The first two, Robowar reserves. The last one leaves no clue as to where it
will take us. But if thats how you want to do it, go for it. Now for good
label names:
A few pointers. You can't use the same label name twice in a program. However
you can jump to a label as much as you want. Labels can't be over...I believe
20 characters long.
If the statement is true then it goes to the desired label if not it continues
on with the program. So on the first example we have IF 5 > 3 GOTO YesItIs
That is true so the program would go to the label YesItIs. The second one,
IF X = Y THEN GOTO LetsKillEm On this one we don't know what x or y
equals but variables can be used. On the third one ! stands for does not
equal.
Now to know the difference between IF and IFG. When jumping to a label from
an IF statement it leaves an address so that later on we can go back to where
it came from. And with an IFG statement it leaves no address so later in the
future we couldn't go back to where it came from. That may sound confusing
but the example robots should help you figure it out. When using an IF
statement to return back we simply use a command called
Return. With IFG we would use the Jump
command. Here are two example robots using all we have
learned:
YesItIs:
YesItIs:
These two robots do virtually nothing. Both loop meaning they keep running
the code between Main and Main jump checking if 5 is over 3. When it is
it goes to YesItIs. The # is used to put remarks in. These are usually to
help you remember something or to comment. Don't worry we'll make a robot that
will battle soon enough.
Here are the instructions to create a robot:
To create a robot you must have labels. There is no way around not using
them. Labels are used to jump to different parts of the program. To define
a label it must always be followed by a colon (:) and when directing the
program to a label ommit the colon. When using a label make sure you
use a name that Robowar doesn't use and usually something to help you
remember what that label is for. Here are bad label names:
The IF & IFG statements are absolutely neccesary if you are to ever program
a "good" robot. There are used basically to check two or more numbers. Here
is the setup of a IF or IFG statement.
And some examples:
Example Bot Using If....Open
Example Bot Using Ifg....Open
Main:
5 3 > YesItIs If
Main jump
#5 is apperently over 3
return
Main:
5 3 > YesItIs Ifg
Main jump
#5 is apperently over 3
Main jump
In Robowar this is how it is done:
In all these examples numbers are used. However variables can be used. If you would like here is a list of available
Fire & Missile
To choose which type of bullet to use you must pick this in the hardware store.
This is located under VIEW. When using Fire or Missile this is the format
in the way to do so:
Examples:
Your robot has an amount of energy. This energy is used by moving, using shields,
or firing. On the first example one unit of energy is used to fire a bullet.
If you have Explosive bullets the amount of energy used is multiplyed by
two for the amount of damage it will deal. Normal bullets are as the energy
used and rubber is half the amount of energy. Missiles always do twice the
energy consumed but move at a much slower speed. On the third example all of
your robots current energy will be used to fire a bullet. The
bullet is used when you have explosive bullets. When using
this, instead of firing an explosive bullet you'll fire a normal bullet. This
is used when a robot is close to the robot it is firing upon. With bullet there
is no chance of being within the blast radius.
I believe now you should have learned enough information to create a robot
that can do something.
ShootEm:
Now that you have made your first robot, its time to look at the hardware
store. There are different types of robots based on the points used in the
hardware store. For now we'll be using 9 points which is considered a
Mortal robot. Here you can pick different weapons, damage, shields, energy,
and speed. Here are two robots, both have the same code, but each have
different hardware settings. Take a look at each and try battling them against
each other.
Remeber both have the same code and the same amount of points but notice how
much better one can kill the other. Hardware settings can make a world of
difference on a robot. You should notice that Bot 2 wins everytime. So when
creating a robot its best to use your hardware points wisely. I would suggest
before you go on reading to try creating a few robots knowing what you should
now know.
You've made those bots above? If you haven't I suggest doing so because now
we're moving into something that really make your bot move. Have problems
making the bots above? Open em! Energy Based Bot
or Missile Swarmer.
Speedx & Speedy
Here is an example of a simple robot which goes up and down while still
firing. I've decided you don't need to see my code anymore. But if you have
real bad problems you can open this bot.
Having problems killing those moving bots? Go to my shot
leading part of my tutorial.
This here ends the basics of Robowar. Want to make a better bot? A bot able
to think quicker? Able use your own icons and sounds for your robot?
Read the
Next section of the Robowar tutorial.
Fire and Missile are both used to shoot. There are three different types of
bullets for the Fire command.
Basic Robot....Open
Main:
range 0 > ShootEm if
aim 5 + aim' sto
Main jump
10 fire' sto
return
If there are certain variables such as aim or range you don't understand
check out
Ready to make a bot move? You can do that using speedx and speedy. Speedx
is the speedx your robot is going on the x axis. And speedy is of course the
speed your robot is going on the y axis. For your information the arena is
300 x 300 pixels. Need a
diagram of this?
You set your speeds the same way you would to fire a missile or bullet.
You can check your area in the arena with a simple IF
or IFG statement. A few things about the two speeds:
If you find an error in this site or have a suggestion please
Email Me.