Page 1 of 1
Changing the hpMax handling in prop changers IMPLEMENTED
Posted: Tue Sep 01, 2020 12:29 pm
by Stratego (dev)
@Alexander82 @Endru1241
I saw few days/weeks ago that this hpMax handling in propchangers is very not nice in code, as i see it works like
ResultinghpMax = hpMax + (hpMaxNew / 100) * hpMax
or some similar.
i think it is a very inconvenient way using it as on all other properties the property simply added to original one - not multiplying it as percentag (in this cubersome way)
so u would rather change it to be a normal property change like
ResultinghpMax = hpMax + hpMaxNew
Questions are:
Q1: an i do it or you use anywhere in any of the prop changer jsons?
Q2: do u like the idea or u have better?
Re: Changing the hpMax handling in prop changers
Posted: Tue Sep 01, 2020 1:02 pm
by Endru1241
I agree, but I have to ask:
does hpPercent property works and how?
And if not - create something as an alternative, e.g. hpMaxMod, but not with weird calc
ResultinghpMax = hpMax + (hpMaxMod/ 100) * hpMax
, but more logical
ResultinghpMax = hpMax * hpMaxMod
then reversal of the stats would be easier - ResultinghpMax = hpMax / hpMaxMod (on property effect removal).
As far as I know hpMax calculation change on propertyChangers were result of AoS balance change of two building techs: Masonry and Massive Walls.
Previously they were just adding to maxHP, but it was changed, because effect was hard to balance - values were either negligible for Castles or too strong for factories.
BTW: Masonry and Massive Walls are currently the only two using the property.
Re: Changing the hpMax handling in prop changers
Posted: Tue Sep 01, 2020 2:53 pm
by phoenixffyrnig
If these are the only two that use it the whole thing be simplified to ResultinghpMax=hpMax * 1.5.
Obviously this is no use if you intend to have other modifiers with different percentages.
Re: Changing the hpMax handling in prop changers
Posted: Tue Sep 01, 2020 3:26 pm
by Endru1241
phoenixffyrnig wrote: ↑Tue Sep 01, 2020 2:53 pm
If these are the only two that use it the whole thing be simplified to ResultinghpMax=hpMax * 1.5.
Obviously this is no use if you intend to have other modifiers with different percentages.
No.
There are reasons:
- it would be very bad practice
- other Age of probably use it too
- Masonry is actually updated to give only +34%
- I already wanted to use it on other things and will surely do in the future
Re: Changing the hpMax handling in prop changers
Posted: Tue Sep 01, 2020 4:27 pm
by makazuwr32
Yes we need in aof hp increasing techs which will give plain hp increase, not % based ones.
Re: Changing the hpMax handling in prop changers
Posted: Tue Sep 01, 2020 5:16 pm
by Midonik
I'm sure stratego remembers but I requested that for AoG.
Re: Changing the hpMax handling in prop changers
Posted: Thu Sep 10, 2020 6:44 pm
by makazuwr32
@Stratego (dev) can you make 2 health changing effects?
one will be hpPercent that will work as current one and new one (BonusHpMax for example) that will work as ResultingHpMax = CurrentHpMax + BonusHpMax?
This will make things easier to move.
Re: Changing the hpMax handling in prop changers
Posted: Thu Sep 10, 2020 6:46 pm
by Alexander82
I think we might just have 2 different properties:
1) hpmax
That would add the hp amount defined in a linear way (e.g. if you set it to 5 , the unit will get +5 maximum health points).
2) hpmaxpercent
That would work as a percentage increase (e.g. if you set it to 20, a unit with 100 hp will get +20 hpmax and a unit with 50 hp will get +10 hpmax, while a unit with 10 hp will get +2 hpmax).
Re: Changing the hpMax handling in prop changers
Posted: Thu Sep 10, 2020 6:50 pm
by Alexander82
Also this way we might set both in the same file to make the increase easyer to handle (avoiding too big or too low increases).
For example if I set hpmax to 5 it will be a big amount for a unit with 10 hp but it will also be low for a unit with 100 hp. At the same time a 10% increase would be 10 for a unit with 100 hp but just one on a unit with 10 hp.
If i could set a linear increase of +3 hp plus 7% it would be a +3 hp for a 10 hp unit and 10 hp for a 100 hp unit.
Re: Changing the hpMax handling in prop changers
Posted: Thu Sep 10, 2020 8:32 pm
by Endru1241
I think second property is needed, but I am really set on doing it as regular multiplier, so not hpmaxpercent=7, but rather hpmaxmultiplier=1.07.
To avoid weird calculation errors on reversals (e.g. when effect expires).
Those percentage stats are weird, because human mind is weird. When we see -100% we think result needs to be 0 (and thats how it was implemented), while such system has problems with reversing changes.
Re: Changing the hpMax handling in prop changers
Posted: Thu Sep 10, 2020 11:01 pm
by Alexander82
Ok, if that solves the problem is perfectly fine for me

Re: Changing the hpMax handling in prop changers
Posted: Sat Oct 03, 2020 5:53 pm
by Alexander82
@Stratego (dev)
Re: Changing the hpMax handling in prop changers
Posted: Sun Oct 25, 2020 5:47 pm
by Stratego (dev)
here i plan these changes (after today publishings)
- hpMax will mean not be percent but fixed value
- (new) hpMaxPercent will work as hpMax worked but with some better, eg as a percentage multiplier (to hpMax value) like 1.2 means + 20% in hpmax. here you can set decreasing too one too ny setting 0.8 meaning hpMax will be 80% of original.
is this plan ok?
Re: Changing the hpMax handling in prop changers
Posted: Sun Oct 25, 2020 5:58 pm
by Endru1241
I completely agree.
Re: Changing the hpMax handling in prop changers
Posted: Tue Oct 27, 2020 11:18 pm
by Alexander82
Perfect for me!
Re: Changing the hpMax handling in prop changers
Posted: Tue Nov 03, 2020 5:54 pm
by Stratego (dev)
it is impelented now.