Thread history

From User talk:Wolfman
Viewing a history listing
Jump to navigation Jump to search
Time User Activity Comment
12:56, 15 December 2013 Wolfman (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
17:52, 6 December 2013 Chase-san (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
17:50, 6 December 2013 Chase-san (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
16:32, 6 December 2013 MN (talk | contribs) Comment text edited  
16:22, 6 December 2013 MN (talk | contribs) Comment text edited  
16:17, 6 December 2013 MN (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
15:40, 6 December 2013 MN (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
08:14, 5 December 2013 Chase-san (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
21:14, 4 December 2013 Rednaxela (talk | contribs) Comment text edited  
21:14, 4 December 2013 Rednaxela (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
18:33, 4 December 2013 Chase-san (talk | contribs) Comment text edited  
18:33, 4 December 2013 Chase-san (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
18:13, 4 December 2013 Wolfman (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
18:10, 4 December 2013 MN (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
18:08, 4 December 2013 Voidious (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
18:01, 4 December 2013 Wolfman (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
17:17, 4 December 2013 Voidious (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
17:04, 4 December 2013 Beaming (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
16:52, 4 December 2013 Chase-san (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
16:30, 4 December 2013 Wolfman (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
15:28, 4 December 2013 Beaming (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
02:36, 4 December 2013 Chase-san (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
01:27, 4 December 2013 Tmservo (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
00:51, 4 December 2013 Voidious (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
00:35, 4 December 2013 Tmservo (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
00:26, 4 December 2013 Voidious (talk | contribs) New reply created (Reply to Packaging A Robot To A Jar from the Command Line?)
22:34, 3 December 2013 Wolfman (talk | contribs) New thread created  

Packaging A Robot To A Jar from the Command Line?

Hiya,

Is it possible to package my robot from the command line? I see the RoboRumble participants page specifies that the bot needs to be in a jar with a botname.properties file, and the usual way to do this is via the package menu in the client. Is it possible to do this from the command line?

Is it as simple as running the standard "jar" command, passing in the source files (and the botname.properties file)?

Thanks!

Wolfman (talk)22:34, 3 December 2013

It's definitely possible, but I haven't done it, besides manually unzipping / editing / rezipping sometimes. I think Beaming does it with normal development tho so maybe he can comment on his setup.

It is just a normal JAR with your class files + the .properties file. So whatever means you have of creating a JAR should work.

Voidious (talk)00:26, 4 December 2013

then ask beaming then

Tmservo (talk)00:35, 4 December 2013

Why did you post this? It's impolite and not helpful.

Voidious (talk)00:51, 4 December 2013

i told Wolfman to ask Beaming

Tmservo (talk)01:27, 4 December 2013
 
 

You can use Ant to package your jar, here is an example script (that I wrote) to do it. Since I mainly develop in eclipse I didn't want to switch over to Robocode to package my robot.

See the page Ant (tool).

Chase02:36, 4 December 2013
 

I use standard make file which you are free to modify, see the EvBot source link to github.

Essentially, it does the following First compiles all relevant .java files to .class and move them to special folder 'out' for ease of the followin jaring.

javac -d $(OUTDIR) -classpath $(ROBOCODEJAR) YOU_JAVA_file.java

Next you need to modify YOUR_BOT.properties file. Change version variable accordingly and you need to generate new UUID and put in the file. I am not sure that robocode actually uses it, but this is fairly easy. I do it with a simple sed script. Put this new file into $(OUTDIR)/$(SUPERPACKADE)/YOUR_BOT.properties file. Here $(SUPERPACKADE) is your rumble author designation. For my case, $(SUPERPACKADE) is 'eem' and YOUR_BOT is EvBot

Next you need to jar all compiled files and the .properties file. Since we moved it all into $(OUTDIR) at previous steps, all you need is to run

cd $(OUTDIR); jar cvfM  ../NAME_OF_JARED_BOT.jar  `find $(SUPERPACKADE) -type f`

This is it. You are ready to upload the bot for rumble or to test it locally.

I would suggest to use my Makefile which comes with EvBot, it automates all of above, and does separate packaging of test and releases according to the git tags.

Let me know if you still have questions.

Beaming (talk)15:28, 4 December 2013

Awesome, two different things to try. Cheers Chase, Beaming. I'll probably try Beaming's method first because it doesn't rely on installing Ant.

FYI, i'm not sure I'll have time to do it (i'm expecting my first child in the next week! :o), but i'm planning on making a web interface for my Raspberry PI where I can upload my source files, and it auto-compiles the jar and runs RoboRunner, pasting results back to the website. A bit like RoboRumble but for personal use - so I can keep track of results of improvements of different versions for TCRM etc. And do genetic algorithm tuning of the bot, running it on my PI so I can leave it going for a week. :)

Wolfman (talk)16:30, 4 December 2013

If you use Eclipse it comes with Ant. Ant is similar to Make in many ways, except it can interact with Java stuff on a deeper level (then Make can).

Chase16:52, 4 December 2013
 

Happy expectations! Do not forget to report motion and targeting algorithms, and code size of your baby :)

You will also have no sleep in the next 3 months. Nevertheless, parenthood is fun and recommended activity to keep us all in sync with reality :)

I personally, attempted Ant a few times, but I do not understand its logic, and config is to wordy to be human generated. So old but proven to be good 'make' is my favorite. I never mastered these fancy IDEs as well. The best I saw was Borland C with v2.something, and than I never looked back at them.

I think Raspberry is quite low on CPU power, from other hand you will not be able to check it to often, so it might work.

Beaming (talk)17:04, 4 December 2013

Ant proposes to do the same thing Make does, but with XML syntax instead, which is more portable and more friendly to manual editing. XML is a lot more forgiving on indentation and blank spaces.

Ant has become the industry standard build tool for Java applications. With Maven and Gradle closely behind.

MN (talk)18:10, 4 December 2013

Despite my (slight) efforts, I still do not understand Maven. I really should read up on it some time.

Chase18:33, 4 December 2013
 

I have to say, not too much of a fan of Ant personally. Comparing Makefiles and Ant XML I'd agree the XML is more portable, but I'd consider the Makefile to similar in terms of friendliness for manual editing. On one hand Make is annoyingly picky about certain whitespace, but on the other hand I find some of the boilerplate string repetition in XML to make things less human-readable, especially when not using a syntax highlighting text editor.

(Then again, part of my not being a fan of Ant may be on account of having seen Ant badly abused as a general-ish purpose scripting language. In other words... being forced to write certain kinds of scripting flow control in Ant XML can probably make someone start to dislike Ant...)

Rednaxela (talk)21:14, 4 December 2013
 
 

Sounds cool, I'd be curious to see what you come up with! But yes, Raspberry Pi is very slow if you're planning on actually running battles there. BerryBots single-threaded runs 20x-30x faster on my 2009 MacBook Pro than on stock Raspberry Pi. Also, last I checked, Java is a huge headache on the Raspberry Pi, but maybe that's improved by now.

Good luck next week! :-)

Voidious (talk)17:17, 4 December 2013

I looked at getting it running on my PI a few months ago but the latest Raspbian distro has java pre-installed. I've not tried it yet but I imagine it will be fine. And yes I know the PI is really low powered, it will make up for it in the amount of time I can just leave it slowly churning away while I am out of the house. I don't like leaving my 500w desktop running while I'm not around. The PI uses about 5 watts of power, but I don't think its 100 times less powerful ...

Anyway, if you get one running, you can buy another 10 for less than a single desktop and have your own PI rumble server farm! ;)

Wolfman (talk)18:01, 4 December 2013

But for the cost of 20, I got a quad-core Core i7 with 16 gigs of RAM. :-) So I can run 5-6 threads, each 20x faster than the Pi.

If you're curious, there was some talk on Raspberry Pi about some of the issues people hit, though who knows how much has changed in a year+.

Voidious (talk)18:08, 4 December 2013