JRoboWar Help

What is jRoboWar?

jRoboWar is the Java implementation of the classic game RoboWar, a computer game where you match you brains in a robot bashing contest envolving simple programing. jRoboWar is written by lucas : lucasd@dai.ed.ac.uk

Quick start...

1. Load the applet, click on "add Robot", then add to the location "robots/autosam.xml"

2. click on the robots "load" button.

3. click on "add Robot", then add to the location "robots/autofred.xml"

4. click on the second robots "load" button.

5. click on quick "battle"

How do I write a robot?

Robots currently have to be written using a plain text editor (emacs, simpletext, notepad, vi...). You must first create a robot definition file for example:


<?xml version="1.0" encoding='us-ascii'?>

<robot>
  <control>
    <name>RoboTalkInterpretter</name>
    <data>
      <codeloc>autosam.rwcode</codeloc>
      <speed>15</speed>
    </data>
  </control>

  <name>autosam</name>

  <damage>1000</damage>

  <energy>1500</energy>

  <shield>500</shield>

  <faces>
    <name>_autosam</name>
    <url>bot4.gif</url>
    <x>2</x>
    <y>1</y>
  </faces>

</robot>
This robot can be found in the robots (autosam.xml) directory.

the damage energy and shield specify the robots hardware characteristics. The control section specifies how the robots is controlled. In the file specified by the codeloc section is the source code for this robot:


y recall 200 > goup godown ife
x recall 200 > goleft goright ife

main:

	random recall aim store
	range recall 0 > shoot ifg
	x recall 310 > goleft if
	x recall 90 < goright if
	
	random recall aim store
	range recall 0 > shoot ifg
	
	y recall 310 > goup if
	y recall 90 < godown if
	
	main jump

shoot:
	30 fire store
	main jump
	
	
goup:
	-4 speedy store
	jump

godown:
	4 speedy store
	jump

goleft:
	-4 speedx store
	jump

goright:
	4 speedx store
	jump

this gives an understanding of the language, which uses the concept of a stack, each tag (text string) is either an operator, a register, a literal or a non-code element. non-code element's are the location definitions which are all strings followed by a ':' chracter. These are places the robot can jump to. literals are the numbers and the places to jump to when refered to in the code and not declared (ie when they don't have the ':' character at5 the end).

The RoboTalk Language implemented


Operators:

Registers:

Trouble Shooting/notes/FAQ

loading a robot from the local file system can be done by specifying the file in the URL form:

file:// (path)

Note that the (path) must be absolute, and thus be in the form: "/root_level/.../robot";

If you have any questions you canemail me at: lucasd@dai.ed.ac.uk