A platform for running interactive experiments in the browser with standard simulation environments.
Project description
Multi-User Gymnasium (MUG)
Multi-User Gymnasium (MUG) converts Gymnasium and PettingZoo environments into browser-based, multi-user experiments. It enables Python simulation environments to be accessed online, allowing humans to interact with them individually or alongside AI agents and other participants.
Multiplayer Configuration
For P2P multiplayer experiments, MUG uses WebRTC for low-latency peer-to-peer connections. When direct P2P connections fail (due to firewalls, NAT, or restrictive networks), a TURN server provides relay fallback.
Setting up TURN credentials:
-
Sign up for a free TURN server at Open Relay (metered.ca) (free tier: 20GB/month)
-
Set environment variables with your credentials:
export TURN_USERNAME="your-openrelay-username" export TURN_CREDENTIAL="your-openrelay-api-key"
-
Enable WebRTC in your experiment configuration:
from mug.configurations import RemoteConfig config = RemoteConfig() config.webrtc() # Auto-loads from TURN_USERNAME and TURN_CREDENTIAL env vars
Alternative: Using a .env file
Create a .env file (add to .gitignore):
TURN_USERNAME=your-openrelay-username
TURN_CREDENTIAL=your-openrelay-api-key
Then load it in your experiment:
from dotenv import load_dotenv
load_dotenv()
config = RemoteConfig()
config.webrtc()
Testing TURN relay:
To force all connections through TURN (useful for testing):
config.webrtc(force_relay=True)
Acknowledgements
The Phaser integration and server implementation are inspired by and derived from the Overcooked AI demo by Carroll et al. (https://github.com/HumanCompatibleAI/overcooked-demo/tree/master).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multi_user_gymnasium-0.1.2.tar.gz.
File metadata
- Download URL: multi_user_gymnasium-0.1.2.tar.gz
- Upload date:
- Size: 251.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd83f23ca30576701ed660820a227fee10768bed215d0f3d753072fb3ac9b1bf
|
|
| MD5 |
fafeddb9db7d18c685819983a85e708b
|
|
| BLAKE2b-256 |
ac5bf042fb0128296f5468a94c698e9c148e93cc4515c89caa90a0bc0404db48
|
File details
Details for the file multi_user_gymnasium-0.1.2-py3-none-any.whl.
File metadata
- Download URL: multi_user_gymnasium-0.1.2-py3-none-any.whl
- Upload date:
- Size: 216.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad61db7d61b66759cdafbd7c26d85e0c9e8405abeb77dd21edb46516238d78c5
|
|
| MD5 |
99db06f4e9a9b8d2c3927fc9a321253d
|
|
| BLAKE2b-256 |
44746f1bbf9098ee96e1796fd54cbe58df0febeb261398e415153e27dc9c5043
|