Giter Site home page Giter Site logo

py-playtest's Introduction

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.

py-playtest's People

Contributors

dat-boris avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.