Skip to content
Snippets Groups Projects
  1. Apr 28, 2012
    • Sam Moore's avatar
      [PATCH] Remove arguments, patch vixen, add hunter AI · ac335e7c
      Sam Moore authored
      The arguments stuff has been causing errors for everyone.
      No one uses arguments for their AI, so I removed it.
      
      sulix now beats vixen, so I have patched it to not make illegal moves.
      
      hunter uses the same sort of idea as vixen, but seems to do slightly better.
      
      Enjoy
      [SZM]
      ac335e7c
  2. Apr 09, 2012
  3. Mar 17, 2012
  4. Mar 16, 2012
    • Sam Moore's avatar
      s/eraseAt/remove/ · 6a473ff2
      Sam Moore authored
      6a473ff2
    • Sam Moore's avatar
      Fixed bug in Java AI · 35eb2149
      Sam Moore authored
      In KillUnit:
      I was using Vector.remove(Object), but I realised that this doesn't compare
      references, instead it uses "compareTo". Which meant the AI deleted every unit
      as soon as the first one died. Fun.
      
      I discovered gcj, which lets you compile a Java program.
      This is much easier than trying to convince the java interpreter to run.
      35eb2149
    • Sam Moore's avatar
      Fixed error in Java AI · a46f782e
      Sam Moore authored
      I was using Vector.remove(Object), but I realised that this doesn't compare
      references, it calls the "compareTo" method.
      
      See KillUnit
      
      Java AI is still using Buffered IO and so hasn't been tested with the manager
      program yet.
      a46f782e
  5. Mar 15, 2012
    • Sam Moore's avatar
      Added Java sample AI · 8827bb58
      Sam Moore authored
      Just makes random moves
      
      Can't work out how to unbuffer stdio yet.
      
      The java interpreter doesn't like absolute path names, which is annoying.
      8827bb58
  6. Mar 04, 2012
    • Sam Moore's avatar
      Add .plt templates for gnuplot · 11dd176b
      Sam Moore authored
      11dd176b
    • Sam Moore's avatar
      Added image output to manager, added plots to results pages · 5f9adddd
      Sam Moore authored
      Can generate images from manager program with the -I option
      Can generate a video from these images with the -v option (Note: just runs ffmpeg)
      These two options only work if the program was built with graphics enabled.
      
      Note: You can generate a video from a saved log file by "./stratego -v video -o logfile"
      So that's cool.
      
      Results pages look nicer. Fixed bug with score updating between rounds.
      Added pretty plots. Most plots end up being straight lines. But its pretty anyway.
      5f9adddd
  7. Mar 03, 2012
    • Sam Moore's avatar
      Tweaking manager/simulate.py, updating manual and webpage · 476617a8
      Sam Moore authored
      You can now pass arguments to your AI through the manager program.
      Simply include the path to the AI and arguments in quotation marks.
      
      EG:
      ./stratego "../../agents/foo/bar --debug" ../../agents/other/agent
      
      simulate.py was making broken links to log files, fixed.
      
      Logging of stderr! If anything is printed to stderr, it is all saved in logfilename.stderr by simulate.py
      
      Tried to make the manual page better, probably failed.
      
      Updated webpage since we have now changed the date.
      
      Also tried to fix vixen again, haven't tested.
      476617a8
  8. Mar 02, 2012
    • Sam Moore's avatar
      Fixed bug in simulate.py + hacky fix for bug in vixen · 9e4bc3c0
      Sam Moore authored
      simulate.py wasn't setting the "gameID" variable correctly,
      meaning all games were logged to "red.vs.blue.1.1"
      
      Bug in vixen found by [SLX]; it attempts to move outside the board.
      Usually when losing.
      
      Path finding algorithm (path.py) shouldn't move outside the board.
      But somehow it is.
      
      Hacky fix at the moment by checking for moves outside the board in
      vixen's score calculation, and allocating -100 to these moves.
      9e4bc3c0
    • Sam Moore's avatar
      Made printed board consistent with graphical board · e73b3387
      Sam Moore authored
      I made the graphical board draw function reveal pieces that had been involved in combat.
      But I didn't reflect this in the printed board, until now.
      
      Pointed out by [SLX]
      e73b3387
    • Sam Moore's avatar
      Fixed bug with log files · c4988773
      Sam Moore authored
      I had added some extra log messages for testing the networking functions,
      and forgot to remove them, hence replaying a logged file (with the -f option)
      was failing.
      c4988773
  9. Feb 26, 2012
    • Sam Moore's avatar
      [PATCH] Allow Human_Controller to move scouts further · 168375bf
      Sam Moore authored
      Thanks to David Gow (sulix) for this patch.
      
      I was aware of the limitation, but decided to wait until someone complained before fixing it (I also overestimated the effort required to fix it).
      So I'd like to congratulate David for being the first person to actually try and use the manager program!
      
      I'll have to allocate a prize for that.
      168375bf
  10. Feb 02, 2012
  11. Jan 21, 2012
    • Sam Moore's avatar
      Worked out networking · 341297b4
      Sam Moore authored
      Wasn't thinking straight with the initial approach
      
      Basically:
       - Each stratego program is running ONE AI program locally
      	-> That AI's responses need to be sent accross the network to the other stratego program
      	-> Each stratego program keeps state seperately and sends instructions to its local AI, so actual instructions (ie: "Its your turn") aren't sent
       - A special controller is needed to recieve the responses
      
      So we have NetworkSender, which wraps around an AI_Controller and simply sends its responses (exactly as they are) to the network
      and NetworkReceiver which waits for responses from the network.
      
      As far as networking itself is concerned, its not that important who is the Client and who is the Server.
      If an IP address is specified, then Client is used, if no IP address is specified, Server is used.
      
      NOTE: It isn't possible to use networking for both AI programs yet.
      	(ie: stratego @network @network) will fail when the Blue server attempts to bind the socket already used by the Red server.
      	I may consider fixing this at some point.
      
      Going to test on mufasa.
      
      I've just thought, if the stratego programs have different timeout sequences, there may be problems.
      Oh well.
      341297b4
  12. Jan 19, 2012
  13. Jan 18, 2012
    • Sam Moore's avatar
      Began implementation of networking · 48216daa
      Sam Moore authored
      Slightly confused about the client/server thing
      
      Server is going to run red
      Client is going to run blue
      
      Need to get them to talk nicely?
      
      Doesn't work at the moment - server can't bind socket, client segfaults (NULL pointer).
      Blergh.
      48216daa
    • Sam Moore's avatar
      pause AI in opponent's turn (Temporary) · 38c6e9b9
      Sam Moore authored
      This is a temporary and not entirely effective solution, to prevent AI from spamming CPU useage to make their opponents time out.
      Yes I could use renice instead, but its just as easy for an AI to get around.
      
      I will have to replace this with a better solution. But I don't have one at the moment.
      38c6e9b9
  14. Jan 12, 2012
  15. Jan 08, 2012
  16. Jan 07, 2012
    • Samuel Moore's avatar
      Trivial update to webpage · 6fbef43e
      Samuel Moore authored
      Thanks to Hipikat for pointing out some things that needed clarifying.
      Email matches or post in irc if there is anything else.
      6fbef43e
  17. Jan 06, 2012
    • Sam Moore's avatar
      [RULE CHANGE] "NO_MOVE" is no longer a legal · 85cfed04
      Sam Moore authored
      Previously AIs could respond with "NO_MOVE" whenever they felt like.
      Officially, now they can only respond with "NO_MOVE" when they have no mobile pieces left.
      (That is, only Bombs and the Flag are left).
      
      However the game should end by a VICTORY_ATTRITION condition as soon as either player loses its last mobile piece.
      So technically, "NO_MOVE" can't ever be legally printed, because the game should have ended. If it doesn't, there is a bug.
      
      Updated webpage, updated manual, updated README
      
      Going to email the list later today.
      
      Goodluck!
      
      PS: The rule change is due to a mean initial setup, for example:
      
      **********
      **********
      **********
      BB**BB**BB
      ..++..++..
      ..++..++..
      etc
      
      Here, Red has placed Bombs in all three "lanes". Red is unable to move.
      However, as long as Red can use "NO_MOVE", an unsuspecting Blue will lose most of its pieces on the Bombs.
      (Unless Blue puts a miner up the front...) But anyway, being able to not move is silly and not allowed in the real game.
      85cfed04
  18. Dec 24, 2011
    • Sam Moore's avatar
      [RULE CHANGE] *Victory by "attrition"* + Bug fixes · e1153eeb
      Sam Moore authored
      Minor bugs in the manager program fixed.
      Changed some messages for clarity, can't remember what, look at diff.
      
      Added VICTORY_ATTRITION; victory by destroying all of the opponents _mobile_ pieces
       (ie: Everything except Bombs/Flag)
      
      This means we don't get results of DRAW or DRAW_DEFAULT when one AI destroys all the other's mobile pieces.
      Since those games would last up to 5000 turns, this saves a lot of wasted time.
      
      AI should still respond with "NO_MOVE" when they have no mobile pieces.
      
      Made timeout value adjustable by an argument switch, '-T'
      Altered simulate.py to use a timeout variable and supply the switch to the manager program.
      
      So now I don't need to recompile and commit the manager program every time I want to test a different timeout value on mufasa!
      
      Mufasa is now on game 3 of the test round, out of 12. After FIVE HOURS.
      This particular game has lasted 1132 turns, with BLUE making "NO_MOVE" for the last 600 or so.
      The new victory condition will stop this sort of thing :)
      
      Merry Christmas!
      e1153eeb
    • Sam Moore's avatar
      Trivial · de728517
      Sam Moore authored
      I understand directory structures, cough
      de728517
    • Sam Moore's avatar
      Bug in simulate.py caused by "INTERNAL_ERROR" · fda21e69
      Sam Moore authored
      When INTERNAL_ERRORs occur, the colour wasn't added to the array in the "ALL" results.
      So when the script looks up agents["ALL"][index][4] (the colour entry), there was an indexing error.
      Fixed by adding the colour to the result array when INTERNAL_ERROR occurs.
      
      TODO: Discover cause of INTERNAL_ERROR - in the manager program
      
      It occurs on mufasa, but not on my laptop.
      I believe it is due to AI timeouts not being handled correctly by the manager program (stratego).
      On my laptop, things run nice and fast, and since all the AI work properly, there are no timeouts.
      On mufasa, things run shit and slow, and pretty much every game I tested ended with a move timeout.
      Timeout causes broken pipe after AI program is told to exit?
      
      As a temporary measure, increased timeout to 60s (from 2s). If this doesn't stop timeouts,
      there must be some other factor making things slow.
      "The problem is determining where the shittiness lies... is it the shittiness of the VM, the shittiness of python,
      the shittiness of the manager program..."
      
      Running another test round on mufasa over christmas. Hopefully it will finish running by new year. (Assume 60s a move, 300 moves a game... 12 games...)
      
      Considering putting my laptop in the clubroom and just running the competition on that.
      fda21e69
  19. Dec 23, 2011
    • Sam Moore's avatar
      As suspected, it didn't work · 24096642
      Sam Moore authored
      Need to also disable linking with the SDL and OpenGL libraries in the Makefile
      But those libraries must have pulled in pthread, because then I got link errors until I added that to linking.
      
      Attempt #2
      24096642
    • Sam Moore's avatar
      Added build option to build "stratego" without graphics · 78293905
      Sam Moore authored
      I need this for mufasa (vm), which doesn't have SDL or OpenGL or even GNOME
      Besides, it doesn't need it, and attempting to install them did not end well...
      
      Still need to test that it actually builds on mufasa
      78293905
  20. Dec 22, 2011