Regeneration timed effect doesn't merge

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Regeneration timed effect doesn't merge

#1 Post 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
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Regeneration timed effect doesn't merge

#2 Post by darkgod »

No it aint ;)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Regeneration timed effect doesn't merge

#3 Post 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.
Attachments
merge_tooltip.txt
(602 Bytes) Downloaded 118 times
<DarkGod> lets say it's intended

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Regeneration timed effect doesn't merge

#4 Post 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.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Regeneration timed effect doesn't merge

#5 Post 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.

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: Regeneration timed effect doesn't merge

#6 Post 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?

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Regeneration timed effect doesn't merge

#7 Post 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.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Regeneration timed effect doesn't merge

#8 Post 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?
<DarkGod> lets say it's intended

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: Regeneration timed effect doesn't merge

#9 Post by Canderel »

Grey wrote:The overlapping can only happen with Highers or archmages
nope... how about 2 regen infusions?

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Regeneration timed effect doesn't merge

#10 Post 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.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: Regeneration timed effect doesn't merge

#11 Post 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.

Post Reply