Skip to content

Commit

Permalink
Updating README.rst
Browse files Browse the repository at this point in the history
Additional high-level information to implement custom bots.
  • Loading branch information
alexjc committed Feb 21, 2015
1 parent 174f8d4 commit 060cc40
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.rst
Expand Up @@ -7,6 +7,18 @@ Python framework for THE RESISTANCE board & card game, along with various AI bot

----

Building Bots
-------------

To create your own bot, the best places to start are the following:

1. **Interface** — The API you must implement is located in ``player.py``, specifically a class called ``Bot``.
2. **Examples** — To find samples to learn from, see ``bots/beginners.py`` for some default behaviors.

Basically, you must implement functions for each of the key decisions the bot has to make in the game (e.g. ``select``, ``vote`` or ``sabotage``), and then have the option of overriding callback functions to get additional information (e.g. ``onMissionComplete``).

Each bot also has a ``self.game`` data-structure that stores information about the game itself. The class this refers to is ``State`` at the top of ``game.py`` — which you should consult for details.

Running Competitions
--------------------

Expand Down Expand Up @@ -62,4 +74,4 @@ Then you can follow the instructions within your IRC client to play the game its
.. |Build Status| image:: https://travis-ci.org/aigamedev/resistance.png?branch=master
:target: https://travis-ci.org/aigamedev/resistance

.. _PyPy: http://pypy.org/
.. _PyPy: http://pypy.org/

0 comments on commit 060cc40

Please sign in to comment.