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?a higher penalty will discourage turrets from targeting units with higher health. A negative penalty will encourage turrets to target units with higher health.
attack_parameters.health_penalty
attack_parameters.health_penalty
According to the wiki,
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: attack_parameters.health_penalty
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
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.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.

A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!