View Issue Details

IDProjectCategoryView StatusLast Update
0002394Spring engineGeneralpublic2011-06-18 15:09
ReporterGoogle_Frog Assigned ToKloot  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
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

Relationships

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

Activities

SirMaverick

2011-04-02 19:49

reporter   ~0006525

> 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

hoijui

2011-04-03 10:28

reporter   ~0006527

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

Google_Frog

2011-04-03 14:13

reporter   ~0006528

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.

hoijui

2011-04-05 17:00

reporter   ~0006535

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

Google_Frog

2011-04-07 09:09

reporter   ~0006538

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

hoijui

2011-04-07 10:59

reporter   ~0006540

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

Google_Frog

2011-04-09 05:11

reporter   ~0006545

I just did earlier.

SirMaverick

2011-04-09 12:44

reporter   ~0006546

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

As I understand it, both commits are needed.

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