dmangame

an ai game. maybe.

RushAI vs. ExpandThenSearch

;

jumping in with code

    

  # download the engine
  git clone http://github.com/dmangame/dmangame
  cd dmangame/

  # download more AIs, this will download AIs from 
  # dmangame's dmanai repository.
  git clone http://github.com/dmangame/dmanai
  grep -Rl AIClass * # Prints a list of files with AI in them

  # no one will win this game.
  python main.py --hl dmanai/basic/searchai.py ai/towerai.py

  # make SearchAI win
  vim dmanai/basic/searchai.py
    
    

interacting with the world

units (move) around the map,
(shoot) bullets at other units
and (capture) buildings.

taking the world in

AIs and units can see their visible_buildings and visible_enemies.

Every turn, each AI is informed of its new_units, dead_units, new_buildings and lost_buildings.

The AI also knows about my_units and my_buildings

where you come in

    
# simpleai.py
AIClass="SimpleAI"
import logging
log = logging.getLogger(AIClass)

class SimpleAI(ai.AI):
    def _init(self):
      log.info("Initializing: Current Turn: %s",
                self.current_turn)
    def _spin(self):
      log.info("My visible units:%s", self.my_units)
      log.info("My visible enemies:%s", self.visible_enemies)

    def _unit_died(self, unit):
      log.info("%s died", unit)

    def _unit_spawned(self, unit):
      log.info("Received a new unit: %s", unit)

    
    

be social

fork the dmanai repository
& push your AI to github

      # register a user on github
# fork the dmanai repository

# play against any AI on github, using
python main.py <github_user>:username/ai.py 

be competitive

register your AI to play in the dmangame ladder

# In username/ai.py
class MyAI(ai.AI):
  PLAY_IN_LADDER=True
  ...
  def _spin(self):
    pass

  ...

git add username/ai.py
git commit -m "Adding my AI to the ladder"
python main.py -r <github_user>:username/ai.py 

the ladder

;

alright already - stop tlaking

http://dmangame.github.io/dmangame

look here for news, tutorials, APIs, feedback, etc