Skip to main content

Open Mafia Engine - a framework for mafia/werewolf games.

Project description

Open Mafia Engine

PyPI version Stable Release Docs

Test Python package "open_mafia_engine"

The Open Mafia Engine is a flexible, open-source game engine for Mafia-like games.

See the Wikipedia article for information on what Mafia/Werewolf is.

The Open Mafia Engine actually allows a much broader type of game to be played, with custom roles and very intricate "setups". Most of these custom roles come from either "real-life" games or online forums such as MafiaScum and Bay12Games Mafia Subforum.

Features

  • Event-based architecture, which allows for very complex interactions.
  • Many built-in abilities, victory conditions, etc. (Not "many" yet, but we're working on it!)
  • Games are defined declaratively or using an parametrized GameBuilder.
  • Open source & extensible.

Installing

Install the latest stable version, with recommended dependencies, via pip:

pip install open_mafia_engine[recommended]

See the dev docs to install for local development (using Poetry).

Getting started

This example starts a 5-player "test" mafia game (1 mafioso vs 4 townies):

import open_mafia_engine.api as mafia

builder = mafia.GameBuilder.load("test")
players = ['Alice', 'Bob', 'Charlie', 'Dave', 'Eddie']
game = builder.build(players)

Example Application

This repository includes an example text-based Mafia app, runnable like:

mafia-cli
# or
python -m open_mafia_engine.example.cli

This is what the UI looks like:

Example CLI Application

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

open-mafia-engine-0.5.0.tar.gz (52.3 kB view hashes)

Uploaded Source

Built Distribution

open_mafia_engine-0.5.0-py3-none-any.whl (71.4 kB view hashes)

Uploaded Python 3

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