Skip to main content

A library for rapid prototyping of boardgames.

Project description

PyPlaytest

Build Status codecov

A library for implementing framework to do virtual playtesting for boardgames.

  • Provide basic components to make it easy to create new prototypes

  • Wraps an API around the game you created to integrate with OpenAI gym or a default integration harness.

A Quick Demo

To see a demo of this game, clone this repo and run:

pipenv install
PYTHONPATH=. pipenv shell example/play.py

And you will be able to use our interactive harness to play the game.

📢: Resetting game.

📢: Start of next round!

📢: Player 0 - it is your turn!

📢: Let's see your two card.

🤔: How much you want to bet?

Player 0 taking action...
{'discarded': [],
 'others': [{'bank': 10, 'bet': 0}],
 'self': {'bank': 10, 'bet': 0, 'hand': ['7h', '7s']}}
👀 Please enter action ([bet(0->10)]):

And you can continue playing the prototype.

You can observe the code that generates the game (in a few lines of python!) in pt-blackjack/game.py.

Creating the AI

Experimental feature: this is a very basic generic game AI that we built!

In play testing a game, one enemy is the problem with context switching between different players. This makes it hard to understand your design from player's prospective. This allows us to train a simple AI that is useful for testing the game.

To create the bot, do:

PYTHONPATH=. pipenv shell example/train.py

Which will then output the bot to the a weight file (<bot>.h5f) folder. You can then play against the bot by doing:

PYTHONPATH=. pipenv shell example/play.py --ai

Which then you can start the game against the AI from the loaded AI weight file.

Getting started

To get started, read the docs at here.

pip install playtest

Then can just import playtest and get started in creating your prototype.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

playtest-0.0.10-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file playtest-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: playtest-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for playtest-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 1842da6cba090ab60e10c7b14e7cc85422101d184e9bb03251b3fd6278414ba7
MD5 fea1407bc566c89fe1c4fe840241980f
BLAKE2b-256 3509b5ff6421958d40382bab0a972f6593dd85fe5f092780f147084f5cfb99c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page