Changing the hpMax handling in prop changers IMPLEMENTED

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: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Changing the hpMax handling in prop changers IMPLEMENTED

Post 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?
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post 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.
Age of Strategy design leader
User avatar
phoenixffyrnig
Posts: 774
Joined: Fri Nov 29, 2019 1:07 pm
Location: It changes, frequently.

Re: Changing the hpMax handling in prop changers

Post 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.
I also play an RTS game called Life 8-)
And I also like drinking beer! :D
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post 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
Age of Strategy design leader
User avatar
makazuwr32
Posts: 7830
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Changing the hpMax handling in prop changers

Post by makazuwr32 »

Yes we need in aof hp increasing techs which will give plain hp increase, not % based ones.
makazuwr32 wrote: Mon Sep 16, 2019 7:54 amWhen you ask to change something argument why...
Put some numbers, compare to what other races have and so on...
© by Makazuwr32™.
AoF Dev Co-Leader
Image
Midonik
Posts: 5325
Joined: Mon Sep 05, 2016 5:27 pm
Location: Poland

Re: Changing the hpMax handling in prop changers

Post by Midonik »

I'm sure stratego remembers but I requested that for AoG.
Support new AoS variant, Age of Galaxy: http://ageofstrategy.net/viewforum.php? ... 608408ebc8
All help will be welcome.
User avatar
makazuwr32
Posts: 7830
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Changing the hpMax handling in prop changers

Post 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.
makazuwr32 wrote: Mon Sep 16, 2019 7:54 amWhen you ask to change something argument why...
Put some numbers, compare to what other races have and so on...
© by Makazuwr32™.
AoF Dev Co-Leader
Image
User avatar
Alexander82
Posts: 7969
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post 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).
Age of Fantasy design leader
User avatar
Alexander82
Posts: 7969
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post 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.
Age of Fantasy design leader
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post 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.
Age of Strategy design leader
User avatar
Alexander82
Posts: 7969
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post by Alexander82 »

Ok, if that solves the problem is perfectly fine for me ;)
Age of Fantasy design leader
User avatar
Alexander82
Posts: 7969
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post by Alexander82 »

@Stratego (dev)
Age of Fantasy design leader
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Changing the hpMax handling in prop changers

Post 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?
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Changing the hpMax handling in prop changers

Post by Endru1241 »

I completely agree.
Age of Strategy design leader
User avatar
Alexander82
Posts: 7969
Joined: Thu Feb 26, 2015 8:18 pm

Re: Changing the hpMax handling in prop changers

Post by Alexander82 »

Perfect for me!
Age of Fantasy design leader
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Changing the hpMax handling in prop changers

Post by Stratego (dev) »

it is impelented now.
Post Reply

Return to “Modders lounge”