Skip to main content

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.

Metadata

Release files for playtest 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for playtest 0.0.10
File Interpreter ABI Platform Actions
playtest-0.0.10-py3-none-any.whl Python 3 none any Details for playtest-0.0.10-py3-none-any.whl

Release files / playtest-0.0.10-py3-none-any.whl

Download URL playtest-0.0.10-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1842da6cba090ab60e10c7b14e7cc85422101d184e9bb03251b3fd6278414ba7
BLAKE2b-256 checksum
How to use checksums
3509b5ff6421958d40382bab0a972f6593dd85fe5f092780f147084f5cfb99c3
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for playtest 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page