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.

Wiki

Simple Start With CLI

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()

Or try the CLI online on Google Colab

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.

State Machine Design

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 (26/192 implemented) (details)
    • Implement all characters with their talent cards (7/51 implemented) (details)
    • Implement all reactions
    • Implement all logics to support the implemented cards and characters
  • 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

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.

Wants To Contribute?

Please read this.

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.dev3.tar.gz (74.9 kB view hashes)

Uploaded Source

Built Distribution

dgisim-0.2.dev3-py3-none-any.whl (94.1 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