- Updated Saturday, April 19th 2014 @ 15:31:30
Debugging from text files is annoying.
I made a viewer, available for everyone who's interested. It's pretty scrappy, but at least it works. It's also Open Source, which means that if you want to fix something, you can do so yourself ;)
- Created Saturday, April 19th 2014 @ 15:34:07
Here's another debugging tip that I found useful:
Hack the Conquest source so it ignores lines starting with '#', but still adds them to log. This allows you mix bot debug output with commands, which is a lot easier to look at (especially in the log viewer).
(The simplest way to make this work is to pass a reference to
StringBuilder dumpvariable to
IOHandlerand to rewrite the
readLine()function so it continues reading until a line NOT starting with '#' is found (all the while still adding the skipped lines to the log. Not pretty, but with the least invasive surgery ;)
- Updated Saturday, April 19th 2014 @ 15:35:25
And a tip for the stylesheet of this site: < code > tags don't necessary have to be display: block. Use < pre > for that.
- Created Sunday, April 20th 2014 @ 01:02:05
Great initiative! You'll make loads of friends, and loads of stronger opponents :)
I had to sudo apt-get npm, nodejs and node, and I put a log file (no idea what name is required, assuming that will be fine?) in the logs folder. The command
node viewer.jsin the app's location runs but shows no output whatsoever, also, the localhost address is not available. What am I missing?
- Created Sunday, April 20th 2014 @ 09:39:55
Good question. If something is wrong, it should at least show some output. What is your version of Node?
Should tell you that. It should be fairly recent (around 0.10.x), but I'm not really sure what the minimum requirement is.
- Updated Sunday, April 20th 2014 @ 10:43:37
Not sure what is going on, but I had issues with "node viewer.js", I had to use "nodejs viewer.js" and it works (indeed version 0.10.x ish) :)
- Updated Sunday, April 20th 2014 @ 21:21:37
By the way, currently it only works on the output given by this website. This is a bit pointless to me as it's of course possible to already view it online :). I was wondering what changes you made to the local "server" to make it display practice matches?
This is a log that is produced by one of my matches, but it lacks the suggested information ("settings" etc) and is thus useless:
- Created Monday, April 21st 2014 @ 00:01:24
@Dualinty: System.out.println(bot2.getDump()); in the conquest engine should give the required output.
@rixOrrr: I took a look into your program and found a bug. When you lose intel on a certain region because you get cleared from that place then your visualizer doesen't add that region to the fog of war but instead you see the outdated information either till the end of game or till you get intel on that region again.
In following game you get cleared from Venezuela in Round 39. http://theaigames.com/competitions/warlight-ai-challenge/games/53540f784b5ab23f1c5dc4b9
- Created Tuesday, April 22nd 2014 @ 23:53:53
@Norman: good point. I don't really know if I can help that. I only go by updatemap lines. If I don't get an 'updatemap 39 empty' then I can't really tell.
Oh well I could, of course, build an in-memory model of all regions, how they are connected, and whether a player SHOULD be able to see a region. But meh, I'm lazy :P