Skip to content

DeMaCS-UNICAL/Angry-HEX

Repository files navigation

Angry-HEX

Angry-HEX is an artificial player for the popular video game Angry Birds; it participated in the 2013, 2014, 2015, 2016, 2017, and 2018 Angry Birds AI Competition.

The agent is based on declarative knowledge bases, and features a combination of traditional imperative programming and declarative programming that allows to achieve high flexibility in strategy design and knowledge modelling. In particular, it relies on the use of Answer Set Programming (ASP) and HEX programs.

Logic programming is used for decision tasks such as which target to hit at each shot (tactic gameplay) or which level to play at each turn, and which way (strategic gameplay).


Running the agent (if you have not changed anything and you have installed everything)

  1. Open Chrome on the webpage http://chrome.angrybirds.com and make sure you are using the SD version of the game
  2. $ ./dev.angryhex.sh run server
  3. Open another instance of the terminal
  4. $ ./dev.angryhex.sh run client

Running the agent while you are developing

  1. $ ./dev.angryhex.sh set develop (you have to do this only once)
  2. $ ./dev.angryhex.sh install agent
  • you can also reinstall only the Java agent: $ ./dev.angryhex.sh install agent-java
  • you can also reinstall only the dlvhex plugin: $ ./dev.angryhex.sh install agent-plugin
  1. Follow the steps of the above section (Running the agent)

Create a file which contains all files necessary for playing

  1. $ ./dev.angryhex.sh set release
  2. $ ./dev.angryhex.sh archive

How to use the bash scripts

DEVELOPERS

SYNOPSIS

./dev.angryhex.sh command [argument]

COMMANDS

install  [all,dlv,dlvhex,box2d,agent,agent-java,agent-plugin]

run      [client,server]

set      [release,develop]

archive
  • install

    • all is the default argument; the parts of the installation (dlv, dlvhex, etc.) will only be installed if they are not present on the system
    • when using another argument (dlv, dlvhex, box2d, agent, agent-java, agent-plugin), a reinstallation of the component is forced
  • run

    • client is the default argument
  • set

    • release is set by default (because this script is implicitly used by the organisers)
    • IMPORTANT you have to set develop once if you want to develop ;)
  • archive

    • creates a file angryhex.zip which contains all files necessary for playing

ORGANIZERS

SYNOPSIS

./angryhex.sh command [argument]

COMMANDS

install  [all,dlv,dlvhex,box2d,agent]

run

update
  • install

    • all is the default argument
    • if no agent is present, a ZIP file will be downloaded (the result of ./dev.angryhex.sh archive)
    • the invocation will be redirected to dev.angryhex.sh (the script is part of the ZIP file)
  • run

    • the invocation will be redirected to dev.angryhex.sh
  • update

    • the (possibly) new agent will be downloaded and ./dev.angryhex.sh install will be invoked

Detailed description of files and folders

It contains the following folders:

  • dlv
    • Contains the logic programs for the Tactic and the Strategy of the Angry-HEX agent
  • docs
    • Contains the website (GitHub Pages) of Angry-HEX
  • framework
    • Contains the framework provided by the organizers
  • src
    • Contains the main source code of the Angry-HEX agent

It contains the following files:

  • INSTALL.md
    • Main installation instructions
  • angryhex.sh, dev.angryhex.sh
    • Scripts to install, run, update and package the agent (the first is for users the second is for developers)
  • config.properties, config.properties.tournament
    • Properties files (the second one is specific for the Competition)
  • Makefile, build.xml
    • Files needed for build automation
  • .gitignore, LICENSE, README.md
    • Self-explanatory files