Skip to main content

A highly customizable Genius Invokation TCG Simulator for AI training

Project description

Dottore Genius Invokation TCG Simulator

Coverage Status

A Genshin Impact Genius Invokation TCG simulator intended to be used for AI training (for now).

The simulator is modeled as a finite state machine, where all game states are immutable.

Install

Make sure your Python version >= 3.10.11.

pip install dgisim

Note that this is a developing project and the final API to users is not set in stone. So you may play with it, but using it in production is not recommended at the current stage.

Simple Guide

Once installed, you may have a try with the CLI to play the simulator in command line.

You might want to run a simple python program like this:

from dgisim.cli import CLISession

session = CLISession()
session.run()

See CLI's README for showcase and explanations of the CLI.

Features of This Simulator

First of all, it is modeled as a finite state machine, which means any intermediate state can be standalone and be used to proceed to other states.

Also, the GameState class, which represents some game state in the state machine, uses passed in Phase object to determine how to transform to another state, which means the game flow is highly customizable.

Everything in the GameState object are immutable, so traversing game history and exploring different branches of possibilities in the future are not error-prone. Do not worry about memory efficiency, everything is immutable, so only the modified part between neighbouring game states are added to the memory.

GameState implements __eq__ and __hash__, enabling you to use any game state as a key in a dictionary, and discover game states on different 'game branches' being actually the same.

Development Milestones

  • Set up the framework for maintaining game states
  • Implement game phase of Card Selection (card selection at the start of the game)
  • Implement game phase of Starting Hand Select Phase (select active character)
  • Implement game phase of Roll (Dice) Phase (roll dices between rounds)
  • Implement game phase of Action Phase (players beat each other)
    • Implement all cards (15/184 implemented)
      • Changing Shifts, ColdBlooded Strike, Jueyun Guoba, Leave It to Me!, Lightning Stiletto, Lotus Flower Crisp, Minty Meat Rolls, Mondstadt Hash Brown, Mushroom Pizza, Nothern Smoked Chicken, Starsigns, Streaming Surge, Sweet Madame, Thundering Penance, Xudong,
    • Implement all characters with their talent cards (3/48 implemented)
      • Kaeya, Keqing, Rhodeia of Loch,
    • Implement all reactions
  • Implement game phase of End Phase (summons and some support card or statuses take action)
  • Implement game phase of Game End Phase (one player wins or draw)
  • Implement CLI for better debugging experience
  • Implement interactive active CLI that accepts user input as action
  • Implement lazy player agent for minimal testing purposes
  • Implement random player agent for testing purposes
  • Implement player action validity checker
  • Implement player action choices provider
    • all action phase choices provider
    • all end phase choices provider
    • Other choices provider (trivial for now)
  • Implement greedy player agent for testing purposes

Just in case you don't know, WIP means "work in progress".

Future Plans

The fully developed project will be published to PyPI (beta versions will be available once all that are left is adding more characters and cards)

I have the plan to implement a simple cross-platform GUI interface for the simulator. But that will be in a separate repo.

Once this project is done, I'll be reading relative papers and develop an AI for this game. The AI is supposed to be used for learning strategies and making decks, but not against another player directly.

Interested in the Project?

Please read this README.

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

dgisim-0.1.dev0.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

dgisim-0.1.dev0-py3-none-any.whl (74.4 kB view details)

Uploaded Python 3

File details

Details for the file dgisim-0.1.dev0.tar.gz.

File metadata

  • Download URL: dgisim-0.1.dev0.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for dgisim-0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 d860bdb6acfea9681259bb6feef95c4c142940f7e18cc688157a1148b27ea2da
MD5 28bcc45d99fae4558a58fcedb89cf554
BLAKE2b-256 ba92b23631db2cb42a9df86bee427b03e374bc41d947dd6730f74c272f4d8655

See more details on using hashes here.

File details

Details for the file dgisim-0.1.dev0-py3-none-any.whl.

File metadata

  • Download URL: dgisim-0.1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 74.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for dgisim-0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 83becea70f7862cbe9d9d67796d737c93fd71a358bc28a63d0e287c85edf86f4
MD5 3a5e9cb0d766e5387a5012a7a4f99fea
BLAKE2b-256 9abd8d9eaf7078fa1a8216b0fb9e02dd27936d4f53efe55acebb507e167dd0fb

See more details on using hashes here.

Supported by

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