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.1.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.1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: i151_engine-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a5dbbb24db399c6f4cad70f2d463db35f4d96c74c3a2cf4086be3c4e7bf92fe8
MD5 13a7c71d9dddb2e2a8bf211a9dbeb524
BLAKE2b-256 bde752ad7d066fa1661562bec53fe29cd57e2c357f055d4cfbd7674e388b8a13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: i151_engine-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3692927bd26a78e3718fe37beda255fc6c01b0cc62a3be12f033a6998d177d42
MD5 823a6f1a3e351c1121a7254a571f49a2
BLAKE2b-256 98b35c1ea1fd01dafef01cf74beee53d9c5a64eb802291c5531c5449ba9f937d

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