Skip to main content

Headless game engine for the i151 student AI competition

Project description

i151-engine

Moteur de jeu headless pour la compétition IA i151 : règles du jeu de cartes, matchs bot vs bot reproductibles, replays JSON.

Étudiants : installez plutôt i151-arena-sdk — ce moteur y est inclus comme dépendance, avec la CLI arena et les outils de soumission.

Prérequis : Python 3.11+

Installation

pip install i151-engine

Développement (monorepo) :

pip install -e ".[dev]"
pytest

Usage

from i151_engine.bots.random_bot import RandomBot
from i151_engine.runner.config import MatchConfig
from i151_engine.runner.match_runner import play_match

result = play_match(
    RandomBot(),
    "builtin:random",
    MatchConfig(seed=42, target_score=151, cards_per_player=8),
)
print(result.reason, result.winner_id, result.final_scores)

Fonctionnalités

Module Rôle
models/ Cartes, actions, état joueur
core/ Règles, actions légales, réducteur, scores
game/ Manches, parties, enregistreur de replay
view/ PlayerView — perspective partielle pour les bots
opponents/ Catalogue d'adversaires (builtin:random, …)
runner/ play_match, timeouts, forfaits

v1 : 2 joueurs, partie jusqu'à 151 points, RNG seedé, un adversaire intégré actif (builtin:random).

Adversaires

Les matchs référencent un opponent_id stable (ex. builtin:random). Le catalogue complet est dans i151_engine.opponents.catalog ; seuls les adversaires implemented=True sont jouables.

Interface bot

class Bot(Protocol):
    def setup(self, submission_dir: Path) -> None: ...
    def decide(self, view: PlayerView, legal_actions: list[Action], time_left_ms: int) -> Action: ...
    def teardown(self) -> None: ...

Les bots étudiants implémentent decide() via le SDK (arena_sdk), pas directement ce protocole.

Documentation

Ressource Lien
SDK étudiant i151-arena-sdk sur PyPI
Tutoriel i151.djamma.dev/docs/tutorial
Architecture détaillée i151.djamma.dev/docs/architecture

Documentation technique interne (monorepo) : ARCHITECTURE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

i151_engine-0.2.0.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

i151_engine-0.2.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file i151_engine-0.2.0.tar.gz.

File metadata

  • Download URL: i151_engine-0.2.0.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for i151_engine-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e853c87565a996b4f8e9ae7ac24e04ba3ed653fa516c67eb87f6e6ae189a40a
MD5 0a53807b8f42e419e01d0cb6c9af7095
BLAKE2b-256 eb6a84272b8075177dbc196a9d262c3b9ba8f94d84e5defadc3a24277d63a9cb

See more details on using hashes here.

File details

Details for the file i151_engine-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: i151_engine-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for i151_engine-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2967533eb5e52f53a22e1ec085c2d5bb74f844b6ca310a79e3088c84ff385a99
MD5 a7e1c31e4112642ab2e8343a3fd70d0f
BLAKE2b-256 4156901b6de926d395234fa971bf5a16ef372dd70057ca555ca4ce14207053e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page