Adding robots .jar file to /robocode/robots does not add robot to list

1,049 views
Skip to first unread message

quah...@gmail.com

unread,
Nov 20, 2016, 2:45:40 PM11/20/16
to robocode
I have created a robot and packaged it as a .jar file. I moved the .jar file into /robocode/robots , but on running robocode, my robot doens't show up  in the list of robots. How would I make it work?

I am on Ubuntu Linux LTS 14.04

fnl

unread,
Nov 20, 2016, 3:42:40 PM11/20/16
to robocode, quah...@gmail.com
Did you use the robot packager in Robocode or create the package on your own? You need to package your robot with Robocode (Robot -> Package robot or team), as it will create various .properties files inside the .jar archive.

If you did package your robot using Robocode, then try the clean the robot cache using Options -> Clean robot cache.

Cheers,
- Flemming

Fu Yong Quah

unread,
Nov 23, 2016, 4:40:49 AM11/23/16
to fnl, robocode

That solves the problem - I can now access the robot if I use it from the robocode interface. However, I still can't access it programmatically using robocodeengine, unless I put my class file in the robots/sample directory (which means my robot has to fall under the sample package). Is there anyway to get around this?

Flemming N. Larsen

unread,
Nov 24, 2016, 5:51:29 PM11/24/16
to Fu Yong Quah, robocode
Hi Fu,

I am not sure I understand the problem, you are struggling with.
First of all, Robocode will look out for robots (jar files) in the default robot directory. You can change this directory by setting the ROBOTPATH environment property, e.g. by adding:
-DROBOTPATH=<your file path> to the java command-line options. See more information here: http://robowiki.net/wiki/Robocode/Console_Usage

Secondly, your robot does not have to be under the sample package, just because the sample robots use this package.
You can chose what ever package you want. But typically, the Robot Packager of Robocode will make a package name for you based on your initials/handle and Robot/Team name + version.

You should be able to specify which robots to participate in a battle by using their fully qualified name, e.g. fnl.Rampage_1.0

Best regards,
- Flemming

Fu Yong Quah

unread,
Nov 28, 2016, 7:31:59 PM11/28/16
to Flemming N. Larsen, robocode
The package naming solved the problem. Thanks!

fnl

unread,
Nov 29, 2016, 3:53:55 PM11/29/16
to robocode, flemming...@gmail.com, quah...@gmail.com
You are welcome. I am happy that you got it solved. :-)

Best regards,
- Flemming
Reply all
Reply to author
Forward
0 new messages