A highly customizable Genius Invokation TCG Simulator for AI training
Project description
Dottore Genius Invokation TCG Simulator
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.
Documentation
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 all cards (15/184 implemented)
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dgisim-0.2.dev2.tar.gz
.
File metadata
- Download URL: dgisim-0.2.dev2.tar.gz
- Upload date:
- Size: 66.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b692e9214ef603707a87e983c5ead27ac7a360317441772f3d198e9232b5327 |
|
MD5 | 3ac7e560a84c2b226db911c8e6b4a06e |
|
BLAKE2b-256 | a30bf6e1e5064585f0156cd161550cf601131a19e4c645acef863f131f5807a9 |
File details
Details for the file dgisim-0.2.dev2-py3-none-any.whl
.
File metadata
- Download URL: dgisim-0.2.dev2-py3-none-any.whl
- Upload date:
- Size: 84.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f50b1b45ed635f92e37312b33fbfc7af7dd85015afce321652806a32e6be903e |
|
MD5 | 4e73ac50d7e95ac8cf7bc5ae368704fc |
|
BLAKE2b-256 | b5d10c318afc91e6460f25b3cef1aa88fe5a1c06bd1348a8841c6d6856c16041 |