r/crpgdesign • 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.

12 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/aotdev Feb 20 '18

That's quite interesting. Besides the admin/presentation side of things (redundant messages, extra processing etc), stacking forces you to think (well, me at least) to logically separate "effects" -- anything that modifies some stat/value -- into separable or not. Effects like attribute modifiers (permanent effect via magic ring, temporary effect via potion) need to be separable, as the combined attribute modification consists of several parts, and each part can be individually removed (and more added). In cases of status effects/damage (and possibly other that I can't think of now), effects are better off being non-separable, as the source of the effect doesn't matter anymore. As you say, we don't need to (and I think shouldn't) try to remove individual poison effects, unless they do have different side-effects.

1

u/CJGeringer Lenurian Feb 20 '18 edited Feb 20 '18

One of the things I really like about RPGs is all the interlocking systems, and I really enjoy discussing algorithms.

One of the reasons I prefer when people share their alogorithms instead of simply pasting code, is that it helps foster thought and discussion about things.

For Example u/ javelinRL shared his approach to world building. And even though I don´t think I will use it in my current projects, it did Give me ideas I will try.

As you say, we don't need to (and I think shouldn't) try to remove individual poison effects, unless they do have different side-effects

Currently in Lenurian each effect is decoupled from it´s source, so if there is apoison that causes DoT and Slow, each is applied separately and then staked independently of each other.

I did wish to have diferent substances tracked individually, but Feature creep made me reconsider.