Skip to content

Comments

Add parameterized social dilemma game with N-player support, dynamic …#1457

Closed
sriramsowmithri9807 wants to merge 2 commits intogoogle-deepmind:masterfrom
sriramsowmithri9807:master
Closed

Add parameterized social dilemma game with N-player support, dynamic …#1457
sriramsowmithri9807 wants to merge 2 commits intogoogle-deepmind:masterfrom
sriramsowmithri9807:master

Conversation

@sriramsowmithri9807
Copy link

Add Parameterized Social Dilemma Game for MARL Research

Summary

This pull request introduces a new OpenSpiel game, python_param_social_dilemma, designed as a flexible benchmark for multi-agent reinforcement learning. The game generalizes classic social dilemma and matrix games by supporting variable numbers of agents, dynamic payoff structures, and optional stochastic rewards.

Resolves: #[issue_number]


Key Features

  • Supports N-player simultaneous-move games (N ≥ 2)
  • Configurable dynamic payoff matrices for non-stationary environments
  • Optional stochastic rewards for robustness and exploration studies
  • Includes Axelrod-style benchmark bots for baseline evaluation

Changes Included

  • Core game implementation and registration
  • Comprehensive unit tests for the game and bots (21 tests, all passing)
  • Example scripts demonstrating usage, scalability, and tournaments
  • Documentation covering configuration, usage, and design rationale

Motivation

Existing OpenSpiel social dilemma games are primarily limited to 2-player, static, deterministic settings. This addition enables research on:

  • Cooperation and competition in larger groups
  • Adaptation under changing reward dynamics
  • Robust MARL algorithms in stochastic environments
  • Standardized benchmarking against classical strategies

Technical Overview

  • Game type: Simultaneous-move, general-sum
  • Information: Perfect information
  • Reward model: Deterministic or stochastic
  • Dependencies: NumPy only
  • Default formulation: Public-goods-style social dilemma

Testing and Compliance

  • Follows OpenSpiel Python game conventions
  • Uses pyspiel.Game and pyspiel.State base classes
  • Observer implementation included
  • Example scripts verified
  • No breaking changes to existing code

Future Work

  • Additional social dilemma variants
  • Support for asymmetric payoff structures
  • Visualization tools for dynamics and learning behavior
  • Extended benchmarking utilities

Acknowledgments

Thanks to @lanctot for implementation guidance and @alexunderch for pointers to relevant OpenSpiel documentation.

…payoffs, and Axelrod-style bots

- Implemented flexible N-player simultaneous-move game (N >= 2)
- Added dynamic payoff matrices with configurable change probability
- Implemented stochastic rewards with Gaussian noise
- Created 7 Axelrod-style bots (TitForTat, GrimTrigger, Pavlov, etc.)
- Added comprehensive unit tests (21 test cases total)
- Included example scripts for MARL usage and bot tournaments
- Added documentation (README and implementation summaries)

Features:
- Variable number of agents (default: 3)
- Dynamic and non-stationary payoff structures
- Optional reward noise for robustness studies
- Full Python API exposure for all parameters
- Compatible with OpenSpiel's simultaneous-move game API

Files added:
- Core game implementation and tests
- Axelrod-style bots and bot tests
- Usage examples and tournament demonstrations
- Documentation files
Copy link
Collaborator

@lanctot lanctot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks. A few changes before I trigger the tests.

  • Can you remove PR_SUMMARY.md?
  • Can you move everything in IMPLEMENTATION_SUMMARY.md to a section at the bottom of param_social_dilamma_README.md, and then also remove that file?
  • Can you add the new test in python/CMakeFiles.txt around line 239

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

Thanks! Looking good, yes.

I sent a few requests for changes before I trigger the tests.

@sriramsowmithri9807
Copy link
Author

@lanctot done sir, checkout the changes!!

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

@lanctot done sir, checkout the changes!!

I still see both of the top-level markdown files (see here). Did you remember to push the changes?

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

Note: the changes should be committed and pushed in your branch. The last commit above seems to be an empty change, so maybe you forgot to add the files?

@alexunderch
Copy link
Contributor

alexunderch commented Jan 24, 2026

One more note: to delete already committed files, it's not enough to delete them from your local branch, but to remove its node from the commit tree using, for example, git rm --cached FILENAME.

@sriramsowmithri9807
Copy link
Author

@alexunderch done sir, checkout once!!

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

@alexunderch done sir, checkout once!!

I am still seeing 10 files: https://github.com/google-deepmind/open_spiel/pull/1457/changes

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

You have to commit and then push after the deletions.

@sriramsowmithri9807
Copy link
Author

#1458 check out this new PR sir!!

@lanctot
Copy link
Collaborator

lanctot commented Jan 24, 2026

Replaced by #1458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants