Skip to main content

A highly customizable Genius Invokation TCG Simulator for AI training

Project description

Dottore Genius Invokation TCG Simulator

Python 3.10 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.

Basic rules of Genius Invokation TCG can be found here.

Installation

Make sure your Python version >= 3.10.

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 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
  • Implement greedy player agent for testing purposes

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

Future Plans

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.2.dev0.tar.gz (66.0 kB view hashes)

Uploaded Source

Built Distribution

dgisim-0.2.dev0-py3-none-any.whl (84.2 kB view hashes)

Uploaded Python 3

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