1. 20 Dec, 2011 4 commits
    • Sam Moore's avatar
      Added new sample AI - "vixen" · 3d01a564
      Sam Moore authored
      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.
      "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.
    • Sam Moore's avatar
      Improved -> Broke -> Fixed basic_python AI · 6e532774
      Sam Moore authored
      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.
    • Sam Moore's avatar
      Whoops · cf19b39b
      Sam Moore authored
      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.
    • Sam Moore's avatar
      Small changes to several things · 345d8b1f
      Sam Moore authored
      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.
      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.
  2. 11 Dec, 2011 1 commit
    • Sam Moore's avatar
      Fixed bugs, minor changes · baf69b8d
      Sam Moore authored
      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!
  3. 08 Dec, 2011 3 commits
    • Sam Moore's avatar
      The /home was not necessary · 88fc5a96
      Sam Moore authored
    • Sam Moore's avatar
      Changed the directory structure. · e3b15cd5
      Sam Moore authored
    • Sam Moore's avatar
      Modified manager program, updated website · 17a20de4
      Sam Moore authored
      Major changes: Added simple GUI for human players
      Setup phase doesn't use GUI yet (uses a default if -g enabled).
      Click in the general region of where you want to select/move pieces.
      Modified Board::Draw to allow for showing of already revealed pieces,
      but not all pieces. Used to make human player GUI nicer (hides AI pieces).
      Modified -t switch to allow for "infinite" stall_time
      (wait for user to press enter)
      Changed website. Removed protocol description and linked to manual.txt.
      Added screenshot to make things slightly more exciting.
      Updated manual.txt
      Minor changes to simulate.py (output)
      Fix segmentation fault found in manager program
      It occurs just before exit. Memory error in the cleanup process?
      Still have to bring myself to take the time to finish setting up that vm...
      Need to talk to a non-hostile wheel member about security. I don't want my vm to take out our network or something.
      Preferably I don't even want the vm to be compromised, regardless of the rest of ucc.
      So much I don't know about servers/linux...
      Need to stop staying up past midnight...
  4. 07 Dec, 2011 1 commit
  5. 05 Dec, 2011 1 commit
    • Sam Moore's avatar
      Fixed error in asmodeus.py due to stupidity · 69c1e487
      Sam Moore authored
      - Originally MoveCycle was called MakeMove and MakeMove was called MakeRandomMove
      - So when I changed the names I forgot to call MoveCycle instead of the new MakeMove
  6. 04 Dec, 2011 1 commit
    • Sam Moore's avatar
      Added a python sample agent · c753264a
      Sam Moore authored
      - Learnt python (again).
      - Asmodeus just makes random moves like "dummy", except written in python.
      - Python programs need to be started with the -u switch to be unbuffered. Easier than expected.
      TODO (still)
      - Setup vm
      	Involves kvm on motsugo? or qemu? kvm is faster, but otherwise are they the same thing? kvm's man page even calls it "qemu" (!?)
      - Come up with long term scoring and agent handling protocol
      	I have a few ideas about this. But I need the vm setup to test most of the stuff properly.