2025-07-22 04:06 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002394Spring engineGeneralpublic2011-06-18 15:09
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version0.82.7.1 
Target Version83.0Fixed in Version0.82.7+git 
Summary0002394: Paralysis degrading is wrong for health dependant paralysis
DescriptionParalysis that is dependant on current health does not behave properly. It should be identical to max health paralysis with max health replaced with current health.

With this bug paralysis for damaged units heals faster than it should. This is due to the line "paralyzeDamage -= maxHealth * 0.5f * CUnit::empDecline;" in rts/Sim/Units/Unit.cpp SlowUpdate failing to use health if paralysis should be based on health.

When fixing this maxParaDamage in DoDamage will have to be modified to take the lowered paralysis degradation into account.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
related to 0002401closed EMP that is dependant on health which does not increase para timer when damaged. 
+Relationships

-Notes

~0006525

SirMaverick (reporter)

> It should be identical to max health paralysis with max health replaced with current health.
Just forgot that in old patch (0001754).

Fixed SlowUpdate. Not sure about the second part.

https://github.com/1231e7b84a5de93a/spring/commits/t2394

~0006527

hoijui (reporter)

i also feel like the change in DoDamage is not needed (or wrong this way). please explain, Google_Frog (or give code, if possible ;-) ).

~0006528

Google_Frog (reporter)

Up until recently DoDamage paralysis limit was this: (reduced to non-max health case for readability)
maxParaDmg = health + maxHealth * empDecline * paralyzeTime - paralyzeDamage;

maxHealth * empDecline is the rate of paralysis damage healing. Multiply this by paralyzeTime and you have the paralysis damage that leaves this unit fully paralysed for duration paralyzeTime.

The new fixed code for paralysis gradual healing is:
paralyzeDamage -= health * 0.5f * empDecline;

As the paralyzeDamage healing is lower for low health maxParaDmg should be lower as paralysis is now reduced at a lower rate when on low health. So maxHealth * empDecline * paralyzeTime should be health * empDecline * paralyzeTime. It is already fixed in the commit after SirMaverick's recent paralysis decline fix.

~0006535

hoijui (reporter)

ok, so i just put the first commit of sirmav in, and its all fine, right?
this one:
https://github.com/1231e7b84a5de93a/spring/commit/5165fb4fc45e674b39e152719bf925e917277ada

~0006538

Google_Frog (reporter)

And the second one? Anyway you can test this to see if the second is needed, I strongly suspect it is.

~0006540

hoijui (reporter)

i am not going to test stuff. come to an understanding and tell me what to do.

~0006545

Google_Frog (reporter)

I just did earlier.

~0006546

SirMaverick (reporter)

> It is already fixed in the commit after SirMaverick's recent paralysis decline fix.

As I understand it, both commits are needed.
+Notes

-Issue History
Date Modified Username Field Change
2011-04-02 06:20 Google_Frog New Issue
2011-04-02 19:49 SirMaverick Note Added: 0006525
2011-04-03 10:28 hoijui Note Added: 0006527
2011-04-03 14:13 Google_Frog Note Added: 0006528
2011-04-05 17:00 hoijui Note Added: 0006535
2011-04-07 09:09 Google_Frog Note Added: 0006538
2011-04-07 10:59 hoijui Note Added: 0006540
2011-04-09 05:11 Google_Frog Note Added: 0006545
2011-04-09 12:44 SirMaverick Note Added: 0006546
2011-06-10 16:46 hoijui Target Version => 0.83.0
2011-06-10 16:46 hoijui Relationship added related to 0002401
2011-06-18 15:09 Kloot Status new => resolved
2011-06-18 15:09 Kloot Fixed in Version => 0.82.7+git
2011-06-18 15:09 Kloot Resolution open => fixed
2011-06-18 15:09 Kloot Assigned To => Kloot
+Issue History