Changing the hpMax handling in prop changers

Follow this forum if u are a modder (having the modded version)
Contains announcements and how-to guides
Useful for forumers who want to learn how to help out in the game
Post Reply
Stratego (dev)
Site Admin
Posts: 10947
Joined: Fri Apr 25, 2014 9:28 pm

Changing the hpMax handling in prop changers

Post by Stratego (dev) » Tue Sep 01, 2020 12:29 pm

@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?

User avatar
Endru1241
Posts: 1102
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post by Endru1241 » Tue Sep 01, 2020 1:02 pm

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.
Age of Strategy design leader

phoenixffyrnig
Posts: 248
Joined: Fri Nov 29, 2019 1:07 pm
Location: It changes, frequently.

Re: Changing the hpMax handling in prop changers

Post by phoenixffyrnig » 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.
I also play an RTS game called Life 8-)
And I also like drinking beer! :D

User avatar
Endru1241
Posts: 1102
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post by Endru1241 » Tue Sep 01, 2020 3:26 pm

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
Age of Strategy design leader

User avatar
makazuwr32
Posts: 5066
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Changing the hpMax handling in prop changers

Post by makazuwr32 » Tue Sep 01, 2020 4:27 pm

Yes we need in aof hp increasing techs which will give plain hp increase, not % based ones.

Midonik
Posts: 3847
Joined: Mon Sep 05, 2016 5:27 pm
Location: Poland

Re: Changing the hpMax handling in prop changers

Post by Midonik » Tue Sep 01, 2020 5:16 pm

I'm sure stratego remembers but I requested that for AoG.
Support new AoS variant, Age of Galaxy: http://www.androidutils.com/forum/viewforum.php?f=135
All help will be welcome.

User avatar
makazuwr32
Posts: 5066
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Changing the hpMax handling in prop changers

Post by makazuwr32 » Thu Sep 10, 2020 6:44 pm

@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.

User avatar
Alexander82
Posts: 7775
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post by Alexander82 » Thu Sep 10, 2020 6:46 pm

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).
Age of Fantasy design leader

User avatar
Alexander82
Posts: 7775
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post by Alexander82 » Thu Sep 10, 2020 6:50 pm

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.
Age of Fantasy design leader

User avatar
Endru1241
Posts: 1102
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post by Endru1241 » Thu Sep 10, 2020 8:32 pm

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.
Age of Strategy design leader

User avatar
Alexander82
Posts: 7775
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post by Alexander82 » Thu Sep 10, 2020 11:01 pm

Ok, if that solves the problem is perfectly fine for me ;)
Age of Fantasy design leader

Post Reply

Return to “Modders lounge”