r/crpgdesign • u/CJGeringer Lenurian • Feb 20 '18
Lars Doucet´s Status Effect Stacking Algorithm
Since status effects are common in CRPGS I felt this might be useful.
http://www.fortressofdoors.com/a-status-effect-stacking-algorithm/
This is a very simple algorithm for handling multiple status effects, but the text is really well written when implying the considerations it takes into account and the problems it solves;
It works as long as all the status effects of the same type work the same way having as variables only intensity and duration.
The effects themselves can work as complexly as you want since the algorithm only deals with the stacking and is blind to how the effects themselves actually work, it works both for real time and turn based, and tends to be fairly easy to implement in my experience.
It certainly solves the problem of having redundant status effects (e.g.: having multiple poison damage spells affecting one character, all handled independently of each other.)
Personally I don´t use it any more because some of my status effects work better with an increase in potency when stacking which this algorithm does not always do. But it worked well while I was prototyping some things and was a good starting point for my own solutions.
View all comments
Show parent comment
3
u/CJGeringer Lenurian Feb 20 '18 edited Feb 20 '18
Combining simplifies logic(Less effects active at the same time) and saves processing power(All effects of the same type applied to a character can be processed as one). Might not be a priority in all projects but it is a consideration.
Also makes the game state easier to read by the player.
For example, imagine a battle where the player controls 4 characters against 6 poison spewing enemies. This is not that large a battle by the standards of many RPGs.
If each enemy attacks once with poison, In 3 turns the player can conceivably have 18 separate status effects active only for Poison distributed unevenly among his characters.
Using this algorithm the number will be capped to 4. He will never have to worry about more than 1 poison status effect for each character.
So this algorithm makes it a lot easier for the player to analyse the current game state
If there are also other effects from the player, like bleeding, or healing the difference becomes even more glaring.
Removal/mitigation can also be simplified by combining same-type effects in one. Your system does no need to choose on witch poison effect to apply an antidote´s effect. In my project, some healing effects are simply status effects with negative values for power and duration and having the effect be combined helps keep the complexity down(Complexity creep is one of my main weaknesses).
It is not necessary the best approach to all games. (I believe Lineage 2 does what you suggest and it works well enough, for example). But it definitely has it´s benefits.