Skip to content

Conversation

@daveey
Copy link
Contributor

@daveey daveey commented Dec 25, 2025

TL;DR

Added a new CommonsChest object that uses the commons inventory instead of its own, enabling shared resource access across agents.

What changed?

  • Created a new CommonsChest class that extends Chest but uses the commons inventory
  • Added CommonsChestConfig to configure these chests
  • Modified HasInventory to add a get_accessible_inventory() method for inventory access
  • Updated the chest's onUse method to support fallback to default vibe (0) when agent's vibe isn't configured
  • Enhanced agent reward system to support commons inventory-based rewards via commons.{resource}.amount stats
  • Added support for commons inventory rewards in the Python configuration
  • Updated the cogsguard recipe to use the new CommonsChest for resource management

How to test?

  1. Run the cogsguard recipe which now uses CommonsChest objects for resource management
  2. Verify that agents can deposit and withdraw resources from the commons inventory
  3. Check that agents receive rewards based on the commons inventory levels
  4. Test the fallback behavior when an agent's vibe isn't explicitly configured in the chest

Why make this change?

This change enables more sophisticated commons-based gameplay where multiple agents can share resources through a common inventory. It allows for:

  1. Collective resource management where agents contribute to and withdraw from a shared pool
  2. Rewarding agents based on the state of the commons, encouraging cooperative behavior
  3. Simplifying resource distribution mechanics by having chests that directly interact with the commons
  4. Creating more complex economic systems where agents have incentives to maintain shared resources

Copy link
Contributor Author

daveey commented Dec 25, 2025

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.

2 participants