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.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyaiplayer-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 1abf695835d839965a13601254fa878932081b23cee82dfe428e10562cf16502
MD5 e0df7e1fb67bd45c50ab4a7c348b9857
BLAKE2b-256 1803b7e5053ec4a33846da6b4076e4c105dcf8be0abb4ba46656e38672c717f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyaiplayer-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fe9eceb48518aa8063acef6167dbf1e2805bb67e314b793d2c0e26e213285992
MD5 a294a566be8794009c25d65d39e7af21
BLAKE2b-256 53bee2bb55d7ab406469ce3fc2eb7f5bd95aa37dd2cd744d096cdf311a24a6a5

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