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

Uploaded Source

Built Distribution

dgisim-0.2.dev3-py3-none-any.whl (94.1 kB view details)

Uploaded Python 3

File details

Details for the file dgisim-0.2.dev3.tar.gz.

File metadata

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

File hashes

Hashes for dgisim-0.2.dev3.tar.gz
Algorithm Hash digest
SHA256 9bbf868ba9649c171c4833ad2e61098b446a300fe321a5e05185dc503eef2da0
MD5 b1a2be6442bb5e2ff1078fb73692032e
BLAKE2b-256 33217a45c2ff880da8f24454e41fdcb42dab4df7ce9abe4159e286047203ae0c

See more details on using hashes here.

File details

Details for the file dgisim-0.2.dev3-py3-none-any.whl.

File metadata

  • Download URL: dgisim-0.2.dev3-py3-none-any.whl
  • Upload date:
  • Size: 94.1 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.2.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 300089f63ca0868a1fe2516d64686e25feb2706b582fddc59ff16d73e4df6891
MD5 ebe9f5388fba0b77aef4007b26aec7d2
BLAKE2b-256 44fb649badd5abbb50e939e8c0dc1ab1a332b03f0a77594dfcfd07f34fde8b80

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