Page 1 of 1

attack_parameters.health_penalty

Posted: Sun Jul 12, 2020 12:57 pm
by Pi-C
According to the wiki,
a higher penalty will discourage turrets from targeting units with higher health. A negative penalty will encourage turrets to target units with higher health.
Does the actual value have any significance at all? Would "health_penalty = -1" and "health_penalty = -100" have the same effect, or would a turret with "health_penalty = -100" be so much more likely to target units with more HP?

Re: attack_parameters.health_penalty

Posted: Sun Jul 12, 2020 1:57 pm
by posila
When searching for new target, turret will calculate penalty for each target and chose the one with the minimal penalty.

Code: Select all

penalty = sqr(distance_of_enemy_from_turret)
          + signed_sqr(health_penalty * enemy.health) 
          + signed_sqr(rotate_penalty * turn_distance_to_enemy)

sqr(x) = x * x
signed_sqr(x) = x * abs(x)

Re: attack_parameters.health_penalty

Posted: Sun Jul 12, 2020 2:49 pm
by Pi-C
posila wrote: Sun Jul 12, 2020 1:57 pm When searching for new target, turret will calculate penalty for each target and chose the one with the minimal penalty.
Thanks! So, with health_penalty being a constant, and rotate_penalty = 0, the numeric value of health_penalty really doesn't matter and I could just set it to "-1" if I want my long-range sniper turret to prefer distant behemoth biters with 100% health over small biters close to the turret. That's all I needed to know. :-)