Hitpoints calculation

The place to discuss balance changes for future versions of the game.
(Master releases & 3.X)
Post Reply
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Hitpoints calculation

Post by Per »

I was tinkering a bit with the hitpoints stats, and noticed that the calculation of the final hitpoints of a droid is pretty strange:

Code: Select all

(sum of base components except propulsion hp) * (upgraded body hp) / (base body hp) + (base body hp * base propulsion hp) / 100
Each component has separate hitpoints, but only the body hitpoints can be upgraded. However, as you can see from the above, upgrading the body hitpoints will also upgrade all the other components' hitpoints as well.

I have a patch to let you modify every component's hitpoints from scripts (and hence researches), but that would really screw with the hitpoints calculation in one way or another.

The most logical calculation IMHO would be

Code: Select all

(sum of upgraded components except propulsion hp) + (upgraded body hp * upgraded propulsion hp) / 100
but this would reduce the hitpoints of many upgraded droids by quite a lot, since some weapons/systems have a lot of hitpoints, and would remain un-upgraded.

Adding separate upgrade effects for each component to each armour upgrade would be rather nasty, as we would need to classify weapons to filter for cyborg vs droid, and then have one effect for each of the components for each upgrade. But maybe worth it?
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Hitpoints calculation

Post by Berg »

Per wrote:Adding separate upgrade effects for each component to each armour upgrade would be rather nasty, as we would need to classify weapons to filter for cyborg vs droid, and then have one effect for each of the components for each upgrade. But maybe worth it?
It would need to be like rocket attack on a borg is barely affective and this is how the upgrade should be a separate entity if you don’t research it etc.
I suggest making all components count separately!

how it goes now each weapon cyborg is attack with has different effect as it is now or should be.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Hitpoints calculation

Post by NoQ »

Code: Select all

sum of base components hp
I guess this is body + weapon without propulsion? Or does the propulsion's hitpoint multiplier that's also mentioned in the other part of the formula go here as well but additively? Or does propulsion have separate base hitpoints together with hitpoint multiplier?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Hitpoints calculation

Post by Per »

NoQ wrote:

Code: Select all

sum of base components hp
I guess this is body + weapon without propulsion? Or does the propulsion's hitpoint multiplier that's also mentioned in the other part of the formula go here as well but additively? Or does propulsion have separate base hitpoints together with hitpoint multiplier?
Propulsion is not counted in the other sums, it is just used as a % value of the body. Sorry it was not clear. Edited my original post for clarity.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Hitpoints calculation

Post by Per »

Ok, having some time to think about this, I came upon a solution that was both flexible and could reproduce the current hitpoint balance perfectly (as far as I could tell).

From code review commit in https://github.com/perim/warzone2100/co ... 2ed6290b26 :
Each component now has two base hitpoint stats, 'hitpoints' and 'hitpoint percentage'. The latter increases the hitpoints of the whole droid. Each can be upgraded through the scripts. The old "body points" has been renamed to "hitpoints" throughout the stats code, to match JSON stats.

Propulsions also have a new 'hitpoint percentage of body' stat, to emulate the current strange calculation, where propulsions are a percentage of the body hitpoints, without preventing scripts from setting hitpoints directly.

Tiny balance change: The brain component can be upgraded to increase hitpoints from this component by 20%. This is mostly an example of how the new system can be used - commanders are still useless.
The new hitpoint calculation is then as follows:

Code: Select all

((sum of upgraded components hp) + (upgraded body hp * upgraded propulsion hp_pct_of_body) / 100) * (sum of upgraded components hp_pct) / 100
where "(sum of upgraded components hp_pct)" actually is "(100 + sum of (upgraded components hp_pct - 100))" and hp_pct is 100% by default (meaning no change to sum total).
Post Reply