A tool to let human play game against AI model
Project description
pyaiplayer
A tool to let human play game against AI model.
Today there are quite many python RL(reinforcement learning) models that can play arcade game, e.g. stree fighter. Models are trained in an internal environment, such as gym-retro environment, and it is not inter-actable (you cannot interact with the environment via your mouse or keyboard), which means human cannot play with/against the model you trained. It will be interesting and exciting that human can play with/against the model you trained, that's why I invented this library and share it with you guys.
You can refer to test_human_vs_ai.py which is an example for main function.
There are not too many code in this library, it is more like a reference, if you are trying to do similar thing, i.e. create a human vs AI inter-actable gym-retro environment. You may find some answer when you encounter technical problems and difficulties.
API (very simple, just two lines): env = EnvironmentWrapper(env, model) #env is grm-retro environment, normally created by retro.make method. #model is the model you trained.
then, play
env.play()
keyboard ASDW + jkluio + b (SELECT) + n(START)
press t to save current state as file saved_state.state
Force close the window whenever you want.
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 pyaiplayer-0.1.1.tar.gz
.
File metadata
- Download URL: pyaiplayer-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1331a935c81daf3bd565b8bca5da2096a07a518be525c8df2a32b4d0d15329f4 |
|
MD5 | f50b941046257f70acd67fcfe328336d |
|
BLAKE2b-256 | f3d983363b9882da2fbd8eea62646c26b02d7cb76802db76ed6df562e0ce4b00 |
File details
Details for the file pyaiplayer-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pyaiplayer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cba37037b4ea04910271ba6967b51c804b80e8bf3ced5137d82bcb0a78c48e9 |
|
MD5 | 07b13a4f45bacf198ba7fb22cfe8c855 |
|
BLAKE2b-256 | 77d3d267bb0ab0d51a9d1a87cb74a06392878723b354b61f92a6707ebc6bb9e3 |