From 060cc408bebca05e882eafa46e6095b3709372da Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" Date: Sat, 21 Feb 2015 13:26:25 +0100 Subject: [PATCH] Updating README.rst Additional high-level information to implement custom bots. --- README.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 78aa4fe..34baeb8 100644 --- a/README.rst +++ b/README.rst @@ -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 -------------------- @@ -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/ \ No newline at end of file +.. _PyPy: http://pypy.org/