Determining effect order

Started by
11 comments, last by DrEvil 10 years, 8 months ago

I would probably simplify the effects so that you can put together discreet stages of effect modifications where the order doesn't matter, ie so the math is communative and easy to understand, sort of a series of accumulations and applications in stages. The key I think is a sensible ordering of the calculations with an ordering that makes sense to the player.

For example.

  1. Take input list of effects, such as list of damage types
  2. Transform effect types to other effects so they will be treated as though they are the transformed effect
  3. Accumulate all damage together, keeping them separated by type still(fire, arcane, magic, physical, etc), you can also accumulate healing effects as well during this loop.
  4. Apply healing modification effects to healing values.
  5. Apply total healing to the character so that the healing comes before the damage to offset the damage if you so desire. Alternately you could split healing effects into pre-heal and post-heal to modify this order for certain cases, or treat post heals as tiny delay/duration regeneration.
  6. With the accumulated damage per type, apply damage modifiers that apply to each type, (fire resistance will reduce the fire damage only, etc)
  7. Accumulate damage modifiers together and apply them to the characters health.

If I were building an effect heavy system I would probably treat everything as an effect that goes through this pipeline. It wouldn't be just the spell effects that go through this, but also the protection levels of armor would be represented as an effect on the list.

Start with something simple and easy to follow and worry about the complex order issues when you actually run into a problem creating an effect that maybe you can't with this. At that point it will be easier to understand what and where you have to plug in some new 'features' to get what you need.

Advertisement

I would probably simplify the effects so that you can put together discreet stages of effect modifications where the order doesn't matter, ie so the math is communative and easy to understand, sort of a series of accumulations and applications in stages. The key I think is a sensible ordering of the calculations with an ordering that makes sense to the player.


I definitely plan on breaking the effects down to simple parts. We had even planned to apply all the simple number calculations as (base+flat)*multiplier so it wouldn't matter what order those simpler effects were applied in.

Start with something simple and easy to follow and worry about the complex order issues when you actually run into a problem creating an effect that maybe you can't with this.


I think I might just do that. We don't have a concrete list of things we actually want to do for now, and the ones we have thought of won't have much issue with the order. I just worry about ending up with a bunch of hacky fixes later to get some effects to work. I'm also trying to keep mods in mind and not design something that's too restrictive.

That's cool.

You're kind of thinking like I do quite often. I often have a vague idea that something is going to be a problem in the future but have a difficult time thinking of a real world example of just how it would manifiest. I usually try to get another set of eyes or two and talk it through them, and maybe blueprint out the near term use cases and see if those would be covered and if I still haven't come up with a concrete problem case I have to force myself into just moving ahead and worrying about the problem when I actually run into it. Often I never do so it's fine. At the base level it seems like a simple matter of a hierarchy of effect applications that may do you fine. At worst if you do run into an order of operations issue hopefully it would be easy to alter its effect a bit or split it into multiple effects in order to get the desired outcome but within the framework of the simplified calculation pipeline.

Good luck!

This topic is closed to new replies.

Advertisement