Changed directory structure (again) I got fed up of typing progcomp2012/progcomp Obsessive compulsive urges rising...
Fixing simulate.py Now reads the round number from an "info" file, instead of counting number of files in the directory. Fixed errors in simulate.py creating .html files. Made results slightly prettier, moved directory to /web/results Included links to raw log files /web/log for games. Should install an apache server on mufasa, so that people can view the results online.
[RULE CHANGE] *Changed rule for Bombs*, tweaking vixen agent Previously, contact with a Bomb destroyed the Bomb even if the attacker was not a miner. Now, the only way to destroy a Bomb (ever) is to attack it with a miner. Yes, this means that if the enemy Flag is surrounded by Bombs and and AI has lost all its miners, it is impossible to win. This reflects the rules of the original game. My version is now identical to the original game. My original rule was intended to decrease the emphasis placed on Bombs and Miners. Having played a few games, I think the traditional Bomb rule is more interesting, even if it makes things harder for the AI. If there are any problems with this change, please email matches@ I will be happy to revert to the previous rules if there is demand. This also goes for the change to equivelant ranks combat (earlier commit today). Updated vixen agent's scoring to take into account the change. Yet to update asmodeus's scoring. The AI's seem to have a much harder time now that they have to take out Bombs Games often result in draws, because the Miners are easy targets and get killed whilst seeking out Bombs. The AI should probably defend certain pieces with stronger piece combinations nearby. But this is all getting rather complex for a "sample" :P TODO: Implement victory condition when opponent has no mobile pieces (Currently play continues until the player with mobile pieces ends up attacking Bombs because it has nothing else to do at which point the game is a draw because neither player has mobile pieces)
Added new sample AI - "vixen", improved "basic_python" I was going to create a highly advanced super AI and not reveal the source code. Then I would win the competition! But, turns out it is just as shit as all the others, so I added it to git. Also I made the competition, so that seems fairly self defeating. It was easier to add some extra stuff to basic_python than to force it into the new AI. "vixen" (where do I get these names? Well, a fox is smart, and a vixen is a fox. Therefore, "vixen" is a smart AI. Q.E.D) I basically copied asmodeus' "optimised score" and path finding technique, but I changed the way scores are calculated to include probability. At one point I was adding the scores for paths that began with the same direction. This seemed like a brilliant idea. It was not. After all this, vixen beats asmodeus some of the time, I haven't tested how often, but each AI has beaten the other at least a few times. Most of the time vixen loses seems to be due to losing the marshal or general on bombs. Its pretty good at countering the spy. It turns out writing a decent stratego AI is harder than I thought :P In other news, in the manager program, I removed the automatic hiding of the AI's pieces when a human is playing, because its useless and annoying.
Improved -> Broke -> Fixed basic_python AI In the first place, should have probably actually tested this AI It was calling "move" with only 3 arguments, when I added a fourth one (multiplier) In the second place, added storing of more information by InterpretResult Also rewrote the code to make it much clearer when I got tired of retyping "self.board[p[0]][p[1]]" every second line... Of course rewriting the code was a bad idea, and caused many stupid errors. But it should be fixed now... Since asmodeus and other python AI inherit directly from the BasicAI class in basic_python, it kind of needs to work.
Whoops Read the diff Also, forgot to mention progress in simulate.py in last commit. Made progress with total.html results file, and round by round results files. Although since the round number is never updated properly, we only ever get "round1.html", overwritten each round.
Small changes to several things Changed combat outcomes for equivelant ranks: Up until now, victor was randomly chosen Changed so that result is always "BOTHDIE" Updated manual page for manager Added section on unbuffered stdin/stdout Modified sample agents to take into account MULTIPLIER There is no way for a human player to move the scout multiple spaces yet. Sample agents still play each other fine, but since none of them actually move scouts multiple spaces, this doesn't prove the new code works. TODO: Test properly (add scout movement to asmodeus and see if everything still works?) Updated webpage. Added section on unbuffered stdin/stdout Added some other pointless waffle. Mmmm waffle. TODO: Make simulate.py keep track of the round number properly. I'm sure this is simple to do, but I can't be bothered right now.
Fixed bugs, minor changes Fixed segfault in manager caused by attempt to print invalid setups to log Fixed SIGPIPE in manager caused by attempt to message non-existant programs. Although I previously fixed a similar SIGPIPE, It is also possible for a file to exist but not have executable permissions set. Controllers set to use such files as executables were returning true for Valid(), but were in fact, not valid at all. Use the access function (thanks stack overflow!) to check for executable permissions and existence in Program::Program. If they aren't set, or file doesn't exist, set pid to -1 which is an "invalid" controller. Discovered python trick which allows me to get rid of stupid "run.py" files for the python AIs. Modified the simulate script to take the number of rounds as an argument. Also made its output slightly prettier. Currently testing simulation of 10 rounds on my laptop at home. "./simulate 10; shutdown -h -P now" I hope it doesn't set the desk on fire while I'm asleep... :S Oh, and the VM is finally setup, hooray!
The /home was not necessary Derp