Hi everyone! Of Roots and Gears team is here!
We’re continuing to work on the game. And in the process, decided to share some notes and ideas which we discovered during development.
When work on Of Roots and Gears began, there was a huge number of variables to account for and configure. Tackling them one by one would’ve resulted in a messy set of quick fixes, while we wanted a more cohesive system.
After experimenting with our own game and analyzing other projects, we came up with the idea for a flexible RPG system architecture. It’s built around four core entities:
1. Object
Any interactive object in the game world – character, door, chest, etc.
Includes:
inventory
modifiers (more on that below)
stats (health, speed, etc.)
AI information
known actions (kind of like a “spellbook”)
2. Action
Any change in state happens through an action.
Any action has:
source (the one who’s performing the action)
target
parameters (max distance, allowed target types, etc.)
An action can be anything from a fireball to opening a door – any interaction with the game world.
Typically, it works like this: there’s an abstract Action class with specific implementations like Fireball, where the action is defined (e.g. "takes the mage’s spell power, multiplies it by 2, and deals damage").
Important note! Actions can be modified with modifiers. That’s why they’re created by Objects – so they can account for, say, a buff that increases fireball range.
Plus, this architecture allows for dynamic tooltips: distance to the target isn’t stored statically – when you hover the cursor, an instance of Fireball is created, and data is pulled from it.
3. Modifier
In gameplay terms, this is a buff or debuff.
It can:
change a character’s stats
modify created actions (e.g. the character’s code has CreateAction(), which calls OnActionCreate() for each modifier, and each modifier can change the fireball’s parameters).
Modifiers can also have callbacks that are triggered:
by taking damage
by healing
on a timer (e.g. for Damage-over-Time effects)
And so on – the list of modifiers depends on the game’s needs.
4. Item
This refers to something in an inventory – not to be confused with an Object in the game world.
It can:
modify stats (if equipped)
apply modifiers (if equipped or even just put in a bag)
have an active action (e.g. the item can be used in the game world)
Conclusion: This structure helps create a flexible and expandable system where new abilities, items, or effects can be added quickly without breaking the existing code.
P.S. We hope to share some code snippets built with this architecture in the future. For now, we hope these insights help other indie developers embarking on their own RPG journey.
To get more info about the development process, check out our blog on X:
See you soon!
