http://robowiki.net/w/api.php?action=feedcontributions&user=Gentoo-Thomas&feedformat=atomRobowiki - User contributions [en]2024-03-28T20:31:51ZUser contributionsMediaWiki 1.34.1http://robowiki.net/w/index.php?title=Robocode/Download_And_Install&diff=17943Robocode/Download And Install2010-12-19T19:59:37Z<p>Gentoo-Thomas: /* Windows */</p>
<hr />
<div>This page describes how to download and install the [[Robocode]] game.<br />
<br />
== How to download Robocode ==<br />
Robocode can be downloaded from the [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 download page at SourceForge]; this page contains all Robocode releases available for download.<br />
<br />
The file you want to download is a JAR (Java ARchive) file, which is in fact a renamed ZIP file used for distributing Java programs. The name of the file will be named something like robocode-setup-x.y.z.jar, where "x.y.z" indicates the version number.<br />
<br />
===Debian/Ubuntu Users===<br />
A slightly out of date version of Robocode is available in the Universe Section of the Repos. This version is not recommended since it isn't supported by the Robocode Community.<br />
<br />
== How to install Robocode ==<br />
'''''NOTE: Java must be installed in order to install and run Robocode!''''' See the [[Robocode/System Requirements|System Requirements]] page for more info.<br />
===Windows===<br />
If Java has been properly installed (see [[Robocode/System Requirements|System Requirements]]), you should be able to install Robocode by opening (double click) the downloaded setup file (the JAR file). Change of drive and directory is possible by clicking "no" at the first dialog. Now you can change the new location.<br />
<br />
Alternatively, you could open a command prompt with "Start/Execute" in the window type in "cmd". You can drag and drop the directory/file from explorer (or desktop) to dos command window and press enter. <br />
<br />
In case of no mouse is present change the current drive and directory (using the <code>cd</code> command) to the directory you have downloaded the Robocode setup file into. Now type in ('''x.y.z''' must be replaced with the Robocode version):<br />
<pre><br />
java -jar robocode-setup-x.y.z.jar<br />
</pre><br />
<br />
===Linux===<br />
Open a shell and type in ('''x.y.z''' must be replaced with the Robocode version):<br />
java -jar robocode-setup-x.y.z.jar<br />
<br />
<br />
<br />
====Ubuntu/Debian====<br />
Ubuntu/Debian users could run into a couple of snags while installing Robocode. The best place to install it at is your ~/ directory (which is /home/account_name/ in short hand).<br />
<br />
If you have a working java compiler already, you should be set. If not, you need to get a package from the repositories with the javac program in it, or let Robocode install Jikes. If you changed your JDK recently (like <code>sun-java5-jdk</code> to <code>sun-java6-jdk</code> or <code>openjdk-6-jdk</code>), you need to run <code>sudo update-alternatives --auto javac</code> in your shell to get the new javac to link correctly.<br />
<br />
== How to get notified about new releases ==<br />
If you want to know ''exactly'' when a new release is available, you can subscribe to the Robocode file release [http://sourceforge.net/export/rss2_projfiles.php?group_id=37202 RSS feed]. The feed will provide you with a link to both the release notes and where to download Robocode.<br />
<br />
== See also ==<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/FAQ&diff=17939Robocode/FAQ2010-12-15T21:54:05Z<p>Gentoo-Thomas: /* Installing and using */</p>
<hr />
<div>Frequently asked questions about Robocode.<br />
<br />
== [[Robocode/Download|Installing]] and [[Robocode/Getting Started|using]] ==<br />
<br />
; '''I can't install Robocode.'''<br />
<br />
: Please see instructions at [[Robocode_Download_And_Install| download and install]] site. <br />
<br />
; '''I have downloaded a robot from the Web, but I don't know how to use it, because it doesn't appear anywhere.'''<br />
: By default, robots are read from the <code>/robocode/robots</code> directory. You can select "Robot -> Import Downloaded Robot" to copy a robot JAR to this directory from another location. Also, you can configure Robocode to read robots from additional locations using the Properties dialog.<br />
<br />
; '''What do I have to do to see the source code of a robot?'''<br />
: You can do two things. The first option is to open the Editor Window in Robocode and use the command in the File menu. The second option is to open the robot ".jar" file with a zip utility and find the source code there (assuming, of course, the robot is open source).<br />
<br />
; '''Can I play Robocode online?'''<br />
: Robocode is not an "online" game, so you can't, for example, share a battle with your friends in real time over the Internet. But you can upload your bots to places like [http://sites.google.com/ Google Sites] or [[RobocodeRepository|Robocode Repository]] and join any of the [[:Category:Competitions|existing competitions]] such as [[RoboRumble@Home]], or organize one with your friends.<br />
<br />
; '''I have seen that many bots are packaged into ".jar" files. How do I package my bot?'''<br />
: Select, "Robot --> Package robot for upload" from the menu, then enter your robot's details when prompted.<br />
<br />
;''' When I test my bots, Robocode is slow. Is there a way to execute the battles faster?'''<br />
: When you are testing your robot, you want to execute many battles in a short time. Minimize the Robocode main screen to make it execute the battles at full speed.<br />
<br />
; '''I get this error when trying to start Robocode: "'JAVA' is not recognized as an internal or external command, operable or batch file"'''<br />
: This is caused by an unknown path to your Java installation. Please follow [[Robocode/System_Requirements#PATH_must_be_set|this instructions]].<br />
<br />
== [[Robocode/Game Physics|Game physics]] ==<br />
<br />
; '''What is the difference between frames and ticks?'''<br />
: A tick refers to one unit, which is also called a Turn in Robocode. During one turn, you may perform one action as a Robot, or multiple (independent) actions as an AdvancedRobot. A frame is a unit of drawing to the Robocode client interface. If you are processing turns slowly, you will get one frame per tick / turn. However, if you up the turns per second beyond your computer's ability to render the frames, you will miss some frames of animation. This won't affect the robots' behavior, unless you foolishly added code in your <code>onPaint(Graphics2D)</code> method that alters your bots behavior. In that case, your bot will behave differently depending on whether or not the Paint button has been enabled, and if the framerate can keep up with the turnrate.<br />
<br />
; '''Can I fire bullets with power higher than 3.0 or lower than 1.0?'''<br />
:No and yes. You can't fire bullets with power greater than 3.0, but you can fire bullets with power as low as 0.1. If you call a firing function (i.e. <code>setFire()</code>) with a value greater than 3.0, Robocode will adjust it to 3.0, and if you call it with a power lower than 0.1 (except 0.0 which will not fire) it will adjust it to 0.1. Additionally, you can fire bullets with power less than 0.1 under one condition: when your robot has less than 0.1 energy left, in which case a bullet is fired with however much energy your robot had left.<br />
<br />
; '''How fast does a bullet travel?'''<br />
:A bullet travels at a speed between 11.0 and 19.7 depending on the power. The more powerful the bullet, the slower. The formula to calculate it is <code>velocity = 20 - (3 * power)</code>.<br />
<br />
; '''Does the robot velocity get added to the bullet velocity on firing?'''<br />
: No, bullet velocity is not affected by robot velocity. It's kind of like the speed-of-light thing. =)<br />
<br />
; '''Which is the range of a bullet?'''<br />
: A bullet has no range. It keeps going until it hits a robot or a wall.<br />
<br />
; '''I want to fire a bullet every turn, but I can't. Why?'''<br />
: Every time you fire, the gun generates some heat. You must wait till it is cool again to fire. If you give a fire order when your gun is hot, it will do nothing. The heat generated by a shot is <code>1 + (firepower / 5)</code>. The gun cools down at a default rate of 0.1 per turn (note that you can change this parameter when you run the battle, but nobody usually does). It means you can fire a 3.0 power bullet every 16 ticks.<br />
<br />
; '''How much damage does a bullet do? How do I gain or lose energy?'''<br />
: You lose energy every time you hit a wall, you are hit by an enemy bullet, ram an enemy, or you fire your gun. The amount of energy you lose by being hit is <code>4 * bullet power + 2 * max(bullet power - 1 , 0)</code>. So the maximum amount is 16.0. When you fire, you spend a quantity of energy equal to the power of the bullet fired. When one of your bullets hits an enemy, you collect back <code>3 * bullet power</code> energy. When you hit an enemy bot, each bot takes 0.6 damage. If an [[AdvancedRobot]] (but not a [[Robot]] or [[JuniorRobot]]) hits a wall, it will take <code>max(abs(velocity) * 0.5 - 1, 0)</code> damage.<br />
<br />
; '''Some times I get disabled. What happens?'''<br />
: You can't kill yourself, so when your energy drops to zero because you hit a wall or you fire, your bot gets disabled. It will not be able to move nor fire. If you are lucky enough and one of your bullets in the air hits an enemy, you will get some energy back and recover from disabled status.<br />
<br />
; '''I get disabled, but I my energy > 0. Why?'''<br />
: There are a few possible causes. You may have called a getXXX() function - such as getVelocity() - too many times a turn. The limit is 10000 getXXX() function calls per turn. To avoid disabling in such situations, either store returned values in variables for future use or use a [[RobotStatus]] object obtained from [[StatusEvent]]. Another case in which you can get disabled is throwing an exception, which may disable your bot, even if you catch the exception. Also, if your bot gets stuck in an infinite (or very long) loop and skips many turns, it may also get disabled.<br />
<br />
; '''How fast do I move?'''<br />
: You can move at a maximum speed of 8.0 units/tick. You can modify (down) your maximum velocity by using <code>setMaxVelocity(...)</code>. Note that your bot will always accelerate to reach its maximum velocity.<br />
<br />
; '''How fast do I accelerate?'''<br />
: You accelerate at 1 unit/tick, and you decelerate at 2 units/tick. For example, if you are moving at an speed of 8.0 and reverse your direction your velocities will be [6.0, 4.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0].<br />
<br />
; '''How fast do I turn?'''<br />
: The faster you go, the slower you turn. The formula to calculate it in degrees is <code>10 - 0.75 * abs(velocity)</code>.<br />
<br />
; '''What is the size of a bot?'''<br />
: The size of a bot is 36x36. Note, this is slightly smaller than the image of the bot. It is modeled as a non rotating square, so it's always the same regardless of its heading.<br />
<br />
; '''It seems that Robocode doesn't follow standard physics. If my velocity is 0 and I accelerate (acceleration = 1) my final velocity is 1, but it should be 0.5. What happened?'''<br />
: Time in Robocode, rather than being continuous, is in discrete "ticks". First acceleration is calculated, then velocity, and then position. So if you are stopped at a position 0 and you accelerate 1, your velocity next turn will be 1 and your position also 1.<br />
<br />
; '''How can I detect when an enemy has fired?'''<br />
: There is no direct way to detect when an enemy fired, but you can deduce it by monitoring the enemy energy drop. A drop between 0.1 and 3 usually means that it fired a bullet (there can be other reasons, such as a low energy bullet hit or a wall hit). Wall hits are (more or less) detectable as well. A deceleration > 2 means the bot hit a wall (or another bot). A deceleration <= 2 may be simple a bot hitting the brakes, or hitting a wall at velocity = 2, but since hitting a wall at that speed won't cause any damage, you can ignore that. AdvancedRobots take <code>abs(velocity) / 2 - 1 (Never < 0)</code> damage when hitting a wall, so by detecting (significant) wall-hits and adjusting the enemy drop accordingly, wall hits can be filtered out most of the time. This method fails when the enemy hits another robot.<br />
<br />
; '''How can I detect the position and heading of an enemy bullet?'''<br />
: You can't. There is no way to know it, directly or indirectly. But of course, you can always [[GuessFactor|guess]]...<br />
<br />
; '''How fast can I turn my gun?'''<br />
: The gun turns at 20 degrees per tick.<br />
<br />
; '''How fast can I turn my radar?'''<br />
: It turns 45 degrees per tick.<br />
<br />
; '''Can I know the heading of the enemy gun/radar?'''<br />
: No.<br />
<br />
; '''Can I specify the initial position of my bot?'''<br />
: No. The bots are randomly placed in the field at the beginning of each round.<br />
<br />
== Programming your robot ==<br />
; '''What is the difference between the setXXX() (e.g. <code>setFire()</code>) and the XXX() (e.g. <code>fire()</code>) methods?'''<br />
: Basically, the setXXX() methods just notify Robocode to take some action at the end of the turn. The XXX()-type methods end the turn when you call them, and they block your robot's thread until the command finishes. Unless you have a good reason, you should almost always use the setXXX() version when writing [[AdvancedRobot|AdvancedRobots]].<br />
<br />
; '''How can I avoid my gun/radar turning when my bot turns?'''<br />
: You can use <code>setAdjustGunForRobotTurn()</code>, <code> setAdjustRadarForGunTurn()</code>, and <code>setAdjustRadarForRobotTurn()</code> methods to control this. If you call <code>setAdjustGunForRobotTurn()</code> and <code> setAdjustRadarForGunTurn()</code>, you don't need to call <code>setAdjustRadarForRobotTurn()</code>.<br />
<br />
; '''Why are there two functions for <code>getBearing()</code> for example - one in radians and one in degrees? Is there any performance gain if I use radians instead of degrees?'''<br />
: There is no real advantage to using one or the other. Just use the one you prefer. Often, people start using degrees (just because they feel more comfortable with them) and later they switch to radians (because calculations are easier since you can use the built-in Java trigonometric functions). Just remember to use always radians or always degrees; mixing them up is not a good idea.<br />
<br />
; '''I need to trace my bots actions and variables. I saw that everybody uses <code>out.println("...")</code>, but where is that printed?'''<br />
: It prints to the [[Robocode/Robot Console|robot console]]. When you execute the battle, just click on the button on the right of the screen that shows the name of your robot to open its [[Robocode/Robot Console|console]].<br />
<br />
; '''How do you get your radar to stay focused on a robot that you have defined as your target?'''<br />
: You just turn the radar the other way around when you scan the bot. You lock your radar by not turning it 45 degrees, but only the arc needed to stay focused. See the [[Radar]] page for some example code.<br />
<br />
; '''How can I know how many enemies are in the battle field?'''<br />
: You can use the <code>getOthers()</code> method to know how many live enemies are in the battlefield.<br />
<br />
; '''I'm trying to recognize an enemy/teammate from its name (using <code>e.getName()</code>) but the condition always fails. What's happening?'''<br />
: Because of Java's funky way of interpreting references to Strings (not to mention a lack of operator overloading), you can't use an expression like <code>if (e.getName() == testname)</code> to check for equality. You have to use the <code>String.equals()</code> method, as in <code>if (e.getName().equals(testname))</code>.<br />
<br />
; '''How do I keep data from round to round and battle to battle?'''<br />
: The easiest way is to save data between rounds of a battle is to make the variables in the bot class static. Because Robocode uses a separate classloader for every robot, the variables will not conflict even when you have more than one copy of a robot in a battle. Note that this will save data between ''rounds'', not between ''battles''. To save between battles you will have to save to a file. The maximum allowed disk space for files is 200k. Look at the [[:Category:Robocode API|Robocode API]] for more details.<br />
<br />
; '''I get the following message when I run my bot, and I don't know how to solve it.'''<br />
<pre><br />
SYSTEM: You have made 10000 calls to getXX methods without calling execute()<br />
SYSTEM: Robot disabled: Too many calls to getXX methods.<br />
</pre><br />
: Robocode prevents you from calling functions like <code>getX()</code> or <code>getVelocity()</code> too many times during a single tick. So if you are using them in a long loop, it will raise this error. Actually, 95% of the time, this error is a symptom of an infinite loop in your bot. If you know you have a long-but-finite loop and you get this error, either just assign the values you want to use to a variable or use a [[RobotStatus]] object obtained from [[StatusEvent]].<br />
<br />
; '''I'm using <code>bulletObject = setFireBullet(power)</code> to fire, and then I want to get the bullet coordinates. But when I try to print them using <code>System.out.println(bulletObject.getX() + bulletObject.getY())</code> I get an error. What's wrong?'''<br />
: <code>setFireBullet()</code> creates a Bullet object, but the bullet doesn't actually leave your bots gun until the next tick, so you can't do <code>getX()</code> or <code>getY()</code> on the bullet until then. If you change it to <code>fireBullet()</code> you should be OK, because the function won't return until the bullet is in the air. If <code>fireBullet()</code> won't work for you, you'll have to devise another method of making sure that you don't do <code>getX()</code> and <code>getY()</code> on bullets until the turn after you fire. For example, you could store Bullets in an ArrayList, and print out their coordinates before you fire in your main loop, so that a given bullet will be added to the vector on one turn, but won't be accessed until the next turn when your main loop starts over. Alternatively, your bot can attempt to predict/simulate it's own location on the next tick, to know where the bullet will be created.<br />
<br />
; '''I want to reverse my direction when my movement is about to finish. I use something like <code>if (getDistanceRemaining() < minimum)</code>, but the bot behaves in a strange way.'''<br />
: The <code>getDistanceRemaining()</code> method (and in general all methods returning remaining movements of the body, gun, or radar) can return a positive or a negative value, depending on the direction of your movement. Use <code>if (Math.abs(getGetDistanceRemaining()) < minimum)</code> instead.<br />
<br />
== See also ==<br />
<br />
=== Robot API ===<br />
* [http://robocode.sourceforge.net/docs/robocode/ Robot API]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipedia entry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17938Robocode/System Requirements2010-12-15T21:51:13Z<p>Gentoo-Thomas: /* Set path on Linux */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
====Set path on Windows====<br />
Add the path to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code>.<br />
:# Find where you installed Java. The default position at: <code>C:\Program Files\Java\jre6\bin</code> <br />
:# Copy all that. <br />
:# Right click on My Computer and select Properties. The System dialogue should have appeared. On Vista, choose "Advanced system settings" in the sidebar. On XP, choose 'Advanced' tab. <br />
:# Now, click on "Environmental Variables" which is a button at the bottom right. <br />
:# Under the category "System variables" which is the lower box, scroll down to "Path" and double click on it. <br />
:# In "Variable value", go to the end of all that text and paste in the path of your java\bin directory. The one you copied earlier. Then put a semicolon <code>;</code> Here's what my Path value looks like: "set PATH=%PATH%%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Java\jre6\bin;"<br />
====Set path on Linux====<br />
Add the path to your '''PATH''' environment variable <code>PATH=$PATH:$JAVA_HOME/bin</code> [http://www.troubleshooters.com/linux/prepostpath.htm].<br />
Please consult the manual for your distribution. For Gentoo you can find usefully information at the [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5 handbook].<br />
<br />
==Troubleshooting==<br />
=== 32-bit vs. 64-bit Java ===<br />
If you do not have a 64-bit operating system, you should never install a 64-bit version of Java. If you are running 64-bit, then the normal Java versions will probably run just fine on your 64-bit system. In general, it is recommended that to stick to the 32-bit versions of Java on Windows x64, unless you need install the newest versions of Java 6 Update 12 (64-bit) or never. With older versions you migth need to setup additional stuff in order to run Java properly on your Windows x64.<br />
<br />
=== Multiple Java installations ===<br />
In some cases, people have more than one version of the JRE and/or JDK installed in their system. This is not necessarily a problem as long as your system has been properly configured to handle all of them. So if you (or any of your programs) don't need an older version of Java, then should uninstall it. The less Java Runtime Environments you have installed, the better, as your system is less likely to get confused when it has to choose which Java version to use.<br />
<br />
== See also ==<br />
=== Installation Notes from Sun ===<br />
* [http://java.sun.com/javase/6/webnotes/install/index.html Java Platform Installation]: Find installation notes for Windows, Linux, and Solaris.<br />
* [http://java.sun.com/javase/6/webnotes/install/system-configurations.html Supported System Configurations]: Find the installation notes for ''all'' supported systems.<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17937Robocode/System Requirements2010-12-15T21:47:17Z<p>Gentoo-Thomas: /* Set path on Linux */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
====Set path on Windows====<br />
Add the path to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code>.<br />
:# Find where you installed Java. The default position at: <code>C:\Program Files\Java\jre6\bin</code> <br />
:# Copy all that. <br />
:# Right click on My Computer and select Properties. The System dialogue should have appeared. On Vista, choose "Advanced system settings" in the sidebar. On XP, choose 'Advanced' tab. <br />
:# Now, click on "Environmental Variables" which is a button at the bottom right. <br />
:# Under the category "System variables" which is the lower box, scroll down to "Path" and double click on it. <br />
:# In "Variable value", go to the end of all that text and paste in the path of your java\bin directory. The one you copied earlier. Then put a semicolon <code>;</code> Here's what my Path value looks like: "set PATH=%PATH%%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Java\jre6\bin;"<br />
====Set path on Linux====<br />
Add the path to your '''PATH''' environment variable <code>PATH=$PATH:$JAVA_HOME/bin</code>.<br />
See the manual for your distribution. For Gentoo you can find usefully information at the [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5 handbook].<br />
<br />
==Troubleshooting==<br />
=== 32-bit vs. 64-bit Java ===<br />
If you do not have a 64-bit operating system, you should never install a 64-bit version of Java. If you are running 64-bit, then the normal Java versions will probably run just fine on your 64-bit system. In general, it is recommended that to stick to the 32-bit versions of Java on Windows x64, unless you need install the newest versions of Java 6 Update 12 (64-bit) or never. With older versions you migth need to setup additional stuff in order to run Java properly on your Windows x64.<br />
<br />
=== Multiple Java installations ===<br />
In some cases, people have more than one version of the JRE and/or JDK installed in their system. This is not necessarily a problem as long as your system has been properly configured to handle all of them. So if you (or any of your programs) don't need an older version of Java, then should uninstall it. The less Java Runtime Environments you have installed, the better, as your system is less likely to get confused when it has to choose which Java version to use.<br />
<br />
== See also ==<br />
=== Installation Notes from Sun ===<br />
* [http://java.sun.com/javase/6/webnotes/install/index.html Java Platform Installation]: Find installation notes for Windows, Linux, and Solaris.<br />
* [http://java.sun.com/javase/6/webnotes/install/system-configurations.html Supported System Configurations]: Find the installation notes for ''all'' supported systems.<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/FAQ&diff=17936Robocode/FAQ2010-12-15T21:34:40Z<p>Gentoo-Thomas: /* Installing and using */</p>
<hr />
<div>Frequently asked questions about Robocode.<br />
<br />
== [[Robocode/Download|Installing]] and [[Robocode/Getting Started|using]] ==<br />
<br />
; '''I can't install Robocode.'''<br />
<br />
: Please see instructions at [[Robocode_Download_And_Install| download and install]] site. <br />
<br />
; '''I have downloaded a robot from the Web, but I don't know how to use it, because it doesn't appear anywhere.'''<br />
: By default, robots are read from the <code>/robocode/robots</code> directory. You can select "Robot -> Import Downloaded Robot" to copy a robot JAR to this directory from another location. Also, you can configure Robocode to read robots from additional locations using the Properties dialog.<br />
<br />
; '''What do I have to do to see the source code of a robot?'''<br />
: You can do two things. The first option is to open the Editor Window in Robocode and use the command in the File menu. The second option is to open the robot ".jar" file with a zip utility and find the source code there (assuming, of course, the robot is open source).<br />
<br />
; '''Can I play Robocode online?'''<br />
: Robocode is not an "online" game, so you can't, for example, share a battle with your friends in real time over the Internet. But you can upload your bots to places like [http://sites.google.com/ Google Sites] or [[RobocodeRepository|Robocode Repository]] and join any of the [[:Category:Competitions|existing competitions]] such as [[RoboRumble@Home]], or organize one with your friends.<br />
<br />
; '''I have seen that many bots are packaged into ".jar" files. How do I package my bot?'''<br />
: Select, "Robot --> Package robot for upload" from the menu, then enter your robot's details when prompted.<br />
<br />
;''' When I test my bots, Robocode is slow. Is there a way to execute the battles faster?'''<br />
: When you are testing your robot, you want to execute many battles in a short time. Minimize the Robocode main screen to make it execute the battles at full speed.<br />
<br />
; '''I get this error when trying to start Robocode: "'JAVA' is not recognized as an internal or external command, operable or batch file"'''<br />
: This is caused by an unknown path to your Java installation. Please follow [http://robowiki.net/wiki/Robocode/System_Requirements#PATH_must_be_set this] instructions.<br />
<br />
== [[Robocode/Game Physics|Game physics]] ==<br />
<br />
; '''What is the difference between frames and ticks?'''<br />
: A tick refers to one unit, which is also called a Turn in Robocode. During one turn, you may perform one action as a Robot, or multiple (independent) actions as an AdvancedRobot. A frame is a unit of drawing to the Robocode client interface. If you are processing turns slowly, you will get one frame per tick / turn. However, if you up the turns per second beyond your computer's ability to render the frames, you will miss some frames of animation. This won't affect the robots' behavior, unless you foolishly added code in your <code>onPaint(Graphics2D)</code> method that alters your bots behavior. In that case, your bot will behave differently depending on whether or not the Paint button has been enabled, and if the framerate can keep up with the turnrate.<br />
<br />
; '''Can I fire bullets with power higher than 3.0 or lower than 1.0?'''<br />
:No and yes. You can't fire bullets with power greater than 3.0, but you can fire bullets with power as low as 0.1. If you call a firing function (i.e. <code>setFire()</code>) with a value greater than 3.0, Robocode will adjust it to 3.0, and if you call it with a power lower than 0.1 (except 0.0 which will not fire) it will adjust it to 0.1. Additionally, you can fire bullets with power less than 0.1 under one condition: when your robot has less than 0.1 energy left, in which case a bullet is fired with however much energy your robot had left.<br />
<br />
; '''How fast does a bullet travel?'''<br />
:A bullet travels at a speed between 11.0 and 19.7 depending on the power. The more powerful the bullet, the slower. The formula to calculate it is <code>velocity = 20 - (3 * power)</code>.<br />
<br />
; '''Does the robot velocity get added to the bullet velocity on firing?'''<br />
: No, bullet velocity is not affected by robot velocity. It's kind of like the speed-of-light thing. =)<br />
<br />
; '''Which is the range of a bullet?'''<br />
: A bullet has no range. It keeps going until it hits a robot or a wall.<br />
<br />
; '''I want to fire a bullet every turn, but I can't. Why?'''<br />
: Every time you fire, the gun generates some heat. You must wait till it is cool again to fire. If you give a fire order when your gun is hot, it will do nothing. The heat generated by a shot is <code>1 + (firepower / 5)</code>. The gun cools down at a default rate of 0.1 per turn (note that you can change this parameter when you run the battle, but nobody usually does). It means you can fire a 3.0 power bullet every 16 ticks.<br />
<br />
; '''How much damage does a bullet do? How do I gain or lose energy?'''<br />
: You lose energy every time you hit a wall, you are hit by an enemy bullet, ram an enemy, or you fire your gun. The amount of energy you lose by being hit is <code>4 * bullet power + 2 * max(bullet power - 1 , 0)</code>. So the maximum amount is 16.0. When you fire, you spend a quantity of energy equal to the power of the bullet fired. When one of your bullets hits an enemy, you collect back <code>3 * bullet power</code> energy. When you hit an enemy bot, each bot takes 0.6 damage. If an [[AdvancedRobot]] (but not a [[Robot]] or [[JuniorRobot]]) hits a wall, it will take <code>max(abs(velocity) * 0.5 - 1, 0)</code> damage.<br />
<br />
; '''Some times I get disabled. What happens?'''<br />
: You can't kill yourself, so when your energy drops to zero because you hit a wall or you fire, your bot gets disabled. It will not be able to move nor fire. If you are lucky enough and one of your bullets in the air hits an enemy, you will get some energy back and recover from disabled status.<br />
<br />
; '''I get disabled, but I my energy > 0. Why?'''<br />
: There are a few possible causes. You may have called a getXXX() function - such as getVelocity() - too many times a turn. The limit is 10000 getXXX() function calls per turn. To avoid disabling in such situations, either store returned values in variables for future use or use a [[RobotStatus]] object obtained from [[StatusEvent]]. Another case in which you can get disabled is throwing an exception, which may disable your bot, even if you catch the exception. Also, if your bot gets stuck in an infinite (or very long) loop and skips many turns, it may also get disabled.<br />
<br />
; '''How fast do I move?'''<br />
: You can move at a maximum speed of 8.0 units/tick. You can modify (down) your maximum velocity by using <code>setMaxVelocity(...)</code>. Note that your bot will always accelerate to reach its maximum velocity.<br />
<br />
; '''How fast do I accelerate?'''<br />
: You accelerate at 1 unit/tick, and you decelerate at 2 units/tick. For example, if you are moving at an speed of 8.0 and reverse your direction your velocities will be [6.0, 4.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0].<br />
<br />
; '''How fast do I turn?'''<br />
: The faster you go, the slower you turn. The formula to calculate it in degrees is <code>10 - 0.75 * abs(velocity)</code>.<br />
<br />
; '''What is the size of a bot?'''<br />
: The size of a bot is 36x36. Note, this is slightly smaller than the image of the bot. It is modeled as a non rotating square, so it's always the same regardless of its heading.<br />
<br />
; '''It seems that Robocode doesn't follow standard physics. If my velocity is 0 and I accelerate (acceleration = 1) my final velocity is 1, but it should be 0.5. What happened?'''<br />
: Time in Robocode, rather than being continuous, is in discrete "ticks". First acceleration is calculated, then velocity, and then position. So if you are stopped at a position 0 and you accelerate 1, your velocity next turn will be 1 and your position also 1.<br />
<br />
; '''How can I detect when an enemy has fired?'''<br />
: There is no direct way to detect when an enemy fired, but you can deduce it by monitoring the enemy energy drop. A drop between 0.1 and 3 usually means that it fired a bullet (there can be other reasons, such as a low energy bullet hit or a wall hit). Wall hits are (more or less) detectable as well. A deceleration > 2 means the bot hit a wall (or another bot). A deceleration <= 2 may be simple a bot hitting the brakes, or hitting a wall at velocity = 2, but since hitting a wall at that speed won't cause any damage, you can ignore that. AdvancedRobots take <code>abs(velocity) / 2 - 1 (Never < 0)</code> damage when hitting a wall, so by detecting (significant) wall-hits and adjusting the enemy drop accordingly, wall hits can be filtered out most of the time. This method fails when the enemy hits another robot.<br />
<br />
; '''How can I detect the position and heading of an enemy bullet?'''<br />
: You can't. There is no way to know it, directly or indirectly. But of course, you can always [[GuessFactor|guess]]...<br />
<br />
; '''How fast can I turn my gun?'''<br />
: The gun turns at 20 degrees per tick.<br />
<br />
; '''How fast can I turn my radar?'''<br />
: It turns 45 degrees per tick.<br />
<br />
; '''Can I know the heading of the enemy gun/radar?'''<br />
: No.<br />
<br />
; '''Can I specify the initial position of my bot?'''<br />
: No. The bots are randomly placed in the field at the beginning of each round.<br />
<br />
== Programming your robot ==<br />
; '''What is the difference between the setXXX() (e.g. <code>setFire()</code>) and the XXX() (e.g. <code>fire()</code>) methods?'''<br />
: Basically, the setXXX() methods just notify Robocode to take some action at the end of the turn. The XXX()-type methods end the turn when you call them, and they block your robot's thread until the command finishes. Unless you have a good reason, you should almost always use the setXXX() version when writing [[AdvancedRobot|AdvancedRobots]].<br />
<br />
; '''How can I avoid my gun/radar turning when my bot turns?'''<br />
: You can use <code>setAdjustGunForRobotTurn()</code>, <code> setAdjustRadarForGunTurn()</code>, and <code>setAdjustRadarForRobotTurn()</code> methods to control this. If you call <code>setAdjustGunForRobotTurn()</code> and <code> setAdjustRadarForGunTurn()</code>, you don't need to call <code>setAdjustRadarForRobotTurn()</code>.<br />
<br />
; '''Why are there two functions for <code>getBearing()</code> for example - one in radians and one in degrees? Is there any performance gain if I use radians instead of degrees?'''<br />
: There is no real advantage to using one or the other. Just use the one you prefer. Often, people start using degrees (just because they feel more comfortable with them) and later they switch to radians (because calculations are easier since you can use the built-in Java trigonometric functions). Just remember to use always radians or always degrees; mixing them up is not a good idea.<br />
<br />
; '''I need to trace my bots actions and variables. I saw that everybody uses <code>out.println("...")</code>, but where is that printed?'''<br />
: It prints to the [[Robocode/Robot Console|robot console]]. When you execute the battle, just click on the button on the right of the screen that shows the name of your robot to open its [[Robocode/Robot Console|console]].<br />
<br />
; '''How do you get your radar to stay focused on a robot that you have defined as your target?'''<br />
: You just turn the radar the other way around when you scan the bot. You lock your radar by not turning it 45 degrees, but only the arc needed to stay focused. See the [[Radar]] page for some example code.<br />
<br />
; '''How can I know how many enemies are in the battle field?'''<br />
: You can use the <code>getOthers()</code> method to know how many live enemies are in the battlefield.<br />
<br />
; '''I'm trying to recognize an enemy/teammate from its name (using <code>e.getName()</code>) but the condition always fails. What's happening?'''<br />
: Because of Java's funky way of interpreting references to Strings (not to mention a lack of operator overloading), you can't use an expression like <code>if (e.getName() == testname)</code> to check for equality. You have to use the <code>String.equals()</code> method, as in <code>if (e.getName().equals(testname))</code>.<br />
<br />
; '''How do I keep data from round to round and battle to battle?'''<br />
: The easiest way is to save data between rounds of a battle is to make the variables in the bot class static. Because Robocode uses a separate classloader for every robot, the variables will not conflict even when you have more than one copy of a robot in a battle. Note that this will save data between ''rounds'', not between ''battles''. To save between battles you will have to save to a file. The maximum allowed disk space for files is 200k. Look at the [[:Category:Robocode API|Robocode API]] for more details.<br />
<br />
; '''I get the following message when I run my bot, and I don't know how to solve it.'''<br />
<pre><br />
SYSTEM: You have made 10000 calls to getXX methods without calling execute()<br />
SYSTEM: Robot disabled: Too many calls to getXX methods.<br />
</pre><br />
: Robocode prevents you from calling functions like <code>getX()</code> or <code>getVelocity()</code> too many times during a single tick. So if you are using them in a long loop, it will raise this error. Actually, 95% of the time, this error is a symptom of an infinite loop in your bot. If you know you have a long-but-finite loop and you get this error, either just assign the values you want to use to a variable or use a [[RobotStatus]] object obtained from [[StatusEvent]].<br />
<br />
; '''I'm using <code>bulletObject = setFireBullet(power)</code> to fire, and then I want to get the bullet coordinates. But when I try to print them using <code>System.out.println(bulletObject.getX() + bulletObject.getY())</code> I get an error. What's wrong?'''<br />
: <code>setFireBullet()</code> creates a Bullet object, but the bullet doesn't actually leave your bots gun until the next tick, so you can't do <code>getX()</code> or <code>getY()</code> on the bullet until then. If you change it to <code>fireBullet()</code> you should be OK, because the function won't return until the bullet is in the air. If <code>fireBullet()</code> won't work for you, you'll have to devise another method of making sure that you don't do <code>getX()</code> and <code>getY()</code> on bullets until the turn after you fire. For example, you could store Bullets in an ArrayList, and print out their coordinates before you fire in your main loop, so that a given bullet will be added to the vector on one turn, but won't be accessed until the next turn when your main loop starts over. Alternatively, your bot can attempt to predict/simulate it's own location on the next tick, to know where the bullet will be created.<br />
<br />
; '''I want to reverse my direction when my movement is about to finish. I use something like <code>if (getDistanceRemaining() < minimum)</code>, but the bot behaves in a strange way.'''<br />
: The <code>getDistanceRemaining()</code> method (and in general all methods returning remaining movements of the body, gun, or radar) can return a positive or a negative value, depending on the direction of your movement. Use <code>if (Math.abs(getGetDistanceRemaining()) < minimum)</code> instead.<br />
<br />
== See also ==<br />
<br />
=== Robot API ===<br />
* [http://robocode.sourceforge.net/docs/robocode/ Robot API]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipedia entry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17935Robocode/System Requirements2010-12-15T21:28:24Z<p>Gentoo-Thomas: /* See also */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
====Set path on Windows====<br />
Add the path to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code>.<br />
:# Find where you installed Java. The default position at: <code>C:\Program Files\Java\jre6\bin</code> <br />
:# Copy all that. <br />
:# Right click on My Computer and select Properties. The System dialogue should have appeared. On Vista, choose "Advanced system settings" in the sidebar. On XP, choose 'Advanced' tab. <br />
:# Now, click on "Environmental Variables" which is a button at the bottom right. <br />
:# Under the category "System variables" which is the lower box, scroll down to "Path" and double click on it. <br />
:# In "Variable value", go to the end of all that text and paste in the path of your java\bin directory. The one you copied earlier. Then put a semicolon <code>;</code> Here's what my Path value looks like: "set PATH=%PATH%%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Java\jre6\bin;"<br />
====Set path on Linux====<br />
Add the path to your '''PATH''' environment variable <code>PATH=$PATH:$JAVA_HOME/bin</code>.<br />
<br />
==Troubleshooting==<br />
=== 32-bit vs. 64-bit Java ===<br />
If you do not have a 64-bit operating system, you should never install a 64-bit version of Java. If you are running 64-bit, then the normal Java versions will probably run just fine on your 64-bit system. In general, it is recommended that to stick to the 32-bit versions of Java on Windows x64, unless you need install the newest versions of Java 6 Update 12 (64-bit) or never. With older versions you migth need to setup additional stuff in order to run Java properly on your Windows x64.<br />
<br />
=== Multiple Java installations ===<br />
In some cases, people have more than one version of the JRE and/or JDK installed in their system. This is not necessarily a problem as long as your system has been properly configured to handle all of them. So if you (or any of your programs) don't need an older version of Java, then should uninstall it. The less Java Runtime Environments you have installed, the better, as your system is less likely to get confused when it has to choose which Java version to use.<br />
<br />
== See also ==<br />
=== Installation Notes from Sun ===<br />
* [http://java.sun.com/javase/6/webnotes/install/index.html Java Platform Installation]: Find installation notes for Windows, Linux, and Solaris.<br />
* [http://java.sun.com/javase/6/webnotes/install/system-configurations.html Supported System Configurations]: Find the installation notes for ''all'' supported systems.<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17934Robocode/System Requirements2010-12-15T21:27:49Z<p>Gentoo-Thomas: /* Installation and configuration */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
====Set path on Windows====<br />
Add the path to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code>.<br />
:# Find where you installed Java. The default position at: <code>C:\Program Files\Java\jre6\bin</code> <br />
:# Copy all that. <br />
:# Right click on My Computer and select Properties. The System dialogue should have appeared. On Vista, choose "Advanced system settings" in the sidebar. On XP, choose 'Advanced' tab. <br />
:# Now, click on "Environmental Variables" which is a button at the bottom right. <br />
:# Under the category "System variables" which is the lower box, scroll down to "Path" and double click on it. <br />
:# In "Variable value", go to the end of all that text and paste in the path of your java\bin directory. The one you copied earlier. Then put a semicolon <code>;</code> Here's what my Path value looks like: "set PATH=%PATH%%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Java\jre6\bin;"<br />
====Set path on Linux====<br />
Add the path to your '''PATH''' environment variable <code>PATH=$PATH:$JAVA_HOME/bin</code>.<br />
<br />
== See also ==<br />
=== Installation Notes from Sun ===<br />
* [http://java.sun.com/javase/6/webnotes/install/index.html Java Platform Installation]: Find installation notes for Windows, Linux, and Solaris.<br />
* [http://java.sun.com/javase/6/webnotes/install/system-configurations.html Supported System Configurations]: Find the installation notes for ''all'' supported systems.<br />
<br />
==== Multiple Java installations ====<br />
In some cases, people have more than one version of the JRE and/or JDK installed in their system. This is not necessarily a problem as long as your system has been properly configured to handle all of them. So if you (or any of your programs) don't need an older version of Java, then should uninstall it. The less Java Runtime Environments you have installed, the better, as your system is less likely to get confused when it has to choose which Java version to use.<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17933Robocode/System Requirements2010-12-15T21:25:42Z<p>Gentoo-Thomas: /* PATH must be set */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
====Set path on Windows====<br />
Add the path to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code>.<br />
:# Find where you installed Java. The default position at: <code>C:\Program Files\Java\jre6\bin</code> <br />
:# Copy all that. <br />
:# Right click on My Computer and select Properties. The System dialogue should have appeared. On Vista, choose "Advanced system settings" in the sidebar. On XP, choose 'Advanced' tab. <br />
:# Now, click on "Environmental Variables" which is a button at the bottom right. <br />
:# Under the category "System variables" which is the lower box, scroll down to "Path" and double click on it. <br />
:# In "Variable value", go to the end of all that text and paste in the path of your java\bin directory. The one you copied earlier. Then put a semicolon <code>;</code> Here's what my Path value looks like: "set PATH=%PATH%%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Java\jre6\bin;"<br />
====Set path on Linux====<br />
Add the path to your '''PATH''' environment variable <code>PATH=$PATH:$JAVA_HOME/bin</code>.<br />
<br />
=== 32-bit vs. 64-bit Java ===<br />
If you do not have a 64-bit operating system, you should never install a 64-bit version of Java. If you are running 64-bit, then the normal Java versions will probably run just fine on your 64-bit system. In general, it is recommended that to stick to the 32-bit versions of Java on Windows x64, unless you need install the newest versions of Java 6 Update 12 (64-bit) or never. With older versions you migth need to setup additional stuff in order to run Java properly on your Windows x64.<br />
<br />
== See also ==<br />
=== Installation Notes from Sun ===<br />
* [http://java.sun.com/javase/6/webnotes/install/index.html Java Platform Installation]: Find installation notes for Windows, Linux, and Solaris.<br />
* [http://java.sun.com/javase/6/webnotes/install/system-configurations.html Supported System Configurations]: Find the installation notes for ''all'' supported systems.<br />
<br />
==== Multiple Java installations ====<br />
In some cases, people have more than one version of the JRE and/or JDK installed in their system. This is not necessarily a problem as long as your system has been properly configured to handle all of them. So if you (or any of your programs) don't need an older version of Java, then should uninstall it. The less Java Runtime Environments you have installed, the better, as your system is less likely to get confused when it has to choose which Java version to use.<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17932Robocode/System Requirements2010-12-15T21:15:35Z<p>Gentoo-Thomas: /* See also */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Make sure that you add JAVA_HOME\bin (on Windows) to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code> (on Windows), and <code>PATH=$PATH:$JAVA_HOME/bin</code> (on Linux). Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
<br />
=== 32-bit vs. 64-bit Java ===<br />
If you do not have a 64-bit operating system, you should never install a 64-bit version of Java. If you are running 64-bit, then the normal Java versions will probably run just fine on your 64-bit system. In general, it is recommended that to stick to the 32-bit versions of Java on Windows x64, unless you need install the newest versions of Java 6 Update 12 (64-bit) or never. With older versions you migth need to setup additional stuff in order to run Java properly on your Windows x64.<br />
<br />
== See also ==<br />
=== Installation Notes from Sun ===<br />
* [http://java.sun.com/javase/6/webnotes/install/index.html Java Platform Installation]: Find installation notes for Windows, Linux, and Solaris.<br />
* [http://java.sun.com/javase/6/webnotes/install/system-configurations.html Supported System Configurations]: Find the installation notes for ''all'' supported systems.<br />
<br />
==== Multiple Java installations ====<br />
In some cases, people have more than one version of the JRE and/or JDK installed in their system. This is not necessarily a problem as long as your system has been properly configured to handle all of them. So if you (or any of your programs) don't need an older version of Java, then should uninstall it. The less Java Runtime Environments you have installed, the better, as your system is less likely to get confused when it has to choose which Java version to use.<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/System_Requirements&diff=17931Robocode/System Requirements2010-12-15T21:14:24Z<p>Gentoo-Thomas: /* Robocode requires Java */</p>
<hr />
<div>This page describes the system requirements for installing and running [[Robocode]].<br />
<br />
== Robocode requires Java ==<br />
In order to install and run Robocode, [http://java.com Java<sup>TM</sup>] must be installed on your system. The current version of Robocode requires at least Java 5 (aka Java 1.5.0) or newer. Java can be downloaded for free, and will run on most operating systems. Also note that, when we refer to Java, we mean Java SE (Standard Edition).<br />
<br />
Before downloading and installing Java, you should first check if you have a sufficient Java installation already. You can check this from this page: http://www.java.com/en/download/installed.jsp<br />
<br />
==== Java from Sun is preferred ====<br />
If you must choose between Java versions from different vendors, you should prefer the versions from Sun Microsystems. They are the official Java providers and, in general, have the least buggy Java implementation. If you use Java from other vendors, Robocode might not run stable.<br />
<br />
==== JRE and JDK ====<br />
You can choose between installing:<br />
* The JRE (Java Runtime Environment), which consists of the Java Virtual Machine used for executing Java programs.<br />
* The JDK (Java Development Kit), which contains a bundle of software for developing Java programs, including the JRE.<br />
<br />
The JRE is the core part of Java - it typically takes up less space on your system and is faster to download. Robocode requires just a JRE; if you are new to Java and just want to have a quick look at Robocode, it is recommended that you get this smaller version. If you are already used to programming in Java, you might prefer the JDK. Note that you can always install the JRE first and the JDK later on if you want to. Also, if you have a JRE but no JDK, Robocode will automatically set up the [http://jikes.sourceforge.net/ Jikes] compiler.<br />
<br />
==Installation and configuration==<br />
=== Making sure Java is installed and configured properly ===<br />
95% of the problems people run into when installing and running Robocode are due to a faulty Java installation, wrong Java configuration, bad Java VM implementation, etc. If something went wrong with this instructions please read and follow the installation notes for how to install and configure Java for your specific system.<br />
<br />
=== PATH must be set ===<br />
Make sure that you add JAVA_HOME\bin (on Windows) to your '''PATH''' environment variable, e.g. <code>PATH=%PATH%;JAVA_HOME\bin</code> (on Windows), and <code>PATH=$PATH:$JAVA_HOME/bin</code> (on Linux). Note that it is really important that you point at the 'bin' folder, and not just JAVA_HOME. The PATH must be set so your system knows where to locate <code>java.exe</code>, which is used to start the Java VM that Robocode requires.<br />
<br />
=== 32-bit vs. 64-bit Java ===<br />
If you do not have a 64-bit operating system, you should never install a 64-bit version of Java. If you are running 64-bit, then the normal Java versions will probably run just fine on your 64-bit system. In general, it is recommended that to stick to the 32-bit versions of Java on Windows x64, unless you need install the newest versions of Java 6 Update 12 (64-bit) or never. With older versions you migth need to setup additional stuff in order to run Java properly on your Windows x64.<br />
<br />
== See also ==<br />
<br />
<br />
<br />
=== Tutorials ===<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/Download_And_Install&diff=17930Robocode/Download And Install2010-12-15T21:02:07Z<p>Gentoo-Thomas: /* How to install Robocode */</p>
<hr />
<div>This page describes how to download and install the [[Robocode]] game.<br />
<br />
== How to download Robocode ==<br />
Robocode can be downloaded from the [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 download page at SourceForge]; this page contains all Robocode releases available for download.<br />
<br />
The file you want to download is a JAR (Java ARchive) file, which is in fact a renamed ZIP file used for distributing Java programs. The name of the file will be named something like robocode-setup-x.y.z.jar, where "x.y.z" indicates the version number.<br />
<br />
===Debian/Ubuntu Users===<br />
A slightly out of date version of Robocode is available in the Universe Section of the Repos. This version is not recommended since it isn't supported by the Robocode Community.<br />
<br />
== How to install Robocode ==<br />
'''''NOTE: Java must be installed in order to install and run Robocode!''''' See the [[Robocode/System Requirements|System Requirements]] page for more info.<br />
===Windows===<br />
If Java has been properly installed (see [[Robocode/System Requirements|System Requirements]]), you should be able to install Robocode by opening (double click) the downloaded setup file (the JAR file).<br />
<br />
Alternatively, you could open a command prompt with "Start/Execute" in the window type in "cmd". Change the current drive and directory (using the <code>cd</code> command) to the directory you have downloaded the Robocode setup file into. You can drag and drop the directory/file from explorer to dos command window. Now type in ('''x.y.z''' must be replaced with the Robocode version):<br />
<pre><br />
java -jar robocode-setup-x.y.z.jar<br />
</pre><br />
<br />
===Linux===<br />
Open a shell and type in ('''x.y.z''' must be replaced with the Robocode version):<br />
java -jar robocode-setup-x.y.z.jar<br />
<br />
<br />
<br />
====Ubuntu/Debian====<br />
Ubuntu/Debian users could run into a couple of snags while installing Robocode. The best place to install it at is your ~/ directory (which is /home/account_name/ in short hand).<br />
<br />
If you have a working java compiler already, you should be set. If not, you need to get a package from the repositories with the javac program in it, or let Robocode install Jikes. If you changed your JDK recently (like <code>sun-java5-jdk</code> to <code>sun-java6-jdk</code> or <code>openjdk-6-jdk</code>), you need to run <code>sudo update-alternatives --auto javac</code> in your shell to get the new javac to link correctly.<br />
<br />
== How to get notified about new releases ==<br />
If you want to know ''exactly'' when a new release is available, you can subscribe to the Robocode file release [http://sourceforge.net/export/rss2_projfiles.php?group_id=37202 RSS feed]. The feed will provide you with a link to both the release notes and where to download Robocode.<br />
<br />
== See also ==<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/Download_And_Install&diff=17929Robocode/Download And Install2010-12-15T20:58:25Z<p>Gentoo-Thomas: /* How to download Robocode */</p>
<hr />
<div>This page describes how to download and install the [[Robocode]] game.<br />
<br />
== How to download Robocode ==<br />
Robocode can be downloaded from the [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 download page at SourceForge]; this page contains all Robocode releases available for download.<br />
<br />
The file you want to download is a JAR (Java ARchive) file, which is in fact a renamed ZIP file used for distributing Java programs. The name of the file will be named something like robocode-setup-x.y.z.jar, where "x.y.z" indicates the version number.<br />
<br />
===Debian/Ubuntu Users===<br />
A slightly out of date version of Robocode is available in the Universe Section of the Repos. This version is not recommended since it isn't supported by the Robocode Community.<br />
<br />
== How to install Robocode ==<br />
===Windows===<br />
If Java has been properly installed (see [[Robocode/System Requirements|System Requirements]]), you should be able to install Robocode by opening (double click) the downloaded setup file (the JAR file).<br />
<br />
Alternatively, you could open a command prompt with "Start/Execute" in the window type in "cmd". Change the current directory (using the <code>cd</code> command) to the directory you have downloaded the Robocode setup file into, and then type ('''x.y.z''' must be replaced with the Robocode version):<br />
<pre><br />
java -jar robocode-setup-x.y.z.jar<br />
</pre><br />
<br />
===Linux===<br />
Open a shell and type in ('''x.y.z''' must be replaced with the Robocode version):<br />
java -jar robocode-setup-x.y.z.jar<br />
<br />
<br />
<br />
====Ubuntu/Debian====<br />
Ubuntu/Debian users could run into a couple of snags while installing Robocode. The best place to install it at is your ~/ directory (which is /home/account_name/ in short hand).<br />
<br />
If you have a working java compiler already, you should be set. If not, you need to get a package from the repositories with the javac program in it, or let Robocode install Jikes. If you changed your JDK recently (like <code>sun-java5-jdk</code> to <code>sun-java6-jdk</code> or <code>openjdk-6-jdk</code>), you need to run <code>sudo update-alternatives --auto javac</code> in your shell to get the new javac to link correctly.<br />
<br />
== How to get notified about new releases ==<br />
If you want to know ''exactly'' when a new release is available, you can subscribe to the Robocode file release [http://sourceforge.net/export/rss2_projfiles.php?group_id=37202 RSS feed]. The feed will provide you with a link to both the release notes and where to download Robocode.<br />
<br />
== See also ==<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/FAQ&diff=17928Robocode/FAQ2010-12-15T20:56:37Z<p>Gentoo-Thomas: /* Installing and using */</p>
<hr />
<div>Frequently asked questions about Robocode.<br />
<br />
== [[Robocode/Download|Installing]] and [[Robocode/Getting Started|using]] ==<br />
<br />
; '''I can't install Robocode.'''<br />
<br />
: Please see instructions at [[Robocode_Download_And_Install| download and install]] site. <br />
<br />
; '''I have downloaded a robot from the Web, but I don't know how to use it, because it doesn't appear anywhere.'''<br />
: By default, robots are read from the <code>/robocode/robots</code> directory. You can select "Robot -> Import Downloaded Robot" to copy a robot JAR to this directory from another location. Also, you can configure Robocode to read robots from additional locations using the Properties dialog.<br />
<br />
; '''What do I have to do to see the source code of a robot?'''<br />
: You can do two things. The first option is to open the Editor Window in Robocode and use the command in the File menu. The second option is to open the robot ".jar" file with a zip utility and find the source code there (assuming, of course, the robot is open source).<br />
<br />
; '''Can I play Robocode online?'''<br />
: Robocode is not an "online" game, so you can't, for example, share a battle with your friends in real time over the Internet. But you can upload your bots to places like [http://sites.google.com/ Google Sites] or [[RobocodeRepository|Robocode Repository]] and join any of the [[:Category:Competitions|existing competitions]] such as [[RoboRumble@Home]], or organize one with your friends.<br />
<br />
; '''I have seen that many bots are packaged into ".jar" files. How do I package my bot?'''<br />
: Select, "Robot --> Package robot for upload" from the menu, then enter your robot's details when prompted.<br />
<br />
;''' When I test my bots, Robocode is slow. Is there a way to execute the battles faster?'''<br />
: When you are testing your robot, you want to execute many battles in a short time. Minimize the Robocode main screen to make it execute the battles at full speed.<br />
<br />
; '''I get this error when trying to start Robocode: "'JAVA' is not recognized as an internal or external command, operable or batch file"'''<br />
:<br />
:# Find where you installed Java. The default position at: <code>C:\Program Files\Java\jre6\bin</code> <br />
:#: Yeah, find the path to the bin directory in the java directory. <br />
:# Copy all that. <br />
:# Right click on My Computer and select Properties. The System dialogue should have appeared. On Vista, choose "Advanced system settings" in the sidebar. On XP, choose 'Advanced' tab. <br />
:# Now, click on "Environmental Variables" which is a button at the bottom right. <br />
:# Under the category "System variables" which is the lower box, scroll down to "Path" and double click on it. <br />
:# In "Variable value", go to the end of all that text and paste in the path of your java\bin directory. The one you copied earlier. Then put a semicolon <code>;</code> Here's what my Path value looks like: "set PATH=%PATH%%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Java\jre6\bin;"<br />
<br />
== [[Robocode/Game Physics|Game physics]] ==<br />
<br />
; '''What is the difference between frames and ticks?'''<br />
: A tick refers to one unit, which is also called a Turn in Robocode. During one turn, you may perform one action as a Robot, or multiple (independent) actions as an AdvancedRobot. A frame is a unit of drawing to the Robocode client interface. If you are processing turns slowly, you will get one frame per tick / turn. However, if you up the turns per second beyond your computer's ability to render the frames, you will miss some frames of animation. This won't affect the robots' behavior, unless you foolishly added code in your <code>onPaint(Graphics2D)</code> method that alters your bots behavior. In that case, your bot will behave differently depending on whether or not the Paint button has been enabled, and if the framerate can keep up with the turnrate.<br />
<br />
; '''Can I fire bullets with power higher than 3.0 or lower than 1.0?'''<br />
:No and yes. You can't fire bullets with power greater than 3.0, but you can fire bullets with power as low as 0.1. If you call a firing function (i.e. <code>setFire()</code>) with a value greater than 3.0, Robocode will adjust it to 3.0, and if you call it with a power lower than 0.1 (except 0.0 which will not fire) it will adjust it to 0.1. Additionally, you can fire bullets with power less than 0.1 under one condition: when your robot has less than 0.1 energy left, in which case a bullet is fired with however much energy your robot had left.<br />
<br />
; '''How fast does a bullet travel?'''<br />
:A bullet travels at a speed between 11.0 and 19.7 depending on the power. The more powerful the bullet, the slower. The formula to calculate it is <code>velocity = 20 - (3 * power)</code>.<br />
<br />
; '''Does the robot velocity get added to the bullet velocity on firing?'''<br />
: No, bullet velocity is not affected by robot velocity. It's kind of like the speed-of-light thing. =)<br />
<br />
; '''Which is the range of a bullet?'''<br />
: A bullet has no range. It keeps going until it hits a robot or a wall.<br />
<br />
; '''I want to fire a bullet every turn, but I can't. Why?'''<br />
: Every time you fire, the gun generates some heat. You must wait till it is cool again to fire. If you give a fire order when your gun is hot, it will do nothing. The heat generated by a shot is <code>1 + (firepower / 5)</code>. The gun cools down at a default rate of 0.1 per turn (note that you can change this parameter when you run the battle, but nobody usually does). It means you can fire a 3.0 power bullet every 16 ticks.<br />
<br />
; '''How much damage does a bullet do? How do I gain or lose energy?'''<br />
: You lose energy every time you hit a wall, you are hit by an enemy bullet, ram an enemy, or you fire your gun. The amount of energy you lose by being hit is <code>4 * bullet power + 2 * max(bullet power - 1 , 0)</code>. So the maximum amount is 16.0. When you fire, you spend a quantity of energy equal to the power of the bullet fired. When one of your bullets hits an enemy, you collect back <code>3 * bullet power</code> energy. When you hit an enemy bot, each bot takes 0.6 damage. If an [[AdvancedRobot]] (but not a [[Robot]] or [[JuniorRobot]]) hits a wall, it will take <code>max(abs(velocity) * 0.5 - 1, 0)</code> damage.<br />
<br />
; '''Some times I get disabled. What happens?'''<br />
: You can't kill yourself, so when your energy drops to zero because you hit a wall or you fire, your bot gets disabled. It will not be able to move nor fire. If you are lucky enough and one of your bullets in the air hits an enemy, you will get some energy back and recover from disabled status.<br />
<br />
; '''I get disabled, but I my energy > 0. Why?'''<br />
: There are a few possible causes. You may have called a getXXX() function - such as getVelocity() - too many times a turn. The limit is 10000 getXXX() function calls per turn. To avoid disabling in such situations, either store returned values in variables for future use or use a [[RobotStatus]] object obtained from [[StatusEvent]]. Another case in which you can get disabled is throwing an exception, which may disable your bot, even if you catch the exception. Also, if your bot gets stuck in an infinite (or very long) loop and skips many turns, it may also get disabled.<br />
<br />
; '''How fast do I move?'''<br />
: You can move at a maximum speed of 8.0 units/tick. You can modify (down) your maximum velocity by using <code>setMaxVelocity(...)</code>. Note that your bot will always accelerate to reach its maximum velocity.<br />
<br />
; '''How fast do I accelerate?'''<br />
: You accelerate at 1 unit/tick, and you decelerate at 2 units/tick. For example, if you are moving at an speed of 8.0 and reverse your direction your velocities will be [6.0, 4.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0].<br />
<br />
; '''How fast do I turn?'''<br />
: The faster you go, the slower you turn. The formula to calculate it in degrees is <code>10 - 0.75 * abs(velocity)</code>.<br />
<br />
; '''What is the size of a bot?'''<br />
: The size of a bot is 36x36. Note, this is slightly smaller than the image of the bot. It is modeled as a non rotating square, so it's always the same regardless of its heading.<br />
<br />
; '''It seems that Robocode doesn't follow standard physics. If my velocity is 0 and I accelerate (acceleration = 1) my final velocity is 1, but it should be 0.5. What happened?'''<br />
: Time in Robocode, rather than being continuous, is in discrete "ticks". First acceleration is calculated, then velocity, and then position. So if you are stopped at a position 0 and you accelerate 1, your velocity next turn will be 1 and your position also 1.<br />
<br />
; '''How can I detect when an enemy has fired?'''<br />
: There is no direct way to detect when an enemy fired, but you can deduce it by monitoring the enemy energy drop. A drop between 0.1 and 3 usually means that it fired a bullet (there can be other reasons, such as a low energy bullet hit or a wall hit). Wall hits are (more or less) detectable as well. A deceleration > 2 means the bot hit a wall (or another bot). A deceleration <= 2 may be simple a bot hitting the brakes, or hitting a wall at velocity = 2, but since hitting a wall at that speed won't cause any damage, you can ignore that. AdvancedRobots take <code>abs(velocity) / 2 - 1 (Never < 0)</code> damage when hitting a wall, so by detecting (significant) wall-hits and adjusting the enemy drop accordingly, wall hits can be filtered out most of the time. This method fails when the enemy hits another robot.<br />
<br />
; '''How can I detect the position and heading of an enemy bullet?'''<br />
: You can't. There is no way to know it, directly or indirectly. But of course, you can always [[GuessFactor|guess]]...<br />
<br />
; '''How fast can I turn my gun?'''<br />
: The gun turns at 20 degrees per tick.<br />
<br />
; '''How fast can I turn my radar?'''<br />
: It turns 45 degrees per tick.<br />
<br />
; '''Can I know the heading of the enemy gun/radar?'''<br />
: No.<br />
<br />
; '''Can I specify the initial position of my bot?'''<br />
: No. The bots are randomly placed in the field at the beginning of each round.<br />
<br />
== Programming your robot ==<br />
; '''What is the difference between the setXXX() (e.g. <code>setFire()</code>) and the XXX() (e.g. <code>fire()</code>) methods?'''<br />
: Basically, the setXXX() methods just notify Robocode to take some action at the end of the turn. The XXX()-type methods end the turn when you call them, and they block your robot's thread until the command finishes. Unless you have a good reason, you should almost always use the setXXX() version when writing [[AdvancedRobot|AdvancedRobots]].<br />
<br />
; '''How can I avoid my gun/radar turning when my bot turns?'''<br />
: You can use <code>setAdjustGunForRobotTurn()</code>, <code> setAdjustRadarForGunTurn()</code>, and <code>setAdjustRadarForRobotTurn()</code> methods to control this. If you call <code>setAdjustGunForRobotTurn()</code> and <code> setAdjustRadarForGunTurn()</code>, you don't need to call <code>setAdjustRadarForRobotTurn()</code>.<br />
<br />
; '''Why are there two functions for <code>getBearing()</code> for example - one in radians and one in degrees? Is there any performance gain if I use radians instead of degrees?'''<br />
: There is no real advantage to using one or the other. Just use the one you prefer. Often, people start using degrees (just because they feel more comfortable with them) and later they switch to radians (because calculations are easier since you can use the built-in Java trigonometric functions). Just remember to use always radians or always degrees; mixing them up is not a good idea.<br />
<br />
; '''I need to trace my bots actions and variables. I saw that everybody uses <code>out.println("...")</code>, but where is that printed?'''<br />
: It prints to the [[Robocode/Robot Console|robot console]]. When you execute the battle, just click on the button on the right of the screen that shows the name of your robot to open its [[Robocode/Robot Console|console]].<br />
<br />
; '''How do you get your radar to stay focused on a robot that you have defined as your target?'''<br />
: You just turn the radar the other way around when you scan the bot. You lock your radar by not turning it 45 degrees, but only the arc needed to stay focused. See the [[Radar]] page for some example code.<br />
<br />
; '''How can I know how many enemies are in the battle field?'''<br />
: You can use the <code>getOthers()</code> method to know how many live enemies are in the battlefield.<br />
<br />
; '''I'm trying to recognize an enemy/teammate from its name (using <code>e.getName()</code>) but the condition always fails. What's happening?'''<br />
: Because of Java's funky way of interpreting references to Strings (not to mention a lack of operator overloading), you can't use an expression like <code>if (e.getName() == testname)</code> to check for equality. You have to use the <code>String.equals()</code> method, as in <code>if (e.getName().equals(testname))</code>.<br />
<br />
; '''How do I keep data from round to round and battle to battle?'''<br />
: The easiest way is to save data between rounds of a battle is to make the variables in the bot class static. Because Robocode uses a separate classloader for every robot, the variables will not conflict even when you have more than one copy of a robot in a battle. Note that this will save data between ''rounds'', not between ''battles''. To save between battles you will have to save to a file. The maximum allowed disk space for files is 200k. Look at the [[:Category:Robocode API|Robocode API]] for more details.<br />
<br />
; '''I get the following message when I run my bot, and I don't know how to solve it.'''<br />
<pre><br />
SYSTEM: You have made 10000 calls to getXX methods without calling execute()<br />
SYSTEM: Robot disabled: Too many calls to getXX methods.<br />
</pre><br />
: Robocode prevents you from calling functions like <code>getX()</code> or <code>getVelocity()</code> too many times during a single tick. So if you are using them in a long loop, it will raise this error. Actually, 95% of the time, this error is a symptom of an infinite loop in your bot. If you know you have a long-but-finite loop and you get this error, either just assign the values you want to use to a variable or use a [[RobotStatus]] object obtained from [[StatusEvent]].<br />
<br />
; '''I'm using <code>bulletObject = setFireBullet(power)</code> to fire, and then I want to get the bullet coordinates. But when I try to print them using <code>System.out.println(bulletObject.getX() + bulletObject.getY())</code> I get an error. What's wrong?'''<br />
: <code>setFireBullet()</code> creates a Bullet object, but the bullet doesn't actually leave your bots gun until the next tick, so you can't do <code>getX()</code> or <code>getY()</code> on the bullet until then. If you change it to <code>fireBullet()</code> you should be OK, because the function won't return until the bullet is in the air. If <code>fireBullet()</code> won't work for you, you'll have to devise another method of making sure that you don't do <code>getX()</code> and <code>getY()</code> on bullets until the turn after you fire. For example, you could store Bullets in an ArrayList, and print out their coordinates before you fire in your main loop, so that a given bullet will be added to the vector on one turn, but won't be accessed until the next turn when your main loop starts over. Alternatively, your bot can attempt to predict/simulate it's own location on the next tick, to know where the bullet will be created.<br />
<br />
; '''I want to reverse my direction when my movement is about to finish. I use something like <code>if (getDistanceRemaining() < minimum)</code>, but the bot behaves in a strange way.'''<br />
: The <code>getDistanceRemaining()</code> method (and in general all methods returning remaining movements of the body, gun, or radar) can return a positive or a negative value, depending on the direction of your movement. Use <code>if (Math.abs(getGetDistanceRemaining()) < minimum)</code> instead.<br />
<br />
== See also ==<br />
<br />
=== Robot API ===<br />
* [http://robocode.sourceforge.net/docs/robocode/ Robot API]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Download|How to download and install Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipedia entry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/Getting_Started&diff=17927Robocode/Getting Started2010-12-15T20:53:35Z<p>Gentoo-Thomas: /* Getting Started */</p>
<hr />
<div>== Getting Started ==<br />
After [[Robocode_Download_And_Install|installation]] first, let's run a battle to see what the game looks like. Simply click the '''Battle''' menu, then select '''New''', as shown on the picture here:<br />
<br />
[[Image:NewBattle.png|Starting a new battle by selecting New in the Battle menu]]<br />
<br />
<br />
You'll be presented with the '''New Battle''' screen, where you pick the robots and options for a battle. For this battle, we'll try out MyFirstRobot, RamFire, and Tracker. Add them in by double-clicking on their names (or selecting each one and clicking '''Add''') The screen should now look something like this:<br />
<br />
[[Image:NewBattleDialog.png|Shows the New Battle dialog where the user can select which robots to add to a new battle]]<br />
<br />
See the '''Number of Rounds''' box in the middle?<br />
<br />
In Robocode, each battle consists of a number of rounds, as you'll see soon. For now, we'll leave it at the default of 10.<br />
<br />
Finally, click on the '''Start Battle''' button to begin! Watch for Tracker's little dance as he wins rounds.<br />
<br />
== See also ==<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System_Requirements|System Requirements]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial (Java)]]<br />
* [[Robocode/.NET/Create_a_.NET_robot_with_Visual_Studio|Create a .NET robot with Visual Studio]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot (Java)]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots in Eclipse]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]<br />
[[Category:Tutorials]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/Download_And_Install&diff=17926Robocode/Download And Install2010-12-15T20:18:00Z<p>Gentoo-Thomas: /* How to install Robocode */</p>
<hr />
<div>This page describes how to download and install the [[Robocode]] game.<br />
<br />
== How to download Robocode ==<br />
'''''NOTE: Java must be installed in order to install and run Robocode!''''' See the [[Robocode/System Requirements|System Requirements]] page for more info.<br />
<br />
Robocode can be downloaded from the [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 download page at SourceForge]; this page contains all Robocode releases available for download.<br />
<br />
The file you want to download is a JAR (Java ARchive) file, which is in fact a renamed ZIP file used for distributing Java programs. The name of the file will be named something like robocode-setup-x.y.z.jar, where "x.y.z" indicates the version number.<br />
<br />
===Debian/Ubuntu Users===<br />
A slightly out of date version of Robocode is available in the Universe Section of the Repos. This version is not recommended since it isn't supported by the Robocode Community.<br />
<br />
== How to install Robocode ==<br />
===Windows===<br />
If Java has been properly installed (see [[Robocode/System Requirements|System Requirements]]), you should be able to install Robocode by opening (double click) the downloaded setup file (the JAR file).<br />
<br />
Alternatively, you could open a command prompt with "Start/Execute" in the window type in "cmd". Change the current directory (using the <code>cd</code> command) to the directory you have downloaded the Robocode setup file into, and then type ('''x.y.z''' must be replaced with the Robocode version):<br />
<pre><br />
java -jar robocode-setup-x.y.z.jar<br />
</pre><br />
<br />
===Linux===<br />
Open a shell and type in ('''x.y.z''' must be replaced with the Robocode version):<br />
java -jar robocode-setup-x.y.z.jar<br />
<br />
<br />
<br />
====Ubuntu/Debian====<br />
Ubuntu/Debian users could run into a couple of snags while installing Robocode. The best place to install it at is your ~/ directory (which is /home/account_name/ in short hand).<br />
<br />
If you have a working java compiler already, you should be set. If not, you need to get a package from the repositories with the javac program in it, or let Robocode install Jikes. If you changed your JDK recently (like <code>sun-java5-jdk</code> to <code>sun-java6-jdk</code> or <code>openjdk-6-jdk</code>), you need to run <code>sudo update-alternatives --auto javac</code> in your shell to get the new javac to link correctly.<br />
<br />
== How to get notified about new releases ==<br />
If you want to know ''exactly'' when a new release is available, you can subscribe to the Robocode file release [http://sourceforge.net/export/rss2_projfiles.php?group_id=37202 RSS feed]. The feed will provide you with a link to both the release notes and where to download Robocode.<br />
<br />
== See also ==<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Talk:Robocode/Download_And_Install&diff=17924Talk:Robocode/Download And Install2010-12-15T20:10:12Z<p>Gentoo-Thomas: moved Talk:Robocode/Download to Talk:Robocode Download And Install:&#32;There is no better installation instruction available.</p>
<hr />
<div>== Downloading Issues ==<br />
I'm trying to download version 1.7.2, but its not working for me. I downloaded the robocode-1.7.2.0-setup.JAR, but when I try to open it I just get an error message that I can't read. Does anyone know how I can get robocode on my computer again?--[[User:CrazyBassoonist|CrazyBassoonist]] 15:43, 8 June 2010 (UTC)<br />
<br />
I just downloaded and installed it without problems on my Mac from [http://robo-code.blogspot.com/2010/05/robocode-1720-final.html this page]. Have you tried re-downloading? Or maybe you could try grabbing an older version from [http://sourceforge.net/projects/robocode/files/robocode/ here] to see if that works? --[[User:Voidious|Voidious]] 15:33, 10 June 2010 (UTC)<br />
<br />
I've tried it many times, and every file I download gives me an error message when I run it--[[User:CrazyBassoonist|CrazyBassoonist]] 14:32, 21 June 2010 (UTC)<br />
<br />
Argh, really? I haven't tried with the latest versions, but you used to be able to manually extract the .jar and just copy the directory over. A .jar is the same format as a .zip, so just rename it to .zip/double click, or open it with an unzip program. Maybe that would work? --[[User:Voidious|Voidious]] 00:09, 22 June 2010 (UTC)<br />
<br />
Well, I got a new computer (this time with Windows 7, if that makes a difference) and tried downloading Robocode again. When I ran Robocode this time it didn't work, so I tried using the "troubleshoot compatibility" feature and got the message "The specified path does not contain a valid program. Please select a valid program (ending in .exe)." The file already in the blank says "C:\robocode\robocode.bat" and when I looked for a file ending in .exe I couldn't find one. Does anyone know how to get it to work? Thanks--[[User:CrazyBassoonist|CrazyBassoonist]] 13:47, 8 August 2010 (UTC)<br />
<br />
Are you able to run Robocode by double-clicking the C:\robocode\robocode.bat" directly? --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 13:51, 8 August 2010 (UTC)<br />
<br />
No, the same thing happens and I get the same message about it not having a valid program--[[User:CrazyBassoonist|CrazyBassoonist]] 13:53, 8 August 2010 (UTC)<br />
<br />
Could you provide me a screen capture? --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 13:59, 8 August 2010 (UTC)<br />
<br />
Of what happens when I open the program? I get a screen that opens really fast and then closes and nothing happens, so I would have trouble getting a screen shot. I can provide you with a picture of the troubleshooting message if you want though--[[User:CrazyBassoonist|CrazyBassoonist]] 14:02, 8 August 2010 (UTC)<br />
<br />
Well, I've found that I can open Robocode by opening the robocode.jar file in the libs folder, but there aren't any sample robots on it, the compiler won't work, and I can't import robots. So that hasn't helped me much.--[[User:CrazyBassoonist|CrazyBassoonist]] 14:33, 8 August 2010 (UTC)<br />
<br />
Are you sure you have Java installed properly? --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 14:41, 8 August 2010 (UTC)<br />
<br />
I just managed to take a very fast screenshot, I'll try to upload that--[[User:CrazyBassoonist|CrazyBassoonist]] 14:52, 8 August 2010 (UTC)<br />
[[File:Robocode Problem.png]]<br />
Here it is. Anyone know what this means I should do?--[[User:CrazyBassoonist|CrazyBassoonist]] 14:57, 8 August 2010 (UTC)<br />
<br />
Oh, it looks like you either don't have Java installed, or you don't have it on the PATH. I'd try grabbing the Java SDK from Sun [http://www.java.com/en/download/manual.jsp here] and installing it, then trying again. --[[User:Voidious|Voidious]] 15:05, 8 August 2010 (UTC)<br />
<br />
Well, I remember Downloading Java and I've been able to run programs that use Java, but I'll try downloading it again.--[[User:CrazyBassoonist|CrazyBassoonist]] 15:09, 8 August 2010 (UTC)<br />
<br />
Its still not working. How do I change the PATH?--[[User:CrazyBassoonist|CrazyBassoonist]] 15:11, 8 August 2010 (UTC)<br />
<br />
Start > Control Panel > System > Advanced system settings > Environments Variables > Choose PATH in System variables > Edit... > append ;<path-to-your-java-bin-dir> . At least it is on Windows Vista. Should be almost the same on 7, but not sure. --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 15:14, 8 August 2010 (UTC)<br />
<br />
That fixed it! Thank you very much. I can't wait to start Robocoding again:-)--[[User:CrazyBassoonist|CrazyBassoonist]] 15:22, 8 August 2010 (UTC)</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Talk:Robocode/Download&diff=17925Talk:Robocode/Download2010-12-15T20:10:12Z<p>Gentoo-Thomas: moved Talk:Robocode/Download to Talk:Robocode Download And Install:&#32;There is no better installation instruction available.</p>
<hr />
<div>#REDIRECT [[Talk:Robocode Download And Install]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/Download_And_Install&diff=17922Robocode/Download And Install2010-12-15T20:10:11Z<p>Gentoo-Thomas: moved Robocode/Download to Robocode Download And Install:&#32;There is no better installation instruction available.</p>
<hr />
<div>This page describes how to download and install the [[Robocode]] game.<br />
<br />
== How to download Robocode ==<br />
'''''NOTE: Java must be installed in order to install and run Robocode!''''' See the [[Robocode/System Requirements|System Requirements]] page for more info.<br />
<br />
Robocode can be downloaded from the [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 download page at SourceForge]; this page contains all Robocode releases available for download.<br />
<br />
The file you want to download is a JAR (Java ARchive) file, which is in fact a renamed ZIP file used for distributing Java programs. The name of the file will be named something like robocode-setup-x.y.z.jar, where "x.y.z" indicates the version number.<br />
<br />
===Debian/Ubuntu Users===<br />
A slightly out of date version of Robocode is available in the Universe Section of the Repos. This version is not recommended since it isn't supported by the Robocode Community.<br />
<br />
== How to install Robocode ==<br />
If Java has been properly installed (see [[Robocode/System Requirements|System Requirements]]), you should be able to install Robocode by opening the downloaded setup file (the JAR file).<br />
<br />
Alternatively, you could open a command prompt / shell where you change the current directory (using the <code>cd</code> command) to the directory you downloaded the Robocode setup file into, and then type:<br />
<pre><br />
java -jar robocode-setup-x.y.z.jar<br />
</pre><br />
<br />
Of course the '''x.y.z''' must be replaced with the Robocode version you are going to install.<br />
<br />
===Ubuntu/Debian===<br />
Ubuntu/Debian users could run into a couple of snags while installing Robocode. The best place to install it at is your ~/ directory (which is /home/account_name/ in short hand).<br />
<br />
If you have a working java compiler already, you should be set. If not, you need to get a package from the repositories with the javac program in it, or let Robocode install Jikes. If you changed your JDK recently (like <code>sun-java5-jdk</code> to <code>sun-java6-jdk</code> or <code>openjdk-6-jdk</code>), you need to run <code>sudo update-alternatives --auto javac</code> in your shell to get the new javac to link correctly.<br />
<br />
== How to get notified about new releases ==<br />
If you want to know ''exactly'' when a new release is available, you can subscribe to the Robocode file release [http://sourceforge.net/export/rss2_projfiles.php?group_id=37202 RSS feed]. The feed will provide you with a link to both the release notes and where to download Robocode.<br />
<br />
== See also ==<br />
<br />
=== News and Releases ===<br />
* [http://sourceforge.net/project/showfiles.php?group_id=37202&package_id=29609 Robocode file releases]<br />
* [http://sourceforge.net/export/rss2_project.php?group_id=37202 RSS Feeds for the Robocode project]<br />
<br />
=== Tutorials ===<br />
* [[Robocode/System Requirements|System Requirements for Robocode]]<br />
* [[Robocode/Robot Anatomy|The anatomy of a robot]]<br />
* [[Robocode/Getting Started|Getting started with Robocode]]<br />
* [[Robocode/My First Robot|My First Robot Tutorial]]<br />
* [[Robocode/Game Physics|Robocode Game Physics]]<br />
* [[Robocode/Scoring|Scoring in Robocode]]<br />
* [[Robocode/Robot Console|Using the robot console]]<br />
* [[Robocode/Downloading_Robots|Downloading other robots]]<br />
* [[Robocode/Learning from Robots|Learning from other robots]]<br />
* [[Robocode/Package Robot|Package your robot]]<br />
* [[Robocode/FAQ|Frequently Asked Questions (FAQ)]]<br />
* [[Robocode/Articles|Articles about Robocode]]<br />
* [[Robocode/Console Usage|Starting Robocode from the command line]]<br />
* [[Robocode/Graphical_Debugging|Graphical debugging]]<br />
* [[Robocode/Eclipse|Using Eclipse as IDE]]<br />
* [[Robocode/Eclipse/Create_a_Project|Creating a project for your robots]]<br />
* [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]]<br />
* [[Robocode/Running from Eclipse|Running your robot from Eclipse]]<br />
* [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]]<br />
<br />
=== Home pages ===<br />
* [http://robocode.sourceforge.net/ Classic homepage]<br />
* [http://sourceforge.net/projects/robocode Robocode project at SourceForge]<br />
* [http://robocoderepository.com/ Robocode Repository]<br />
* [[wikipedia:Robocode|Wikipediaentry for Robocode]]<br />
<br />
[[Category:Robocode Documentation]]</div>Gentoo-Thomashttp://robowiki.net/w/index.php?title=Robocode/Download&diff=17923Robocode/Download2010-12-15T20:10:11Z<p>Gentoo-Thomas: moved Robocode/Download to Robocode Download And Install:&#32;There is no better installation instruction available.</p>
<hr />
<div>#REDIRECT [[Robocode Download And Install]]</div>Gentoo-Thomas