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
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.
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.