Save bot's console to file

55 views
Skip to first unread message

Tom Yaacov

unread,
Aug 22, 2018, 1:33:41 PM8/22/18
to robocode-developers

I am new at robocode and started experimenting with writing my own robots. I'm using my bot's console output from battles for analysis and was wondering:

Is there a way to save my robot's console output to a file?

Flemming Larsen

unread,
Aug 22, 2018, 1:54:55 PM8/22/18
to robocode-developers
Robocode is able to record the entire battle, and you can save it to a binary file (record) or XML record.
You'll need to enable the feature under Common Options from the Preferences menu.

* Enable replay recording
* Enable auto recording (automatically saves records)

You can save records manually and load them to replay the battle from the Battle Menu:

* Open Record
* Save Record
* Import XML Record
* Export XML Record

Also notice, that you can set debug properties on your robot with the setDebugProperty(String key, String value) method. Those properties will be written you the record. This is even better, than just recording from the console, as you can specify key-value pairs so you don't need to parse the data. :-)

I hope you find this feature usable for your purpose?

The XML file is perfect for analyzing battle data using a tool that can read XML data.

Best regards,
- Flemming

Tom Yaacov

unread,
Aug 26, 2018, 5:14:37 PM8/26/18
to robocode-developers
Works great. 
Thanks!

Tom Yaacov

unread,
Aug 26, 2018, 5:14:37 PM8/26/18
to robocode-...@googlegroups.com
Works great. 
Thanks!


--

---
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.
Reply all
Reply to author
Forward
0 new messages