Vindinium starter pack in OCaml

At [1] you will find a minimal client (a.k.a "a bot") for vindinium.org [2] programming game in OCaml. You can browse it's sources directly at [1], or fetch them via mercurial like this:

hg clone http://hg.tx97.net/vindinium-starter-ocaml/

How to build it

Before building the bot, you'll need a working installation of:

  1. OCaml
  2. ocamlfind [3]
  3. Ocamlnet [4]
  4. Yojson [5]

The latter three can (and should) be installed via OPAM [6].

If you have all the dependencies installed and working, you can build the project by running make.

Once built, you can run the bot in a training mode like this:

./bot <key>

... where <key> is the secret key you get when registering on the vindinium site.

To make this bot play an arena fight, you'll need to modify it's sources -- scroll to the bottom of bot.ml, you'll see where. Naturally, you'll want to improve the AI as well.

Example output

The bot will print current game state as the game progresses, so you can see how well your bot is doing in real time. Here's a typical piece of output:

==================================
|::::::::::    ::::    ::::::::::|     HP  GOLD INC
|$-::$1::$1            $$::$$::$$| @1  97   234   2
|  ::                @@      ::  | @2  74    98   3
|    ::                    ::    | @3  93    69   1
|    ::                    ::    | @@  49   134   5
|      @1[]$2        $$[]        |
|  $-::::                ::::$$  | turn 320/1200
|        ::    ::::    ::        |
|        ::    ::::    ::        |
|  $-::::                ::::$-  |
|        []$2        $3[]        |
|    ::              @3    ::    |
|    ::                    ::    |
|  ::@2                      ::  |
|$-::$-::$2            $-::$-::$-|
|::::::::::    ::::    ::::::::::|
==================================

References

  1. http://hg.tx97.net/vindinium-starter-ocaml/
  2. http://vindinium.org/
  3. http://projects.camlcity.org/projects/findlib.html
  4. http://projects.camlcity.org/projects/ocamlnet.html
  5. http://mjambon.com/yojson.html
  6. http://opam.ocaml.org/