Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaiplayer-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

pyaiplayer-0.1.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file pyaiplayer-0.1.2.tar.gz.

File metadata

  • Download URL: pyaiplayer-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.10

File hashes

Hashes for pyaiplayer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 eb9fab91c9c7b92c942f9afa94c5b4f675765d1595e2703c0c01d78aa467003d
MD5 e26a18a258e3a2ee07af7281407fad10
BLAKE2b-256 7f3e3bae3146119a3d447435da1e0fed069e39b9481ebff2cb18904549324f74

See more details on using hashes here.

File details

Details for the file pyaiplayer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyaiplayer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.10

File hashes

Hashes for pyaiplayer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d41413580bef4e5c325c9e99ac4efbce30fdfb5530bafe41320211c46e13bc44
MD5 c6c90bd677ed4fe0434cc9c9f3a18893
BLAKE2b-256 3d2dbe77e6927dfd82c5dcfe06dfe8f01a1ef33d1b0ce681eb098a67da34716b

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