- Created Wednesday, March 19th 2014 @ 12:49:50
I don't really understand how i can debug my bot. In the StarterBot package there's the class "BotParser" with the engine commands. But do i have to write the commands like setup_map all by myself to create a map or is there some kind of a template which creates a valid map?
Also the map doesn't update automatically after each turn do i have to code this by myself?
I hope you understand what i mean^^ Thanks for the help!
- Created Wednesday, March 19th 2014 @ 13:02:43
If you go to your profile, pick a match, and click "Show Output"
This will give you a full log for that game. You can copy that and paste it into a fresh bot window. This will put your bot in the same state as that game, so you can debug what it was doing.
You probably don't want to copy the entire game but find one specific turn that you want to debug at, and just copy all of the text up to that point in time.
- Created Wednesday, March 19th 2014 @ 13:20:53
Oh haha didn't see that :/
Thank you :)
- Updated Wednesday, March 19th 2014 @ 13:24:30
This is not exactly correct. I have copied start of the log and at round 1 I print this:
go place_armies 2000
player1 place_armies 12 5, //this is bot's output
go attack/transfer 2000
After this at attack phase my bot did not know about his army placement at region 12. Is this a bug or I need to update my armies count myself?
- Created Thursday, March 20th 2014 @ 09:13:49
For this moment it is intended, you should update it yourself. For "the other", you get no information between place_armies en attack/transfer.
- Created Tuesday, March 25th 2014 @ 21:52:18
Hi, I'm new to Java and I'm using Eclipse. Is there any way to launch program parameters automatically after compiling? I mean, the initial settings for players and regions like: "settings your_bot player1" and so on.
- Created Wednesday, March 26th 2014 @ 16:28:31
One thing you can do is put all your commands in a text file (for example, in.txt in the same folder as your executable) and from cmd run "bot.exe < in,txt". The disadvantage is that you can now only input commands from that file, no longer from the command line.
There are more flexible alternatives. When working with sample input for assignments that are graded by DOMJudge (which is an automated grading system that works amazingly similar to uploading a bot over here), I often just make sure I have all the input in one place, copy it all and paste it into the terminal all at once. I've also messed about with changing the standard input from the code from time to time, which is more work but has flexibility in the sense that you could first let it read some common commands from a file and then return the control to the console window for further testing. This is done differently in each language, and I refer you to your language's documentation to find out how to it in your language. (Of course, using this last method, it's important not to forget to remove this extra code again before you submit it.)