Git Product home page Git Product logo

stechec2's Introduction

Stechec2

What is Stechec2

Stechec2 is a client-server turn-based strategy game match maker used during the French national computing contest. It is a complete rewrite of Stechec to achieve a simpler architecture.

Copying

Free use of this software is granted under the terms of the GNU General Public License version 2 (GPLv2). For details see the files COPYING included with the Stechec2 distribution.

Requirements

  • gcc >= 4.7
  • python
  • zeromq
  • zeromq C++ wrapper
  • google-gflags
  • googletest
  • gcovr (for code coverage reports)
  • ruby (only for the generators)
  • python-yaml

Arch Linux:

pacman --needed -S gcc zeromq gtest ruby python-yaml gflags
pacaur -S gcovr

Debian/Ubuntu:

apt-get install build-essential libzmq3-dev libzmqpp-dev python-yaml ruby \
                libgtest-dev libgflags-dev gcovr

Installation

Let's assume you want to install stechec2 with all the Prologin games, and then use it as a player.

Clone the stechec2 repository:

git clone https://github.com/prologin/stechec2
cd stechec2

Then put every game you want to install in games/:

for game in prologin{2012..2016}; do
  git clone https://github.com/prologin/${game}.git games/$game
done

A simple test game, tictactoe, is already installed in games/.

You can then configure the project using waf, while specifying the games you want to use:

./waf.py configure --with-games=tictactoe,prologin2016 --prefix=/usr

Then build and install it:

./waf.py build install

Archlinux: A PKGBUILD is available in pkg/stechec2: run makepkg && pacman -U stechec2-*.pkg.tar.xz.

Generate the player environment

To generate the player environment (different folders for each supported languages), you can use the stechec2-generator script installed by stechec2:

stechec2-generator player tictactoe player_env

Install languages dependencies

Requirements:

  • php (warning: you may need to add open_basedir=/ to your /etc/php/php.ini)
  • php-embed
  • ocaml
  • mono
  • jdk-java
  • ghc

Archlinux:

pacman --needed -S php php-embed ocaml mono jdk8-openjdk ghc

Debian/Ubuntu:

apt-get install php7.0 php7.0-dev libphp7.0-embed ocaml mono-devel ghc \
                openjdk-8-jdk

Create your AI

You should now be able to choose your favorite language folder and begin to code:

cd player_env/python/
$EDITOR prologin.py
make

To create a tarball containing all your source files (you can add some by editing the Makefile), do:

make tar

Launch a match

To launch a match, you need to launch a stechec2-server and one stechec2-client per player. There is a wrapper called stechec2-run which runs everything you need in separate child processes, and only needs a tiny YAML configuration file to work.

A simple config.yml could be:

rules: /usr/lib/libtictactoe.so
map: ./simple.map
verbose: 3
clients:
  - ./champion.so
  - /path/to/other/champion.so
names:
  - Player 1
  - Player 2

Then you can just launch the match easily:

stechec2-run config.yml

Add spectators

Spectators are players that don't take part of the game, but can watch its different states during the match (to display it or to log it, for instance).

Make sure to compile your spectator first:

cd /path/to/prologin2014/gui
make

Then you just have to add those lines to the config.yml:

spectators:
 - /path/to/prologin2014/gui/gui.so

stechec2's People

Contributors

art-w avatar audebert avatar coucou747 avatar cri-epita avatar delroth avatar dettorer avatar ejls avatar haltode avatar jicks avatar magicking avatar malojaffre avatar nguyentito avatar pmderodat avatar rafaelbocquet avatar rissson avatar seirl avatar seirll avatar shaac avatar zopieux avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.