<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://robowiki.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Thoma</id>
	<title>Robowiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://robowiki.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Thoma"/>
	<link rel="alternate" type="text/html" href="http://robowiki.net/wiki/Special:Contributions/Thoma"/>
	<updated>2026-05-05T02:22:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Thread:Talk:Naval_Robocode/Naval_Robocode_download/reply_(5)&amp;diff=34050</id>
		<title>Thread:Talk:Naval Robocode/Naval Robocode download/reply (5)</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Thread:Talk:Naval_Robocode/Naval_Robocode_download/reply_(5)&amp;diff=34050"/>
		<updated>2015-02-11T11:51:20Z</updated>

		<summary type="html">&lt;p&gt;Thoma: Reply to Naval Robocode download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Uhh. Wouldn't consider myself a Tukker since I was born near the sea, but yeah, I currently live in Twente :)&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Thread:Talk:Naval_Robocode/Naval_Robocode_download/reply_(4)&amp;diff=34049</id>
		<title>Thread:Talk:Naval Robocode/Naval Robocode download/reply (4)</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Thread:Talk:Naval_Robocode/Naval_Robocode_download/reply_(4)&amp;diff=34049"/>
		<updated>2015-02-11T11:50:11Z</updated>

		<summary type="html">&lt;p&gt;Thoma: Reply to Naval Robocode download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Heya! I forgot to update the link as soon as we pushed it to SourceForge, so here it is! http://sourceforge.net/projects/robocode/files/naval-robocode/&lt;br /&gt;
&lt;br /&gt;
(I wish I'd get e-mail notifications when I get asked a question on this wiki :(  )&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34048</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34048"/>
		<updated>2015-02-11T11:48:58Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: http://sourceforge.net/projects/robocode/files/naval-robocode/sources/&lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: http://sourceforge.net/projects/robocode/files/naval-robocode/&lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34047</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34047"/>
		<updated>2015-02-11T11:48:40Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: http://sourceforge.net/projects/robocode/files/naval-robocode sources/&lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: http://sourceforge.net/projects/robocode/files/naval-robocode/&lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34046</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34046"/>
		<updated>2015-02-11T11:48:20Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: sourceforge.net/projects/robocode/files/naval-robocode sources/&lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: http://sourceforge.net/projects/robocode/files/naval-robocode/&lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34045</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34045"/>
		<updated>2015-02-11T11:47:29Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: http://sourceforge.net/projects/robocode/files/naval-robocode/&lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34038</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34038"/>
		<updated>2015-01-27T11:45:23Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: &amp;lt;strike&amp;gt;https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &amp;lt;/strike&amp;gt; Broken since last update. Will update the link once I get home.&lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34037</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34037"/>
		<updated>2015-01-27T11:39:13Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: &amp;lt;strike&amp;gt;https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &amp;lt;/strike&amp;gt; Broken since last update. Will update the link once I get home.&lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34036</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34036"/>
		<updated>2015-01-27T08:17:24Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Comments from Company */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''Created a new bug. Ships killing themselves with mines get bonus points :D'''&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34035</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34035"/>
		<updated>2015-01-26T13:15:09Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Comments from Company */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.) '''(Almost done)'''&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34033</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34033"/>
		<updated>2015-01-26T08:40:37Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to replace robocode.Robocode to robocode.NavalRobocode in [[Robocode/Running_from_Eclipse]] ~&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34032</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34032"/>
		<updated>2015-01-26T08:35:26Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Ship */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NavalRobocodeZoom.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=File:NavalRobocodeZoom.png&amp;diff=34031</id>
		<title>File:NavalRobocodeZoom.png</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=File:NavalRobocodeZoom.png&amp;diff=34031"/>
		<updated>2015-01-26T08:34:44Z</updated>

		<summary type="html">&lt;p&gt;Thoma: A zoomed-in version of a ship in Naval Robocode.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A zoomed-in version of a ship in Naval Robocode.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Thread:Talk:Naval_Robocode/Naval_Robocode_download/reply&amp;diff=34030</id>
		<title>Thread:Talk:Naval Robocode/Naval Robocode download/reply</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Thread:Talk:Naval_Robocode/Naval_Robocode_download/reply&amp;diff=34030"/>
		<updated>2015-01-26T08:25:25Z</updated>

		<summary type="html">&lt;p&gt;Thoma: Reply to Naval Robocode download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Heya! &lt;br /&gt;
&lt;br /&gt;
Glad you're interested. I updated the intro to include some helpful links.&lt;br /&gt;
&lt;br /&gt;
What it boils down to is that you should download this file: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar&lt;br /&gt;
&lt;br /&gt;
After which you can follow this tutorial: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
I hope you like it, and happy Naval Robocoding!&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34029</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34029"/>
		<updated>2015-01-26T08:22:54Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see.&lt;br /&gt;
&lt;br /&gt;
For the discussion on Google Groups: https://groups.google.com/forum/#!topic/robocode-developers/X0Z9rSQCMMI &lt;br /&gt;
&lt;br /&gt;
If you wanna look into the (still slightly messy) code, go to: https://github.com/robo-code/robocode/tree/naval-robocode-workspace &lt;br /&gt;
&lt;br /&gt;
And if you wanna dive straight into Naval Robocode, go to: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar &lt;br /&gt;
&lt;br /&gt;
The above setup hasn't been forked with the official Robocode repository, yet. &lt;br /&gt;
&lt;br /&gt;
Also, I didn't get the in-game editor to work for myself, so I recommend downloading the setup and then following this guide: [[Robocode/Eclipse/Create_a_Project]]&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34020</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34020"/>
		<updated>2015-01-23T10:36:36Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Comments from Company */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees). &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	&lt;br /&gt;
IShip::setCourse has no radians variant  &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34019</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34019"/>
		<updated>2015-01-23T10:17:35Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Things to look out for */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~  &lt;br /&gt;
 &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees).&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
IShip::getCourse has no radians variant  &lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34018</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34018"/>
		<updated>2015-01-23T10:16:58Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Known &amp;quot;Bugs&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~   &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt; 2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended) &amp;lt;/strike&amp;gt;  Fixed with TO-DO #1 #2&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees).&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
IShip::getCourse has no radians variant  &lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34017</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34017"/>
		<updated>2015-01-23T09:48:52Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Thoma’s TO-DO List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~   &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended)&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees).&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
IShip::getCourse has no radians variant  &lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&amp;lt;/strike&amp;gt; Didn't split it up, just filtered the original database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3. &amp;lt;/strike&amp;gt;   Moved the variable which states whether we're playing Naval Robocode or not to HiddenAccess.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34016</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34016"/>
		<updated>2015-01-23T08:23:11Z</updated>

		<summary type="html">&lt;p&gt;Thoma: /* Thoma’s TO-DO List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~   &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended)&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees).&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
IShip::getCourse has no radians variant  &lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&lt;br /&gt;
&lt;br /&gt;
2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
&lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &amp;lt;/strike&amp;gt; Done.&lt;br /&gt;
&lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34015</id>
		<title>Naval Robocode</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=Naval_Robocode&amp;diff=34015"/>
		<updated>2015-01-20T12:45:24Z</updated>

		<summary type="html">&lt;p&gt;Thoma: Created page with &amp;quot; == Intro ==  These are some of the things that make Naval Robocode different from Robocode.  The Rules are all subject to change, so be sure to tell me about any changes you...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
These are some of the things that make Naval Robocode different from Robocode.&lt;br /&gt;
&lt;br /&gt;
The Rules are all subject to change, so be sure to tell me about any changes you’d like to see. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Your First Ship ==&lt;br /&gt;
&lt;br /&gt;
Yarrr, matey! Welcome to creating your first fleet. &lt;br /&gt;
&lt;br /&gt;
If ye be makin’ those automated tanks for the past years, ye might want to check out the Modified Rules. &lt;br /&gt;
&lt;br /&gt;
Remember that ye can always steal one of the sample ships and use them as yer own. &lt;br /&gt;
&lt;br /&gt;
I assume ye have yer men ready at the bay to build yer ship during this intro. &lt;br /&gt;
&lt;br /&gt;
(I assume you got Naval Robocode all set up in Eclipse. If not, check out this guide: )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== My First Ship ==&lt;br /&gt;
&lt;br /&gt;
Away with the pirate act! Your Ship is much more like a marine ship than a pirate ship. &lt;br /&gt;
&lt;br /&gt;
(Though, if anybody wants to re-skin the current ships to look like a pirate ship, be my guest!)&lt;br /&gt;
&lt;br /&gt;
As stated before, I assume you’re creating your Ship in Eclipse. &lt;br /&gt;
&lt;br /&gt;
(I couldn’t get the in-game editor to work, myself) On top of this, I assume you are at least a beginner at Java. &lt;br /&gt;
&lt;br /&gt;
I will create a full guide for total beginners at programming later, but for now this guide will have to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
package thoma;&lt;br /&gt;
&lt;br /&gt;
import robocode.*;&lt;br /&gt;
&lt;br /&gt;
public class MyFirstShip extends Ship{&lt;br /&gt;
    public void run(){  &lt;br /&gt;
        setAhead(200);  &lt;br /&gt;
        setTurnRightDegrees(90);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void onScannedShip(ScannedShipEvent e){&lt;br /&gt;
        fireFrontCannon(1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at this example. This is your first Ship! When your Ship is first created, the run function will be called.(public void run()) &lt;br /&gt;
&lt;br /&gt;
Anything in between the squiggly brackets {} is what your Ship will do while it’s still alive and kickin’. &lt;br /&gt;
&lt;br /&gt;
Within this run-function, two methods are called. setAhead() and setTurnRightDegrees(). &lt;br /&gt;
&lt;br /&gt;
setAhead(200) tells your ship to move ahead 200 pixels. &lt;br /&gt;
&lt;br /&gt;
setTurnRightDegrees(90) tells your ship it should turn until it’s 90 degrees to the right of your Ship’s original direction. &lt;br /&gt;
&lt;br /&gt;
Remember! Ships can’t turn if there’s no velocity, much like a real ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FIRE! ==&lt;br /&gt;
&lt;br /&gt;
A Ship has two cannons, called FrontCannon and BackCannon. &lt;br /&gt;
&lt;br /&gt;
Firing them is done by fireFrontCannon(your_gun_power) and fireBackCannon(your_gun_power) respectively. &lt;br /&gt;
&lt;br /&gt;
What’s your_gun_power, you ask? Cannons can fire a bullet that’s stronger or weaker depending on the gun power. This power can be between 0.1 and 3. &lt;br /&gt;
&lt;br /&gt;
Placing this method inside the onScannedShip(ScannedShipEvent e) method makes it so that the gun will only fire when the radar has seen another Ship. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
Acceleration is still 1 pixel/turn^2&lt;br /&gt;
&lt;br /&gt;
Deceleration is 0.8 pixels/turn^2 now    (Gives a nice floaty effect)&lt;br /&gt;
&lt;br /&gt;
At the moment the turn rate is 0.8 degrees/turn. Do you find your Ship is moving around in circles which are way too big? &lt;br /&gt;
&lt;br /&gt;
Try decreasing your max velocity. The less you move per turn, the sharper your turns are.&lt;br /&gt;
&lt;br /&gt;
Ships only start turning if there’s some velocity, unlike a Robot.&lt;br /&gt;
&lt;br /&gt;
== Bullets ==&lt;br /&gt;
&lt;br /&gt;
Bullet damage has been decreased to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
damage = 4 * bulletPower;&lt;br /&gt;
if(bulletPower &amp;gt; 1){damage += 1.2 * (bulletPower - 1);}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Though. This might be a bit too low.-Thomas&lt;br /&gt;
&lt;br /&gt;
Energy restored from the bullets has been reduced to &amp;lt;code&amp;gt;bulletPower * 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to make the bullets a bit weaker, since Ships are easier to hit. &lt;br /&gt;
&lt;br /&gt;
This, on top of the fact Ships already got 2 cannons, made me think Ships died too quickly.&lt;br /&gt;
&lt;br /&gt;
Bullets can be fired from two cannons. (FrontCannon and BackCannon) &lt;br /&gt;
&lt;br /&gt;
At the moment you can fire them with the fireFrontCannon(double) and fireBackCannon(double) commands. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mines ==&lt;br /&gt;
&lt;br /&gt;
Mine damage is calculated as followed&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	damage = 3 * minePower;&lt;br /&gt;
	if(minePower == 15){damage+=5;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy restored from a mine is &amp;lt;code&amp;gt;MinePower * 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mines can be placed with a power between 5 and 15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ship ==&lt;br /&gt;
&lt;br /&gt;
'''''CAN'T PLACE THE PICTURE HERE YET. WILL INSERT ONCE I GET HOME'''''&lt;br /&gt;
&lt;br /&gt;
Length of a ship is 207. Width is 40. &lt;br /&gt;
&lt;br /&gt;
The pivot of a Ship is NOT in the middle. &lt;br /&gt;
&lt;br /&gt;
If you look at the picture on the right, the red dot will indicate the pivot of the Ship, which should be 50 pixels from the center of the Ship.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a Ship has two cannons, FrontCannon and BackCannon. (See the blue weapons on the Ship)&lt;br /&gt;
&lt;br /&gt;
A Ship has a Radar which is exactly the same as a Robocode Radar.&lt;br /&gt;
&lt;br /&gt;
And a Ship has a MineComponent, which is the darkgreenish thing at the back of the Ship. This is used to drop mines. &lt;br /&gt;
&lt;br /&gt;
Each of these components can be colored.&lt;br /&gt;
&lt;br /&gt;
The coordinates of each of these components can be retrieved with getXFrontCannon()/getYRadar() etc.&lt;br /&gt;
&lt;br /&gt;
Ships work like AdvancedRobots for as far as I know. setTurnLeftDegrees() doesn’t have a turnLeftDegrees() equivalent. This means you’ll have to work with the execute()-function most of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscaleneous ==&lt;br /&gt;
&lt;br /&gt;
Ships don’t take hit damage from walls.&lt;br /&gt;
&lt;br /&gt;
If anybody is interested, I accidentally implemented something that creates the possibility to take more or less damage depending on where your Ship has been hit. &lt;br /&gt;
&lt;br /&gt;
(If they run head-first into eachother, they could take massive damage, where hitting from the side would result in less damage)  &lt;br /&gt;
&lt;br /&gt;
Right now the ramming damage is the same as in Robocode.&lt;br /&gt;
&lt;br /&gt;
== Things to look out for ==&lt;br /&gt;
&lt;br /&gt;
At the moment there are still a few things I’m not too sure about. Here’s a list about them~   &lt;br /&gt;
1.	Acceleration and Deceleration&lt;br /&gt;
2.	Size of BlindSpot. (Options-&amp;gt;Preferences-&amp;gt;View Options-&amp;gt;Visible Naval Blind Spot)&lt;br /&gt;
3.	Function names (Too large? Too unclear? Not enough documentation?)&lt;br /&gt;
4.	Bugs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known &amp;quot;Bugs&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
In game editor doesn’t work (for me) since it can’t find a compiler.&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
The game is still mixed with the original Robocode, thus there can still be played with Tanks. I made a slightly “dirty” fix to make sure Ships and Tanks can’t play together on the same map. This fix is basically “If there’s Ships on the map, IS_NAVAL = true, else IS_NAVAL = false”. If you record a game in Naval Robocode, boot up a fresh game and try to watch the recording, you’ll get a cool bug. Since the game hasn’t tested yet whether there are Ships on the Map, IS_NAVAL = false. So when you watch the recording, it’ll interpret the Ships in the recording as quirky moving Robots. (Watching a recording while IS_NAVAL=true works as intended)&lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Making your weapons move independently from your ship, makes them move a bit quirky, because of their blind spots. Independent radars, however, move just fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comments from Company ==&lt;br /&gt;
&lt;br /&gt;
We held a competition within the company and so far we haven’t found any bugs.(They couldn’t even find the bugs I already knew of ;D ) &lt;br /&gt;
&lt;br /&gt;
They did, however, have some comments regarding the game itself.&lt;br /&gt;
&lt;br /&gt;
1.	&lt;br /&gt;
IShip::getBodyHeadingRadians does nor return values between 0..2*Pi;nor is specified in which range the values are to be expected. Specify, document and enforce that each return angle (radians) is between –pi .. pi or 0 and 2*pi (similar for the methods using degrees).&lt;br /&gt;
&lt;br /&gt;
2.	&lt;br /&gt;
IShip::getCourse has no radians variant  &lt;br /&gt;
&lt;br /&gt;
3.	&lt;br /&gt;
Create an interface for controlling the Front- and BackCannon. Calling something like getFrontCannon().setTurnRightDegrees(), might be nicer than setTurnFrontCannonRightDegrees(double).&lt;br /&gt;
&lt;br /&gt;
4.	&lt;br /&gt;
Implement some kind of blast-radius for the mines.  (The winner of the competition basically just rammed people backwards to throw mines on their ships.)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Thoma’s TO-DO List ==&lt;br /&gt;
&lt;br /&gt;
1.	Finding a way to separate the database into two. I mean, I’d love to get rid of the regular Robots in the list of bots to choose from. Though, this doesn’t isn’t top priority.&lt;br /&gt;
&lt;br /&gt;
2.	Creating a custom run configuration for Naval Robocode would be really nice. If you look back at “Known Bugs #3”, creating a new way to run Naval Robocode that would automatically set IS_NAVAL = true, would simultaneously get rid of bug #3.&lt;br /&gt;
&lt;br /&gt;
3.	Creating some clearer documentation. &lt;br /&gt;
&lt;br /&gt;
4.	Refactoring. Ooooh. I REALLY want to refactor this program. Background story: The assignment to create Naval Robocode has been given to an intern last year, as well. Feeling “lucky”, I worked from where he left of, since he didn’t get to finish it. I used to look at his code as if it couldn’t contain any mistakes, but as of right now, I want to get rid of most of the stuff he did. Which include: &lt;br /&gt;
•	Trying to reverse all Y-values. If we take an 800x600 screen, according to him the top of the screen would be y=0, while the bottom of the screen would be y=-600. I understand that some game do this, but I never understood why he wanted to implement this so badly. Luckily, I got rid of most of this, though there might still be something left behind.&lt;br /&gt;
•	The IProjectile-interface. It’s simply not needed. Worst part is that I used this interface for the mines. &lt;br /&gt;
•	The ShipStatus class. I made this one myself, but I don’t really like the fact I’m giving ShipProxy access to all every component on the Ship.&lt;/div&gt;</summary>
		<author><name>Thoma</name></author>
		
	</entry>
</feed>