python-sc2 icon indicating copy to clipboard operation
python-sc2 copied to clipboard

Add calculated weapons data to type data so we dont have to calculate it per unit

Open tweakimp opened this issue 5 years ago • 0 comments

In unit.py we currently only take _weapons directly from the unit's type data. With _weapons, we then calculate can_attack, can_attack_air, can_attack_ground, ground_dps, air_dps, ground_range , air_range and bonus_damage for every unit (so for every single marine, not for the marine in general) in every frame we ask for these properties.

We would save a lot of calls if we calculated these one time for every unit during start and then saved this data in the unit's type data.

tweakimp avatar Mar 07 '19 20:03 tweakimp