Friday, August 20, 2010

Final report

Coding period is over and here is a quick overview of what parts of proposal got done, which didn't and what will be done in the future.

What was done

python support
  • python can be used to create AI in daneel-ai
MTSec AI
  • should provide a challenge to moderately skilled players
  • phase three and a half according to the proposal
simplified writing AI for new rulesets
  • simple how to guide with code samples
  • code generator for python
  • a lot of ruleset independent helper functions
What wasn't done and why
automatic ship/weapon design
  • one ship designed proved to be superior, so there was no need for other designs
automatic optimisation
  • all code is there, but battles take way too long for automatic optimisation
What is yet to be done (after GSoC)
  • difficulty settings (easy, medium, hard)
  • limit micromanagement to appear more human
  • files for single player mode so this AI with difficulty settings can be used in single player mode
  • saving state of AI so the game can be saved and AI used in scenarios
  • use new MTSec orders
  • test as many human players as possible

Sunday, August 15, 2010

Weekly report - coding 12

This week I've written a guide how to code AI using daneel-ai and python. This should help all new developers to get started quickly with AI coding without worrying about libraries and protocol. A few last changes were done to the code generator. All proposal goals should now be complete. There is only one thing in the proposal that needs to be done: Party!

This week:
  • everything was checked
  • guide written

Next week:

  • party (as specified by the proposal ^_^ )

Tuesday, August 10, 2010

Weekly report - coding 11

This week I spend most of the time getting well. I also done some AI battles to make sure SmartAI behaves as it is supposed to (and it does). Some time went into brainstorming so there will be series of posts with ideas how to improve daneel-ai, tpserver, tpclient and mtsec in the next couple of days. Pencils down date is getting closer so next week will be spend writing how-to guides and other documentation.

This week:
  • SmartAI behaviour testing
  • brainstorming
Next week:
  • how to guide for writing AI using daneel-ai
  • additional comments in the code

Wednesday, August 4, 2010

Full AI battle video

A video of two SmartAIs battling for 71 turns.

Weekly report - coding 10

Sorry for posting this report so late but I had fever for the last couple of days. I'm still a bit sick so I won't be so productive for another few days.

This week I found a workaround for the issue 126 and there was nothing left preventing me from doing lots of AI battles, so I did. I found out that after cca 30th turn SmartAI takes a long time to make decisions (more than 5 min) so optimisation was a must. I managed to speed it up using caching of some heuristics computations. It now takes up to 3 minutes on my computer which was downclocked to 800MHz because of overheating problems. Most of the action in AI battles happens in the first 30 turns, then even if one player outnumbers the other one by far it takes another 40 turns for the battle to end (video will be posted). In my opinion this is too long and can become boring for the players. I will discuss this with my menthor. I am also a bit concerned that SmartAIs ability to micromanage might have to be limited so it doesn't have too big advantage over a human player.

This week
  • workaround for issue 126
  • lots of AI battles
  • optimisation of SmartAI code
    • using caching for some of the computations
Next week
  • smarter decisions what type of ship to build (attack or colonisation)
  • discuss ways to make battles faster with Alan P.
  • make sure SmartAI is not too difficult to play against for a human player

Sunday, July 25, 2010

Weekly report - coding 9

This week a lot of time went into playing around with colonisation (now that it works). Although the server crashes when you attack multiple planets at once (issue 126), I was able to prove that running away (colonising but not attacking) is a viable tactic in MTSec (see blog post with video) and that my heuristic for colonisation works as planned. Some work was also done on providing visualisation. There is now a simple way to get images for every turn and a video of the whole game so you can see what is going on in an AI battle. There was also a minor fix so you can now use daneel-ai in single player mode again and a lot of added comments.

This week:
  • SmartAIs use of colonisation tested
    • it works well and is very useful
    • trying to outcolonise the enemy is proven as a viable tactic
  • visualisation of gameplay
    • image for every turn
    • video of the gameplay
  • added a lot of comments
    • every helper function is documented
Next week:
  • automatic optimisation if issue 126 gets fixed
  • heuristic for deciding what type of ships to build (colonisation or attack) instead of weighted random

Saturday, July 24, 2010

SmartAI demo and visualisation of the colonisation heuristic

Since a picture is worth more than thousand words and a video is worth even more I present you with both.



In this video you can see an AI battle between two SmartAIs. Red one only colonises and green one only attacks. It proves that outrunning (actually outcolonising) is a possible tactic in MTSec.
It can also be seen that the red player tries to avoid colonising planets close to the green player because they are more endangered.




Colonisation heuristic is visualised here. Small red squares represent enemy planets and the green square represents the fleets current position. Brighter means better for colonisation. It takes into account the distance from the fleet and distance from the nearest enemy planet.