http://www.ai-contest.com/index.php
I didn’t see any prizes mentioned, so it might just be for bragging rights. Allowed languages are Java, C++, C# and Python.
http://www.ai-contest.com/index.php
I didn’t see any prizes mentioned, so it might just be for bragging rights. Allowed languages are Java, C++, C# and Python.
That look nice and well done. I will be in.
EDIT : Here is my profile http://ai-contest.com/profile.php?user_id=6834
Yeah, I didn’t see prizes either. I might make something for it, but I doubt it. There’s very little chance I could compete against AI experts.
Is the goal really to win?
I signed up. Not a chance I’ll do any good though.
Anyone else in?
Code base seems kind of weird. Anyone get it working in eclipse? It runs in a very awkward manner.
Also the GUI is slow and doesn’t update till after the match. Wish they would of did that a little better.
How are you guys getting output for debugging/checking? Printing to system out or writing to file are both no-noes.
man this thing is awkward to deal with.
I was actually thinking it might be fun to make a Q-Learner or Neural Network AI for this, train it for a few days, then see how well that does. The only challenge then is figuring out how to represent the game within reasonable state space or fitness equation, but Galcon is simple enough that I think you could manage. Although there is a limit on how long you can take to do moves, there is no limit on the amount of memory you need (a large state space for Q-Learner would need probably like 10mb of RAM all on its own, at least), nor the amount of crap you store on the hard disk (store the “winning” state space on disk so it can be loaded up properly). You could also do a genetic algorithm along the same lines.
Hmmmm… now I’m getting intrigued.
You can’t write to disk though. So all your training would have to be against offline bots and don’t know if that would be a good sample?
Interesting, I guess you have read Blondie 24? I have made my own attempt at an AI for a strategy game that would learn by competing with itself (that has it’s own problems I know). I failed bigtime…
(but it was fun to see as I made it play all the matches with the real game graphics in a window, kind of like in the movie Wargames).
I’m curious, how would you go about making the input for the neural network. I guess each planet could be four inputs, one for you, one for the enemy, one for the planet size and one for neutral forces. But how would you represent the movement of fleets? Also, the positions of the planets must enter the equation somehow. I fear the number of nodes in a neural network would be far to great for it to work in practice. Or?
I am interested and i agree. Its not as bad as it looks at first glance. Its basically “file filters” type interface and that’s easy to be language neutral. So i would say its adequate.
What i don’t see is that if you get to see what the other player orders or has flying since in the real game you can. Also from the forums, the game are going to be limited to 200 turns which is not a lot when a fleet can take over 12 turns to get across a map.
If you can see what your enemy is doing (working that out from the code now), I think i am going to try a plain old min/max tree.
So you do get to “see” everything aka no hidden state. That means that a optimal strategy does exist and min max trees with pruning could work really well… If there wasn’t a time limit. With a time limit etc could be hard to get workable.
Also java is “slow” in this case. The games take about 400 seconds tops and run in their own JVM started per game (as far as I can tell so far). This means warm up time will be significant and a properly adaptive method of decided when to “give” up and finish giving orders will be important.
Finally the java stater pack smells like C. The reading loop in main is very C like in that its a really slow way to read a input stream in java. So one can gain some cycles there.
I have joined. I’m using text editor and command line for the bots, it feels like going back to school 
The source code of the server is available http://code.google.com/p/ai-contest/source/browse/trunk/planet_wars/viz/Engine.java and it seems that it only has a time limit per turn, not per client - so it may be your bot that timed-out because you were left with too few msec in that turn by your opponent(s).
delt0r, what would you propose for best optimization in that loop?
They have said that a game is limited to 200 turns (from the forums) --well game can run longer but they truncate the “results” at 200. Your bot only gets to execute a maximum of 200 seconds of action code tops that counts.
Hotspot will still optimize a lot in the first 30 sec. The trick it to use the 1 second you have without timing out when hotspots could be compiling on the fly.
Ugh, yeah, I forgot you’d need to know what was in transit, too. That would indeed be a massive number of nodes / states.
And I was thinking you’d just have your own AI play against itself and see how good it gets. You could also potentially play against it yourself, but I don’t think that would make much of a difference.
I really love the idea, always wanted to organize such contest, will try 
( too bad that’s Google :-X )
Yes, it would have to play itself. You would probably have lots and lots of bots with random weights and then weed most out. Not like normal training, since we don’t know what the perfect move is. It will have to find out.
I got an idea, it may not work. Divide the map into 10x10 tiles. Each tile have four inputs (I know, this will be 400 inputs, but modern computers are fast).
Then just wire it together with some layers. The output will be the same grid. A high value indicate that you should send your fleet there. A low value would mean it can spare some.
Some tiles will have more than one planet in them. Shouldn’t be much of a problem I think. An AI can super fast shift around a fleet between planets that are close together. Also, you could try to assign planets to empty tiles instead of cramming 3 of them into the same and leaving the neighbor empty.
The size 10x10 may not be optimal. Maybe 5x5 can work just as good. More work for the wrapper around the neural network.
Investment Strategy
I was thinking a simple pricing model might work. Anyone see any flaws with this?
The theory is, if you make better investments then the other bot, you’ll out grow him.
The cost would be how many ships it takes to capture.
The distance would also factor into cost some how. Everything being equal you would want a closer planet (since you could capture it fewer turns).
The value of a planet would be it’s growth.
All those are known and pretty solid maths. The last input would be probability. The probability of the enemy attacking the planet. Everything else being equal you want one that is less likely to be attacked (since it’ll reduce your return and/or even lose your investment).
One way to do that is calculate all the above in reverse order for him. The better investment it is for him, the more likely he’ll attack it.
At the end of the day it’s the most ships that wins, not most planets.
Parasite Strategy
Another one I was thinking of is using a "Parasite " strategy. Any planet he attacks, you attack. He uses maximize resources to capture a planet, you use minim resources.
For example, if a neutral planet is at 50 and he sends 55 ships to capture it, the planet is left with 5 enemy ships. You send 10 ships and capture it out from under him.
He spend all those ships to capture it, but you plucked it from him for very cheap. This would work if the bot wasn’t aggressive. If he attacked you directly it’d probably fail.
@dime : Yup that should be very good strategy and very simple to do.
I currently did my first submission (rank 80). But I had some problems so far. Any of you found out how to test your program (something like System.out.print() ). I can’t seem to get any feedback with the way it’s done.
Test locally writing out to a log file. You can also play against others on server from your machine and log that too.
Just wondering, has anyone submitted something yet? I’m curious to see how everyone is doing. If you are looking for mine my account is MarcAndrePC (131 at the moment, just went up from 600 with a new submission…)
Btw thx for help delt0r.
I haven’t yet. I play on the TCP server a bit. I am finishing a game player TCP live watcher at the moment. Should be finished so and i will releases it. Really the code they provided was total crap.