Naval Robocode

528 views
Skip to first unread message

Thomas

unread,
Nov 14, 2014, 6:58:24 AM11/14/14
to robocode-...@googlegroups.com

Hey guys, I'm Thomas, soon to be 20 years old and I'm the new intern working on the assignment Naval Robocode. Oh and I'm from the Netherlands.
Just to refresh your memory: Naval Robocode would be a version of Robocode that uses Ships instead of Tanks.
Jan-Egbert Hamming made a thread about it almost 4 years ago, now. This assignment was given to another intern last year, but he sadly failed to finish it entirely.
Considering I had his old code at hand, most of my assignment consisted of fixing bugs in the old code.  I got the idea I've finally reached a semi-stable version.

*I had a really cool picture to show here, but I can't upload anything from the computers here :( *

In short, this version includes:
- Ships rather than tanks
- Ships using 2 weapons rather than one
- Ships can place mines

Now I believe I have a fairly good idea of how the code works, but there's still something that I failed to understand for quite some time now.

What are the Serializable classes and the HiddenHelpers for?

I can understand that when you serialize something, you can basically use it to save something, but I'm not sure what it would be used for.
I can also imagine the HiddenHelpers are used to gain access to certain variables, but I'm not too sure what classes use them.
If anyone has further knowledge about this, I would love to hear about it!

Furthermore, I've got trouble running the RobocodeTestBed. So far I had to work with JUnit tests only, and I would really like to know how to use this Class.
I figure it has something to do with the Run Configurations, so if anybody could help me out, that would be great~

With kind regards,

Thomas~

Pavel Šavara

unread,
Nov 14, 2014, 7:26:59 AM11/14/14
to robocode-...@googlegroups.com
Hi Thomas,

the serialization is used for 2 things
- battle recording
- .NET interop (sending messages across the CLR/JVM boundary)

The hidden helpers are used to enable the robocode engine to manipulate the parts of robocode robot API which are not open to manipulation by robot itself.

BTW: do you have fork of code on github ?

Pavel

--

---
You received this message because you are subscribed to the Google Groups "robocode-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode-develo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Flemming Larsen

unread,
Nov 15, 2014, 3:20:35 PM11/15/14
to robocode-...@googlegroups.com
Hi Thomas,

Pavel is right. :-)

There is already a branch for Naval Robocode at the GitHub for Robocode:


Perhaps it makes sense to continue on this branch or at least get inspired from it? :-)

Cheers,
- Flemming

Jan-Egbert Hamming

unread,
Nov 15, 2014, 4:22:42 PM11/15/14
to robocode-...@googlegroups.com

Hi all,

Nice to see that Thomas has introduced himself here!
The branch Flemming mentions is the one he made for me a couple of years back.

Thomas is working for/with me on NavalRobocode until Feb 2015, and he will update the branch in the next weeks.

Regards,

Jan-Egbert Hamming

Op 15 nov. 2014 21:20 schreef "Flemming Larsen" <flemming...@gmail.com>:
--

Thomas

unread,
Nov 19, 2014, 3:08:59 PM11/19/14
to robocode-...@googlegroups.com
Hey all, thanks for your quick reactions.

I believe I understand how HiddenHelpers work now, I'll start looking into the RBSerializers tomorrow~

Here's a tiny version of the picture that I promised :D

Right now the code is still slightly messy, so I would love to test it. Right now I got the following errors when I run a random RobocodeTestBed as a JUnitTest.

Couldn't find net.sf.robocode.tests

Couldn't find net.sf.robocode.tests

Couldn't find net.sf.robocode.robots

Couldn't find net.sf.samples

Not too sure about the EXACT message, I'm writing this while at home. >:

Help would be much appreciated.

~Thomas




Op vrijdag 14 november 2014 12:58:24 UTC+1 schreef Thomas:

Flemming Larsen

unread,
Nov 20, 2014, 3:11:08 PM11/20/14
to robocode-...@googlegroups.com
Hi Thomas,

The picture is looking very promising. :-)

How do you run the test? Do you run it from Eclipse by opening e.g. TestAcceleration and then right-click and the select 'Run As -> JUnit'?
If so, you must make sure you have run 'mvnassembly.cmd' from the command line at least once. You should also run Robocode at least once before launching the tests so the robot database has been created etc.

Have you imported the 'robocode.tests', 'robocode.tests.robots', 'robocode.samples' projects into your workspace?

If you have done all that, I don't know what causes the problem. Then I suggest that you zip your workspace for Robocode and send it to me: fnl (at) users.sourceforge.net. Then I will check what seems to be the problem.

Cheers,
- Flemming

Thomas

unread,
Dec 1, 2014, 10:05:44 AM12/1/14
to robocode-...@googlegroups.com
Hey all!

Sorry for the late response. I managed to use the internal recording to record games of Naval Robocode!
All that is left now is to create some tests in order to make sure that everything runs smooth.
I've further investigated the RobocodeTestBed problem. Tests that don't require any Robots work for me now.
The problem only arises now when the tests needs to use a Robot from the sample package. (Can't find sample.Crazy, Can't find sample.SittingDuck, etc.)
Looking into the directories, I managed to find 2 databases.
Opening them both with notepad++ to peek a bit, I noticed that one of them contains the Robots from the sample package, while the other one contains the Robots from the tested.robots package.

Looking through the robots the test is trying to load, I get something similar to the following: tested.robots.ReflectionAttack,sample.Target
Out of all these lists, the tests fail to load the Robot that comes from the sample package.

I'm sorry, but I really don't have permission yet to upload the code.
After we get the RobocodeTestBed working, I'll make sure the program is bug-free.
After that we'll test the program with multiple people of the company, and if the program doesn't have any bugs at that point, we'll upload everything to sourceforge~ :)
If all goes well, it might get uploaded before Christmas~   (If not, it'll probably be right after Christmas holiday)

I hope you understand why we can't upload the code, yet. :(

With kind regards,

Thomas~



Op vrijdag 14 november 2014 12:58:24 UTC+1 schreef Thomas:

Thomas

unread,
Dec 15, 2014, 4:32:25 AM12/15/14
to robocode-...@googlegroups.com
Hey all!

Just a quick report on my progress:
 - Got RobocodeTestBed working!   
              (It was mvnassembly after all. Whoops. >.< At first I wasn't allowed to use internet on the laptop, because of security reasons.
                So, when I ran mvnassembly back then, the testrobot database probably didn't get created)
- Created a few sample Ships!
- Tried installing Naval Robocode on one of the linux systems and it worked :)

The coming week I'll be testing the game, cleaning it up, and making some proper documentation.
After that I should be able to/allowed to commit the game to the Naval Robocode branch.
I'm looking forward to discussing about what the rules should be like <3

Soon™

-Thomas


Haiku Automation

unread,
Dec 29, 2014, 1:59:15 AM12/29/14
to robocode-...@googlegroups.com
Very exciting to hear, thank you.

Thomas

unread,
Jan 14, 2015, 10:19:46 AM1/14/15
to robocode-...@googlegroups.com
I have just send a pull-request to the robocode github.
I thought my supervisor could accept this pull request, but I got a feeling this might not be the case.
My Git skills aren't the greatest, so in case I did something wrong, you might need to guide me. :(

Anyway! Naval Robocode should work properly now. There are still a few classes I would like to modify/remove,
but I might just do that after my internship is over. (31st of January)

Your assistance would be appreciated.

~Thomas


Op vrijdag 14 november 2014 12:58:24 UTC+1 schreef Thomas:

Flemming Larsen

unread,
Jan 15, 2015, 2:45:17 PM1/15/15
to robocode-...@googlegroups.com
Hi Thomas,

I look forward to see the result of your work and will of course assist you with putting the source code into GitHub. :-)

I will have a look at GitHub and see if the pull request works correctly or not. I will have a look at this later tonight or during the weekend and return to you, when/if I manage to build Naval Robocode. :-)

Best regards,
- Flemming

Flemming Larsen

unread,
Jan 18, 2015, 5:26:24 PM1/18/15
to robocode-...@googlegroups.com
Hi Thomas,

You did a good job with the pull-request to the Robocode GitHub. I was able to merge your code into the naval-robocode-workspace without any trouble.
Today I managed to build and start Naval Robocode, and it also seems to work properly. :-)

What will be your next steps with Naval Robocode?
Will you have a web page somewhere with instructions (or a tutorial) for how to build a bot for Naval Robocode?
Perhaps add javadoc stuff to all the robocode.naval classes for the Java API?

If it is going to distributed, it will need some additional work like renamings of 'Robocode' into 'Naval Robocode' and the file names like 'robocode-1.9.2.1-setup.jar' should be something like 'naval-robocode-0.9.0-setup.jar' or similar etc. So people will know that your version is a variant of the classic Robocode game. :-)

Best regards,
- Flemming


Den onsdag den 14. januar 2015 kl. 16.19.46 UTC+1 skrev Thomas:

Thomas

unread,
Jan 19, 2015, 4:04:41 AM1/19/15
to robocode-...@googlegroups.com
Hey Flemming,

I'm glad it all works properly! I only got 2 weeks left until my internship is over, so I doubt I'll be able to create my own website within that time.
I will, however, try my best to do so. Even when my internship has ended, I will probably make sure I finish this project all the way.

I made some handy instructions and user guides for the competition we held within the company, so I figure I can reuse those.

Anyway!
Creating custom run-configurations and making sure the program actually creates a naval-robocode-0.9.0-setup.jar are on the top of my list.
Also, the best strategy so far appears to be making your ship sail backwards in order to throw mines on the other ship.
A colleague told me that it might be better to create something like a blast radius, so this wouldn't be possible.

Let me know what you think!

-Thomas

Flemming Larsen

unread,
Jan 19, 2015, 4:22:20 PM1/19/15
to robocode-...@googlegroups.com
Hi Thomas,

I think it would be great if we could make a real release of Naval Robocode, when you think it is ready. If it is not finished, we could release it as an alpha or beta.
The documentation for how to use the API etc. for Naval Robocode could be put on the RoboWiki.net, which people can comment on and even update/correct information etc.

It would also be great if you could write some introduction/tutorial for how to program a Naval Robocode bot. :-)

Cheers,
- Flemming

Mauro lesto

unread,
Jan 19, 2015, 7:14:31 PM1/19/15
to robocode-...@googlegroups.com

I think a early (more or less working) release may attract some new development or at least some tester ;)
And when tour tester are developer.. Well you get something like stackoverflow, where the user point out the bugs AND the fix :)


--

Julian Kent

unread,
Jan 20, 2015, 4:57:21 AM1/20/15
to robocode-...@googlegroups.com

Hi Thomas
Just to back Flemming up here, if you make a working release I'll see if I can do the RoboRumble integration for you, and make a new division on LiteRumble. Then your colleagues can post their bots online and other people can also join the competition.

Cheers
Julian (Skilgannon on robowiki.net)

--

Thomas

unread,
Jan 20, 2015, 5:32:28 AM1/20/15
to robocode-...@googlegroups.com
Hey all!

Thanks for all the input. I'm almost done with my guide to Naval Robocode, and could probably put it on the Robocode Wiki today.
Ehehe.. Just got a slight problem. I created an account on the Robocode Wiki called Thoma, but I got no clue on how to create a new page. ;___;

Also. Naval Robocode is pretty much working already. If anybody is interested, the code is available on the Robocode repository under the naval-robocode-workspace branch.

If you don't want to be bothered with all the source code, the setup can be downloaded from: https://github.com/robo-code/robocode/blob/naval-robocode-workspace/robocode.distribution/target/robocode-1.9.2.1-setup.jar
From there on I recommend you play the game according to this guide: http://robowiki.net/wiki/Robocode/Eclipse/Create_a_Project 

I would love to see a Naval Robocode Rumble!

So far I haven't found any gamebreaking  bugs, besides the ones I will post later today.
What still needs to be changed about Naval Robocode in a nutshell is:
1. Being able to actually start it as Naval Robocode.
2. Refactoring. (There's a few classes/interfaces that are used, but are not necessary for the code to run)
3. Clearer documentation/javadoc
4. Custom version   (naval-robocode-0.9.0-setup.jar instead of robocode-1.9.2.1-setup.jar)

So yeah, check the game out if you want! It should work without crashing.  (hoping for the best)

-Thomas

Julian Kent

unread,
Jan 20, 2015, 7:07:53 AM1/20/15
to robocode-...@googlegroups.com
To create a page on the wiki, just search for it in the search box, and an option to create it should come up if it doesn't already exist =)

--

Thomas

unread,
Jan 20, 2015, 7:49:45 AM1/20/15
to robocode-...@googlegroups.com
Tadaaa!

Made a page on the wiki: http://robowiki.net/wiki/Naval_Robocode

Gotta fix the layout sometime soon. This is my first time actually contributing to a wiki.
Let me know if anybody else got Naval Robocode working for them!

-Thomas

Flemming Larsen

unread,
Jan 20, 2015, 3:46:25 PM1/20/15
to robocode-...@googlegroups.com
That is excellent Thomas, and thank you Julian for following up on this. :-)

Thomas, if it is okay with you (?), I will announce Naval Robocode on Facebook, Twitter and Google+ for Robocode. :-)

Cheers,
- Flemming

Jan-Egbert Hamming

unread,
Jan 20, 2015, 4:04:54 PM1/20/15
to robocode-...@googlegroups.com

Hello all,

Good to see the positive vibe on naval robocode! I am very proud of Thomas, he did a great job to making it. Withtin my company, Thales (Netherlands, the naval department), Thomas has created this naval  version and together we hosted our first game, which received very positive feedback!

I hope the naval robocode fun will spread!

I'd like to retweet your tweets about naval robocode-developers, I assume that you will tweet with @robocode?

Regards,

Jan-Egbert Hamming
Senior Software Engineer / Scrummaster

--

Flemming Larsen

unread,
Jan 21, 2015, 5:34:43 PM1/21/15
to robocode-...@googlegroups.com
I have now announced Naval Robocode on Facebook, Google+, Blogger, and Twitter as @Robocode with #navalrobocode. :-)

Best regards,
- Flemming

Thomas

unread,
Jan 22, 2015, 7:59:23 AM1/22/15
to robocode-...@googlegroups.com
Thanks for the announcements, Flemming!  :D

While messing around with .pom's to make an actual naval-robocode-setup-0.9.0.jar, I found something out.
Apparently, a clean version of Robocode is available in the robocode.distribution/target/naval-robocode-0.9.0-src/naval-robocode-0.9.0 . (Doesn't contain class files etc. etc.)
So I figure this is normally the folder used to upload robocode to github. (Might be wrong)
Does anybody have an idea on how to upload the clean version to github instead? (All those classfiles have been bugging me for ages)

Also! As I said, I've been messing around with the .pom-files and you can now find a properly named setup on my repository: https://github.com/ThomasHakkers/robocode/blob/naval-robocode-workspace/robocode.distribution/target/naval-robocode-0.9.0-setup.jar

Nothing changed compared to the other setup, it just has a different name. :)

-Thomas


Flemming Larsen

unread,
Jan 23, 2015, 3:22:45 PM1/23/15
to robocode-...@googlegroups.com
Hi Thomas,

Binary files like .class files etc. is never put on GitHub. Only files like images and other type of resource files.
Target files are normally ignored in Git. That is, you need to explicitly exclude your target directory (robocode.distribution/target) from GitHub.
Normally I exclude the 'target' directories of Robocode from GitHub using a git.ignore. So you don't need to upload it. Only source files needs to be uploaded to the version control. :-)

The final distribution files like the naval-robocode-0.9.0-setup.jar is never put on version control (GitHub), as it uses too much space, and can be reproduced by building it from the source files.
Normally a thumb of rule is that anything that can be reproduced from other (source) files does not go into version control. This is true for almost any project. :-)

The version of the final distribution file (for the xxx-setup.jar file like your naval-robocode-0.9.0-setup.jar) is controlled by the /super-pom/pom.xml file. There is a version for the Java code (jar archive) and one for .NET, which you don't use.
You could create a .NET version of Naval Robocode later on, or somebody else could continue your work later. :-)

Don't hesitate with asking questions, if you need some clarifications. :-)

Cheers,
- Flemming

Thomas

unread,
Jan 27, 2015, 6:50:01 AM1/27/15
to robocode-...@googlegroups.com
Hey all!

Just uploaded Naval Robocode version 0.9.1 .  The version includes:
1. Mines that can hit multiple targets
2. Somewhat clearer documentation
3. A NavalRobocode class to run the game from (which simultaneously fixes a bug with the battle recordings)
4. Ships that commit suicide by sailing over their own mines don't get a bonus for it anymore.

Furthermore have I tried to remove all target directories, but for some reason some files within those directories remain. :l

This also means I need to find a place to put the naval-robocode-0.9.1-setup up for downloading.
Has anybody got any ideas?


~Thomas

Op vrijdag 14 november 2014 12:58:24 UTC+1 schreef Thomas:

Flemming Larsen

unread,
Jan 28, 2015, 3:28:42 PM1/28/15
to robocode-...@googlegroups.com
Hi Thomas,

Cool. I am happy to hear that updates are incoming for Naval Robocode. :-D

I propose that the naval-robocode-0.9.1-setup.jar (distribution) file is uploaded to SourceForge (perhaps also version 0.9.0 for historic reasons?) so users can download it like any other distribution file for Robocode. :-)

I recommend that you either update the version.md (Markdown syntax) file under the root directory of Robocode to contain details/changes for Naval Robocode or alternatively create a naval-robocode-version.md similar to version.md that only contains details for Naval Robocode.

If we (you or me) upload the distribution file under "Files" for the Robocode project on SourceForge, you should create a ReadMe.markdown similar to the one for Robocode, but which only contains details about Naval Robocode.
Here is the ReadMe.markdown file used for Robocode: http://sourceforge.net/projects/robocode/files/robocode/1.9.2.4/README.markdown/download. The ReadMe will automatically be displayed for end-users that needs details for the distribution files.

If/when you create the ReadMe.markdown file, I could build the Naval Robocode 0.9.1 setup file and upload the two files under the "Files" for Robocode on SourceForge (SF).
Alternatively, I can add you as user on SourceForge and grant you privileges so you are able to do this yourself. If so, I need to know your username on SF, if you have one. Otherwise you need to create a new account on SF.

Just tell me what you prefer? :-)

Cheers,
- Flemming

Thomas

unread,
Jan 30, 2015, 3:42:50 PM1/30/15
to robocode-...@googlegroups.com
Hey Flemming!

Today was my last day for my internship, and I'm proud to say that I passed!
This doesn't mean I'll stop updating Naval Robocode, though~
While I won't be updating it frequently (no huge updates like, I don't know, lasers :D ..), I'll update the game as soon as possible if someone finds a bug.
There's still a few new programming languages I want to learn and I might work on making my own videogame, as well.

To make things more exciting, if I'm lucky, I might get to do this really cool project called robocup next semester. (Which is basically football for robots)

Anyway! Back on topic. 

I attached the files you asked for to this post ^-^ 

As for uploading, I'll have to ask you to do it for me, for now.
I still gotta setup eclipse and stuff on my desktop at home, so I'll work on that soon~

I would love to have privileges to upload the stuff myself, but let's save that for next time, alright? :)

Thanks for all the help so far!

Happy Naval Robocoding!

-Thomas

Op woensdag 28 januari 2015 21:28:42 UTC+1 schreef Flemming Larsen:
naval-robocode-versions.md
versions.md

Thomas

unread,
Jan 30, 2015, 5:01:36 PM1/30/15
to robocode-...@googlegroups.com
Oh! P.S.  Do you know whether the in game editor works? 

I knew it worked at the start of my internship, but after that, I didn't really bother testing it anymore, since I found making ships in eclipse to be much nicer. 

Have a nice weekend! :)

-Thomas

Flemming Larsen

unread,
Feb 2, 2015, 3:36:22 PM2/2/15
to robocode-...@googlegroups.com
Hi Thomas,

Congratulations with passing your internship! :-D

It would be really cool to work with RoboCup. I know about this competition since my study at the university.
Physical robots playing football. Actually, this game has a lot in common with Robocode as they are both a game with bots. :-)

I will put your naval-robocode.versions.md into Subversion with the naval-robocode-workspace, compile it and make a release + post it on Facebook etc.

Regarding the robot editor. I think we could merge the recent changes regarding the Robot editor from newer Robocode versions up to 1.9.2.4 into Naval Robocode, as bugfixes has been made to the editor. :-)
So this could be released with Naval Robocode version 0.9.2. ;-)   I will see what I can do within the next week.

Best regards,
- Flemming

Flemming Larsen

unread,
Feb 3, 2015, 6:03:44 PM2/3/15
to robocode-...@googlegroups.com
Hi again,

I have now fixed the naval-robocode-workspace regarding 'target' files, 'build.xml', 'maven-build.xml', 'build.properties' files that should not be version controlled.
I added the naval-robocode-versions.md file, updated the /super-pom/profiles.xml, and hacked the AboutBox.java and AutoExtract.java (installer) with information for 'Naval Robocode'. In fact, lots of re factoring needs to be done, but I skipped it for now.

I have build 'Naval Robocode 0.9.1' and put the distribution files on SF (SourceForge) so people can download and install it, and also make a release not on Facebook, Google+, Twitter and Blogger:


Lets have a look at the robot editor later.

Best regards,
- Flemming

Thomas

unread,
Feb 4, 2015, 2:32:18 AM2/4/15
to robocode-...@googlegroups.com
Hey Flemming! 

Once again, thank you so much for distributing Naval Robocode! I'm really glad it seems to be working out so far. :D
I will attempt to get the new workspace running on my desktop at home today, and look at what still needs to happen. (Will probably post a to-do list tomorrow if I find anything major)

Best regards,
-Thomas

Op woensdag 4 februari 2015 00:03:44 UTC+1 schreef Flemming Larsen:

Thomas

unread,
Feb 4, 2015, 3:35:09 AM2/4/15
to robocode-...@googlegroups.com
Hey Flemming,

I suddenly realised that I had forgotten to send a pull request with the updates! 

I'll try to merge both our projects to compensate for the delay.

-Thomas

Op woensdag 4 februari 2015 08:32:18 UTC+1 schreef Thomas:

Flemming Larsen

unread,
Feb 7, 2015, 4:44:44 PM2/7/15
to robocode-...@googlegroups.com
Okay. Tell me when you have merged the newest stuff.
I think we should update the naval-robocode-versions.md, so that the version 0.9.1 reflects the stuff, that is in it now (when released).
Then we release a version 0.9.2 with your changes, i.e. when they have been merged.

Best regards,
- Flemming

Thomas

unread,
Feb 9, 2015, 4:33:46 AM2/9/15
to robocode-...@googlegroups.com
Hey Flemming,

I sent a pull request 5 days ago already, but I looked at it again today, and realised a few updates didn't come through.
Our workspaces should be ready to be merged. :)

- Thomas

Flemming Larsen

unread,
Feb 10, 2015, 4:24:48 PM2/10/15
to robocode-...@googlegroups.com
Hi Thomas,

I don't understand your pull request (and perhaps also your recent posts in this thread).
It seems like you want to merge Naval Robocode (from naval-robocode-workspace) into the classic Robocode (master) branch?
If so, I will have to stop you. :-)
(Your new pull request also contains too many conflicts that are extremely difficult to resolve and cannot be automatically merged).

I might have misunderstood your intentions?

The 'master' branch must be kept as stable as possible (as a production system). It is not open for big changes. I am really conservative here.
Naval Robocode is currently not in a shape that makes it acceptable to merge it into the main branch ('master') right away, even though it might be in the long run. At least, I hope it will in time. :-)
Naval Robocode needs much more work in order to make it ready to be merged with the main branch.

I thought you (only) wanted to merge the recent changes to Naval Robocode into the naval-robocode-workspace?
That is, take the changes between version 0.9.0 and 0.9.1 and merge into the current naval-robocode-workspace.

I recommend that we wait with merging the newest changes between Robocode version 1.9.1.2 to 1.9.1.4 as it is tricky to do.
It is another task to do compared to putting in the recent changes the Naval Robocode.
In addition, when we need to upgrade Naval Robocode to "1.9.1.4" we should do this merge into the naval-robocode-workspace first and make it stable.

So, I should like you to create a new pull request for 'naval-robocode-workspace' containing the recent changes to Naval Robocode (0.9.0 => 0.9.1).
After that, we can make a new release (0,9.2) with the recent changes that version 0.9.1 was supposed to contain.
We'll need to update the naval-robocode-versions.txt to reflect was 0.9.1 was really about (the same as version 0.9.0, but which was not released with a distribution file).

Then we could fix the issues with the Robot Editor.
You are right that this part needs to be fixed. Doing so means that we need to merge stuff from 1.9.1.4 (master) into naval-robocode-workspace. I will help you with this part. :-)

I hope I have not scared you off. I am only trying to help you out so that Naval Robocode will become the success it deserves. :-)

Best regards,
- Flemming

Thomas

unread,
Feb 11, 2015, 2:41:34 PM2/11/15
to robocode-...@googlegroups.com
Hey Flemming,

Whoops! I see what's going wrong now.
Of course, I didn't want to send a pull-request to the master branch. :)

The reason you're overwhelmed with merge errors is because I didn't include ".metadata" in the ".gitignore". 
Most of the merge errors are for the same reason. 

I have just finished my second attempt at merging our repositories, but git will still show an enormous amount of merge conflicts.
I am honestly at a loss right now. :(    If you want I can tell you which classes have been changed in my version, but I really want to know how to merge two branches properly. (Rather than copy-pasting whatever changes were made)

Have you got any advice on this?  I'm sorry my git skills are sub par.

-Thomas

P.S. : Is it an idea to create a whole new clone of your repository and to add my changes to that version? 

Op dinsdag 10 februari 2015 22:24:48 UTC+1 schreef Flemming Larsen:

Flemming Larsen

unread,
Feb 11, 2015, 4:21:52 PM2/11/15
to robocode-...@googlegroups.com
Hi Thomas,

If you know which classes that have been added and perhaps also the existing ones that were changed, then I recommend that we create anohter workspace like e.g. 'naval-robocode-workspace2', which will be a branch from the current version of Robocode.
That is from the 'master' (version 1.9.2.4).

Then you could copy the classes from the old 'naval-robocode-workspace' into the new workspace and also do this for the classes you have changed.
I think this should work, so I will create a new workspace for you. :-)

Best regards,
- Flemming

Flemming Larsen

unread,
Feb 11, 2015, 4:25:19 PM2/11/15
to robocode-...@googlegroups.com
Hi again,

I have now created a new workspace, naval-robocode-workspace2, based on the 'master' (newest version of Robocode).

Cheers,
- Flemming

Thomas

unread,
Feb 12, 2015, 3:02:35 PM2/12/15
to robocode-...@googlegroups.com
Great!

I'm already on it. It might just take a few days though, but I'm happy certainly happy with the clean workspace.

-Thomas

Op woensdag 11 februari 2015 22:25:19 UTC+1 schreef Flemming Larsen:

Thomas

unread,
Feb 18, 2015, 12:46:39 PM2/18/15
to robocode-...@googlegroups.com
Hey all!

Considering it's been a week, I figured I'd give an update.

Long story short: It's almost done.

There was this one thing I totally forgot about and that is the fact that I never get any errors when there's something wrong with the images.
I was stuck for 3 days (again)  because the game randomly terminated before even throwing any errors. 
After messing around with breakpoints I found out that I forgot to transfer the new ship images and the new background images.

Apparently the ImageManager just terminates if it can't find the image it's looking for (without a warning).  
Looking through the code I found it puts it in a Logger, but I can't find where this logger is printed to. :(

Anyway! 
Give me a few days. I got a free week, next week, so soon

-Thomas

Op donderdag 12 februari 2015 21:02:35 UTC+1 schreef Thomas:

Flemming Larsen

unread,
Feb 21, 2015, 5:46:29 PM2/21/15
to robocode-...@googlegroups.com
Hi Thomas,

Thanks for the update. :-)
Take your time. We are in no hurry. So when you feel the merged version is ready, I will have a look as well and give some review comments if I stumble across something. :-)

Regarding the ImageManager. We can change it to throw exceptions if images are not found. You are welcome to make any adjustments you want.
We could put it into the "baseline" code, if the changes are for the better. :-)
So if you improve the ImageManager, please notify me about it so we can put it into Robocode for good.

Best regards,
- Flemming

Thomas

unread,
Feb 24, 2015, 1:59:43 PM2/24/15
to robocode-...@googlegroups.com
Heya!

Finally got the update ready and sent a pull request.

-Thomas

Op zaterdag 21 februari 2015 23:46:29 UTC+1 schreef Flemming Larsen:

Flemming Larsen

unread,
Feb 25, 2015, 6:35:37 PM2/25/15
to robocode-...@googlegroups.com
Hi Thomas,

This time it was easy to do the merge, which could be done automatically by GitHub. Thank you for that. :-)

I examined the naval-robocode-version.md, where you write:

## Naval Robocode 0.9.4 (24-Feb-2015)
* Pull request to naval-robocode-workspace2

## Naval Robocode 0.9.3 (24-Feb-2015)
* Merged all changes into the new Robocode 1.9.2.4

## Naval Robocode Version 0.9.2
* Flemming clean-up and Naval Robocode specification
...

I recommend that you only do a version roll with the versions that are actually released (or at least going to be).
And the pull request is not really changing the source file from version 0.9.3.
We did a 0.9.1 release. Actually the first official release of Naval Robocode. But where the changes stated in version 0.9.1 was not actually merged.
Meaning that version 0.9.1 was really a 0.9.0 release. :-)

Perhaps it would be better to state all changes done to the code since version 0.9.1 and call it version 0.9.2 like this:

## Naval Robocode Version 0.9.2 (24-Feb-2015)

### Changes
* Merged all changes with Naval Robocode with Robocode 1.9.2.4 (newest version).
* Flemming clean-up and Naval Robocode specification

### Bug fixes
* Mines now have a blast Radius. (See NavalRules)
* Angles have been better documented
* Custom run config robocode.NavalRobocode

## Naval Robocode Version 0.9.1 (27-Jan-2015)

### First release
* Ships instead of tanks
* Water background
* Still uses robocode.Robocode to launch
* Using the eclipse editor would be for the best
* Ships can place mines
* The version used within the company

(However, the last sentence 'The version used within the company' was version 0.9.0')

This propose above is just a suggestion. It is up to you to decide how you want to version Naval Robocode. :-)

I haven't build the new version yet, but hope I will be able to do this by tomorrow and try things out in this new version.

If or when you feel it is ready for a release, I will do this as soon as possible. I just need to know, if it should be a version 0.9.2 or 0.9.4. ;-)

Best regards,
- Flemming

Thomas

unread,
Feb 26, 2015, 6:45:32 AM2/26/15
to robocode-...@googlegroups.com
Hey Flemming,

I do like the changes you made to the version file, so I added them and sent another pull request :)
I guess my versions file looked more like a commit history than an file telling you about the recent versions.
I'm also planning on testing the game on one of my friends who doesn't know anything about programming to see how well the in game editor would work.

Happy Naval Robocoding!

-Thomas

Flemming Larsen

unread,
Feb 26, 2015, 5:36:24 PM2/26/15
to robocode-...@googlegroups.com
Hi Thomas,

I have made my first build of the new version 0.9.2 using 'mvnassembly.cmd'.

I updated the about.html to reflect Naval Robocode version 0.9.2 based on Robocode version 1.9.2.4 (minor detail).

But the test units fail. Did they also fail with the earlier versions of Naval Robocode?

The 'navalsample' robots are located in the 'robots' folder, but the don't show up when creating a new battle and selection the robots that are going to participate in the battle?

I haven't had time to dig deeper into it tonight. Perhaps I will have better time for it tomorrow. At least the users should be able to run the 'navalsample' robots with the new version of Naval Robocode. ;-)

Keep up the good work! :-)

Best regards,
- Flemming

Thomas

unread,
Feb 27, 2015, 2:02:01 PM2/27/15
to robocode-...@googlegroups.com
Aw, shucks.

The reason why you only see regular robots is because the robocode.bat runs the robocode.Robocode class.
If you change this manually to robocode.NavalRobocode in the robocode.bat, it should work.
Just now, I tried looking into this problem, but I haven't found a way to make it generate a "navalrobocode.bat" :(

I knew some of the UnitTests didn't work anymore, so I'll look at those later :)

If you got any idea on how to fix the robocode.bat problem quickly, then I'd love to see it <3

Kind regards,

Thomas

Op donderdag 26 februari 2015 23:36:24 UTC+1 schreef Flemming Larsen:

Flemming Larsen

unread,
Feb 27, 2015, 4:08:14 PM2/27/15
to robocode-...@googlegroups.com
Hi Thomas,

Either we/you can change the robocode.bat (and also robocode.sh for *nix, robocode.command for MacOS X) in the <naval-robocode-workspace2>\robocode.content\src\main\resources.

You can also "just" copy'n'paste the robocode.bat into navalrobocode.bat and update the navalrobocode.bat file and do the same to robocode.sh => navalrobocode.sh and robocode.command => navalrobocode.command.
Maven will automatically copy these files into the distribution jar file and the installer will automatically create these when installing Robocode.
Please take care that the .sh and .command files must be using only LF (Linefeed), but no CR (Windows carrige-return). I could create these files for you?

I can do all of it for you, if you prefer?

We should have a look into the test cases as well as something could have gone wrong with the internal "game engine" so it behaves differently than it should - but not necessarily.

Cheers,
- Flemming

Thomas

unread,
Feb 28, 2015, 2:23:07 PM2/28/15
to robocode-...@googlegroups.com
Hey Flemming,

I just fixed the UnitTests and made my own naval-robocode.bat and naval-robocode.sh , and the naval-robocode.bat works for me.

Sometimes these UnitTests seem to fail for me, but this seems to be mostly because my game either skipped a few turns, or because it doesn't have access to certain ports.
If you could rebuild Naval Robocode for me with the proper ports opened etc, that'd be great :)

You should see a pull request on github~ 

Kind regards,

Thomas :)

Op vrijdag 27 februari 2015 22:08:14 UTC+1 schreef Flemming Larsen:

Flemming Larsen

unread,
Mar 1, 2015, 6:01:50 PM3/1/15
to robocode-...@googlegroups.com
Hi Thomas,

I have updated the new Naval Robocode workspace so that naval-robocode-versions.md actually controls which version that will be displayed in the current install version of Naval Robocode.
I set it to version 0.9.2, as version 0.9.2 has still not been released to the public. If we make new changes, it should still be version 0.9.2 until it has been officially released. :-)

It also created this file online:


I updated Naval Robocode, so it will check against this file to determine, if a new Naval Robocode is out there - meaning the end-users will be able to check, if a new Naval Robocode version is available. :-)

I also updated the Java docs to 'Naval Robocode 0.9.2 API'. Note that Maven (pom.xml) in robocode.api is used for injecting the version number automatically.
I also updated the main title for the Robocode window frame to write 'Naval Robocode' instead of 'Robocode'. But I have not changed this everywhere as this is a huge task.

The installer will also make sure to use naval-robocode.bat, naval-robocode.sh or naval-robocode.command when installing Robocode. The Windows registry will use naval-robocode.bat if Robocode is installed under Windows.

the /super-pom/profiles.xml has also been updated to reflect version 0.9.2 so all distribution files are built for this version-

- - - -
However, I get 45 errors when running the test units under Naval Robocode?!
It is up to you if we ship Naval Robocode 0.9.2 soon (tomorrow?) and ignore these errors or wait if you think you/we need to fix these.
I haven't looked into why the test units fail. But of course it is due to changes made to the internal logic of Robocode.
Unit tests for the normal robots should still pass. But it could be some trivial stuff like "timing" issues that changes coordinates a bit etc. so we could ignore the failing test units - at least for Naval Robocode.

Cheers,
- Flemming

Thomas

unread,
Mar 2, 2015, 10:13:46 AM3/2/15
to robocode-...@googlegroups.com
Hey Flemming,

Thank you for your additions to Naval Robocode :)

I think I fixed the UnitTest errors. The errors occured in most test classes that have something to do with the internet. 
These tests were ignored in the past, since I wasn't allowed to program Naval Robocode while connected to the internet, back at my internship.

Thing is, the bug occurred because of something else. A good example would be TestConstructorHttpAttack.java. It tested whether a robot outputs the following : "access denied (java.net.SocketPermission".
The problem was that for some reason, the output didn't contain "access denied (java.net.SocketPermission", but it contained this "access denied ("java.net.SocketPermission"   (Missing a quotation mark)
I don't know whether this is just in my case, or whether we're using different Java versions (I'm using 1.6 ) , but adding the quotation marks to these tests fixed the problem for me.

I can test and build it properly now. :)

I also updated the editor to include a "Ship" option, which gives the user a Ship template to work off of, rather than a Robot template.

According to github there are some merge errors, but I highly doubt there are many. 

As always, I sent a pull request~ 

Best regards,

Thomas

Op maandag 2 maart 2015 00:01:50 UTC+1 schreef Flemming Larsen:

Flemming Larsen

unread,
Mar 2, 2015, 4:24:46 PM3/2/15
to robocode-...@googlegroups.com
Hi Thomas,

I could not merge your new pull request manually (you need to pull the newest changes from GitHub before commiting changes ;-) ).
So I did the merge manually based on your pull request and did a new commit and closed your pull request. The result should be the same. :-)

I like the Ship template addition. That is nice too! :-)

I still have trouble with running the test units. But if you are able to run these without any trouble, this is fine with me.

I think we should ship this release now, and I will start doing so now. :-)

Best regards,
- Flemming

Flemming Larsen

unread,
Mar 2, 2015, 5:16:00 PM3/2/15
to robocode-...@googlegroups.com
I have now released Naval Robocode version 0.9.2. :-)


Cheers,
- Flemming
Reply all
Reply to author
Forward
0 new messages