Package: dgisim
Dottore Genius Invokation TCG SimulatorA Genshin Impact Genius Invokation TCG simulator intended to be used for Reinforcement Learning.DocumentationSource codeContributingGame designBug reportsDiscord serverThis package aims to help programmers code things based on Genius Invokation
TCG with ease. e.g. AI, desktop application, website...The simulator is modeled as a finite state machine, where all game states are immutable.
Optimizations are done to make sure immutability doesn't impact performance.Basic rules of Genius Invokation TCG can be found onFandom.InstallationPlease make sure your Python version>= 3.10before installing.pip install dgisimRL Environment Usage ExamplefromdgisimimportLinearEnvenv=LinearEnv()rl_net=...# your RL networkforepisoderange(100):env.reset()game_state,encoded_state,reward,turn,done=env.view()whilenotdone:...# do the training on the encoded_stategame_state,encoded_state,reward,turn,done=env.step(action)For more details please check thedocumentation.Try the Simulator in BrowserWebsite:https://jarvis-yu.github.io/Dottore-Genius-Invokation-TCG-PWA/Repo:https://github.com/Jarvis-Yu/Dottore-Genius-Invokation-TCG-PWATry the Simulator in CLIRun LocallyOnce installed, you may start by trying the CLI to play the game first.You might want to run a simple python program like this:fromdgisimimportCLISessionsession=CLISession()session.run()Run RemotelyYou may try the CLI online onGoogle ColabCLI Simple UsagesSee CLI'stutorialfor showcase and explanations of the CLI.FeaturesThe package allows:Customization of player agentsCustomization of charactersCustomization of cardsCustomization of game modesThis simulator is modeled as a finite state machine, which means any intermediate state can be
standalone and be used to proceed to other states.TheGameStateclass represents some game state in the state machine. It uses passed inPhaseobject to determine how to transform to another state, which means the game flow is
highly customizable. (Default Mode and some Heated Battle Modes are implemented already)Everything in theGameStateobject are immutable, so traversing game history
and exploring different branches of possibilities in the future are not error-prone.
stable simulator did optimizations for immutability.
The unchanged data are shared among neighbouring game states.GameStateimplements__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.AnActionGeneratorcan be returned by any validGameStateto help
generate valid player actions.Development MilestonesCurrently a full game can be played with any combination of the characters and cards implemented.Implement all game phases (Action Phase, End Phase...)Implement all cards (158/248 implemented)
(latest-details)
(stable-details)Implement all characters with their talent cards (36/71 implemented)
(latest-details)
(stable-details)Implement all reactions, death handling, revival handling etc.Implement all game logics to support the implemented cards and charactersImplement interactive CLI for better debugging experienceEnsure 99% unittest coverage checking behaviour of characters and cardsImplement lazy player agent for minimal testing purposesImplement random player agent for testing purposesImplement player action validity checkerImplement player action choices providerFuture PlansI 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.