Join the Discord

Unity tools by Magic Pig Games

Game Modules 4

Stats, items, buffs, quests, loot and save/load for any Unity game

Game Modules 4 is a Unity asset by Magic Pig Games that provides the systems behind RPGs and other games: stats, skills, items, inventory, loot, buffs and debuffs, quests and save/load. You create stats, items, conditions and quests as ScriptableObject assets in the Editor.

Version 4.2.5 · updated September 17, 2026 · Unity 6.0 or newer

What Game Modules 4 does

  • Stats, skills and counters

    Create stats like Strength, skills that level up through Mastery Levels, and counters like Gold or XP. Stats can modify each other, and a pool like Health can be capped by a Max Health stat.

  • Items, attributes and loot

    Item Objects are the things players find and equip, and Item Attributes like Flaming add stat effects and build names such as Flaming Iron Sword. Loot Boxes roll random items and attributes for chests and enemies, using curves you control.

  • Buffs, debuffs and status effects

    Conditions change stats while active, tick periodic effects like poison or regeneration, and remove themselves when they expire. Add one to an actor and the rest is automatic.

  • Quests with steps and rewards

    Build one-step or multi-step quests whose goals check stats, inventory, conditions or Blackboard values. Rewards can grant stat points, items from Loot Boxes, conditions or follow-up quests, per step or for the whole quest.

  • Built-in save and load

    Give any object a Saveable component and a script that implements ISaveable, and one call saves the scene. Saves are JSON files with multiple slots, and loading happens automatically when a scene loads.

  • Drag-and-drop grid inventory

    An optional grid inventory handles drag-and-drop, stacks and item rotation, and shows items as lit 3D models. A built-in tool creates an item's inventory and world prefabs from a single 3D model.

  • Blackboard, Dictionaries and Enums

    The Blackboard shares values and events between systems without direct references. Dictionaries attach custom data to any object, and Enums turn a list of allowed values into a dropdown and generated C#.

  • AI skills for coding assistants

    Bundled skills let Claude Code, Codex and other AI assistants create stats, items, conditions, quests and loot for you, and write the C# that uses them. They work with Unity's MCP bridge or without it.

Works with AI coding assistants

Game Modules 4 comes with skills for AI coding assistants such as Claude Code and Codex. Once they're installed, your assistant knows how Game Modules 4works, so you can ask for what you want in plain English:

  • “Create stats for Might, Magic, Stamina, and Health.”
  • “Make a 'Health Potion' item that restores 25 Health on use.”
  • “Add a quest that rewards 100 gold when the player reaches Level 5.”
  • “Create a Poison condition that drains Health every in-game minute.”
  • “Make equipment slots a dropdown instead of typing the name.”

How it works

Authored data. Stats, Item Objects, Item Attributes, Conditions, Quests, Loot Boxes and the other object types are ScriptableObject assets you create in the Game Modules Manager window. They’re saved under Assets/Game Module Objects/, in folders by type and category, and a single GameModuleRepository indexes them all. Every object also has a Dictionaries bag for extra data, such as a sprite, flavor text or a list of starting skills.

Live state. Your character class inherits GameModulesActor, or GameModulesInventoryActor if it uses the grid inventory. The actor holds lists of runtime copies (GameStat, GameItemObject, GameCondition, GameQuest), so every character has its own values. Equipped items, active conditions and quests feed their modifiers into the actor’s stats, and changed stats recompute on their own. You don’t write an update loop for any of it.

Scene setup. Each gameplay scene needs the Blackboard, Save And Load, Timeboard and QuestEventBoard prefabs. The Blackboard shares values and events between systems, and the Timeboard runs Gametime, the in-game calendar that condition durations and timed quests use.

Code access. Most types live in the InfinityPBR.Modules namespace. Property Code generates typed accessors such as Properties.Stats.Attributes.Health, so you don’t hand-type names or IDs, and GameModuleRepository.Instance.Get<T>() finds any object by uid or name at runtime. The Game Modules Viewer component shows an object’s live stats, items and quests in the Inspector, and lets you edit them at edit time or runtime.

Other modules cover Voices (character audio lines by voice, line and emotion), Lookup Tables for non-linear formulas, and a configurable First Person Movement controller.

Working with an AI assistant

Game Modules 4 ships with skills that teach AI assistants such as Claude Code, Codex or Cowork how the framework fits together. For Claude Code and Cowork, install them from your Unity project folder:

bash "Assets/Magic Pig Games (Infinity PBR)/Game Modules 4/Claude Skill/install.sh"

For Codex, copy the game-modules-4 folder from that Claude Skill folder into .agents/skills in your project.

Ask “What can you do with Game Modules 4?” to confirm the install worked, then describe what you want in plain English. With Unity’s MCP bridge running, the assistant creates and edits the assets in the open Editor, registers them and regenerates the Properties code. Without the bridge, it writes a small editor script that you run from a menu. It also suggests companions like a Max Health stat to cap Health, and helps write the C# that uses your data.

Extending it with your own code

  • Almost every GameModulesActor method is virtual: override what you need instead of rewriting it.
  • Subclass shipped scripts such as GameLootBox instead of editing them, so updates don’t overwrite your work.
  • Your own QuestCondition and QuestReward classes are discovered automatically, whichever assembly they live in.
  • Implement IHandleLootBoxes to tie drops to game state, such as a luck stat.

The scripting documentation goes into each module in detail. For a complete example, see the Party Based RPG Demo Game on the Asset Store: a first-person party game with character creation, quests, loot and enemies.

More videos

Questions about Game Modules 4

Is Game Modules 4 only for RPGs?

No. RPGs are a natural fit, but the systems work in any genre. One of our tutorials uses Item Objects and Dictionaries to build the tower and upgrade menus of a tower defense demo.

Do I need to write code to use Game Modules 4?

You create stats, items, conditions, quests and loot in the Game Modules Manager window without code. Connecting them to your characters takes some C#, usually a class that inherits GameModulesActor, and the bundled AI skills can help you write it.

How does saving and loading work in Game Modules 4?

Add the Save And Load prefab to your scenes, then give each object you want saved a Saveable component and a script that implements ISaveable. Saves are JSON files with support for multiple slots, loading runs automatically when a scene loads, and the in-game clock and Blackboard notes are saved for you.

Can Claude, Codex or another AI assistant set up Game Modules 4 for me?

Yes. The package includes skills for Claude Code, Codex and Cowork: run the bundled install.sh (for Codex, copy the skill folder into .agents/skills instead), then ask in plain English for stats, items, quests and more. With Unity's MCP bridge the assistant creates the assets in the open Editor; without it, it writes an editor script you run from a menu.

Does Game Modules 4 include an inventory system?

Yes. It includes an optional drag-and-drop grid inventory with stacking, item rotation and 3D model icons, for the player and for containers like chests. Characters that use it inherit GameModulesInventoryActor.

Which Unity versions does Game Modules 4 support?

Unity 6.0 or newer. The Asset Store lists Unity 6000.0.71 and 6000.5.8 as supported versions.

Does Game Modules 4 work with Magic Time or Projectile Factory?

Yes. Game Modules 4 includes integration files for Magic Time, so the in-game clock follows Magic Time's time scales. Our videos show Projectile Factory projectiles using Game Modules 4 stats to damage actors on hit.