Page 1 of 1

Regeneration timed effect doesn't merge

Posted: Tue Feb 01, 2011 7:06 am
by yufra
I assume this is a bug, and used the same merging as in poison/burning/manasurge/etc. Here is the patch: http://pastebin.com/UUMXahat

Re: Regeneration timed effect doesn't merge

Posted: Wed Feb 02, 2011 11:21 pm
by darkgod
No it aint ;)

Re: Regeneration timed effect doesn't merge

Posted: Wed Feb 02, 2011 11:50 pm
by yufra
Oh... hmm well maybe that should be made explicit? Maybe all effect tooltips should perform a simple check for the on_merge function and report their findings? I attached a small patch to do that.

Re: Regeneration timed effect doesn't merge

Posted: Wed Apr 27, 2011 7:23 pm
by tiger_eye
*bump*

Okay, so apparently regeneration effects aren't supposed to stack or merge. However, the talents "spell/nature : Regeneration" and "race/higher : Gift of the Highborn" both do regeneration effects that last 10 turns, so it becomes very noticeable that these don't stack or merge with other regeneration effects. For example, if "Gift of the Highborn" is five turns into the effect and you decide to use a regeneration infusion, then "Gift of the Highborn" will stop taking effect (making you lose out on half its healing power).

This seems unintuitive to me. Why not allow "spell/nature : Regeneration" and "race/higher : Gift of the Highborn" to stack or merge with other regeneration effects? After all, "divine/light : Providence" has a regeneration effect (which can be great at high levels) that stacks with other regeneration effects.

Let me propose one possible reasonable way to merge regeneration effects. Suppose heal1 and heal2 are the remaining amounts left to heal and dur1 and dur2 are the remaining duration of the two regeneration effects to merge, and let dur1 < dur2. Then make new_dur = dur2 + 0.5*dur1 and set the regeneration rate to (heal1 + heal2) / new_dur.

For example, if you merge two effects, heal1 = 100, dur1 = 4 (25 regen per turn); heal2 = 60, dur2 = 6 (10 regen per turn), then new_dir = 8, new_heal = 160 (20 regen per turn).

Another example, if you merge two effects, heal1 = 108, dur1 = 6 (18 regen per turn); heal2 = 72, dur2 = 6 (12 regen per turn), then new_dir = 9, new_heal = 180 (20 regen per turn).

Below is example code to do this:

Code: Select all

        on_merge = function(self, old_eff, new_eff)
                -- Merge the regeneration
                local olddam = old_eff.power * old_eff.dur
                local newdam = new_eff.power * new_eff.dur
                local dur = math.ceil(max(old_eff.dur, new_eff.dur) + 0.5*min(old_eff.dur, new_eff.dur))
                old_eff.dur = dur
                old_eff.power = (olddam + newdam) / dur
                return old_eff
        end,
Another reasonable option would be to stack regeneration effects instead of merging them, but increase the duration of each additional regeneration effect by 50%*num_regen_effects. For example, let's suppose we add a regeneration heal = 60 and dur = 4 over successive game turns. The first would would be heal=60, dur=4 (rate=15). The second one would be heal=60, dur=6 (rate=10). The third one would be heal=60, dur=8 (rate=7.5), and so on.

Hence, using either the above merge proposal or stacking proposal would allow subsequent regeneration effects to be useful, but not as useful (and not as abusable) as straight stacking would be.

Re: Regeneration timed effect doesn't merge

Posted: Fri May 06, 2011 5:15 pm
by tiger_eye
Okay, perhaps adding "heal1" and "heal2" together in my merge suggestion above is still too unbalancing. So, perhaps the smaller of heal1 and heal2 should be halved as well when merging. The new suggestion for merging two regeneration effects is as follows:

Code: Select all

if heal1 < heal2 then
  new_heal = heal2 + 0.5*heal1
else
  new_heal = heal1 + 0.5*heal2
end

if dur1 < dur2 then
  new_dur = dur2 + 0.5*dur1
else
  new_dur = dur1 + 0.5*dur2
end

new_rate = new_heal / new_dur
Using the two merge examples from previous post:

For example, if you merge two effects, heal1 = 100, dur1 = 4 (25 regen per turn); heal2 = 60, dur2 = 6 (10 regen per turn), then new_dir = 8, new_heal = 130 (16.25 regen per turn).

Another example, if you merge two effects, heal1 = 108, dur1 = 6 (18 regen per turn); heal2 = 72, dur2 = 6 (12 regen per turn), then new_dir = 9, new_heal = 144 (16 regen per turn).

Again, the reason for wanting to allow regeneration effects to merge (or stack) is that it is very unintuitive if they don't, particularly for the talents "spell/nature : Regeneration" and "race/higher : Gift of the Highborn", because they last 10 turns.

Re: Regeneration timed effect doesn't merge

Posted: Fri May 06, 2011 5:43 pm
by Canderel
would regen be too strong if they just acted independantly? As in I first activate my 6 turn 60 life regen and then 3 turns later activate the 100 life in 4 turns giving me:
1 10
2 10
3 10
4 35
5 35
6 35
7 25

Surely this is what intuitively should happen? Is this overpowered somehow?

Re: Regeneration timed effect doesn't merge

Posted: Fri May 06, 2011 6:13 pm
by Grey
Canderel wrote: Surely this is what intuitively should happen? Is this overpowered somehow?
I personally think this should be fine. The overlapping can only happen with Highers or archmages, and in fact the very existence of this replacement reduces the values of both the racial ability and the Nature spell. The easy way to let them overlap is to simply give them different names - as far as I can tell this is the only reason they replace each other.

Re: Regeneration timed effect doesn't merge

Posted: Fri May 06, 2011 7:50 pm
by yufra
Grey is right, the reason the regeneration from the two sources replace each other is because they are both EFF_REGENERATION. I personally would prefer to see a better merging of EFF_REGENERATION rather than adding additional regeneration effects. That would allow intuitive behavior for new talents/etc. rather than deciding which regeneration effects should be allowed to stack and which shouldn't be.

In regards to the form of merging... I thought somthing similar, Canderel, which is what caused the initial post in this thread. I interpreted DG's response in this thread as him saying he thought it was overpowered, but I don't have any elaboration on if and why he thinks so. The thread started back before infusion saturation (actually, might have predated infusions completely) so maybe DG can comment again?

Re: Regeneration timed effect doesn't merge

Posted: Fri May 06, 2011 8:45 pm
by Canderel
Grey wrote:The overlapping can only happen with Highers or archmages
nope... how about 2 regen infusions?

Re: Regeneration timed effect doesn't merge

Posted: Sat May 07, 2011 9:53 am
by Grey
I thought you couldn't have twyo of the same inscription active at once. Certainly you can't activate a second shied till the first wears off. Similar restrictions should apply to the rest.

With regards to stacking in general, it shouldn't be forgotten that mana restoration actually stacks muptiplicatively.

Re: Regeneration timed effect doesn't merge

Posted: Sat May 07, 2011 12:21 pm
by Canderel
But if they could merge, it would make sense that 2 regen infusions would be able to do that. Currently you can activate the 2nd, it just "overrides" the old one.