I've given this some thought and I think we can have a good compromise.
We can make a distinction between the 'primary' purpose of the unit and all the 'secondary' things that a unit can do too.
As an example, take the T2 UEF Transport. The primary purpose of the transport is to transport units. It is accompanied by two air to ground guns and two air to air guns with the following statistics:
-- air to ground
-- damage related
Damage = 3,
RateOfFire = 3,
-- performance related
TargetCheckInterval = 0.3,
AlwaysRecheckTarget = true
TargetPriorities = {
'(ALLUNITS - SPECIALLOWPRI)',
},
-- air to air
-- damage related
Damage = 12,
RateOfFire = 1,
-- performance related
TargetCheckInterval = 0.5,
TargetPriorities = {
'(ALLUNITS - SPECIALLOWPRI)',
},
We can all agree that the weapons are not impressive. We can also all agree that nobody would ever use a t2 transport for anything beyond transporting units. These weapons primarily exist for aesthetics.
Similarly, we can identify that:
- The weapons of scouts (with the Selen as exception) are secondary to the purpose of the scout
- The anti air weapons of frigates are secondary to the purpose of a frigate
- The anti air weapons of destroyers are secondary to the purpose of a destroyer
- The direct fire weapons of cruisers are secondary to the purpose of a cruiser
- The anti air weapons of any tech 3 naval vessel (with the air carriers as exception) are secondary to their purpose
- The anti air weapons on the average gunship / bomber (with the restorer as an exception) are secondary to their purpose
- The anti air weapons of the average ground experimental is secondary to their purpose
And we can find some more candidates by looking individual units.
Performance
With that we define the 'primary' weapons to be the weapons that the unit is supposed to be using, and all other weapons are 'secondary' to give the game a more aesthetical feeling.
We can immediately see the impact on a reasonable scenario. Take 100 frigates in formation with 300 hostile ASF patrolling in the center of the formation.
Current situation, game is running at about 10 - 12 ms / tick, with a sudden jump to 25 - 28 ms / tick about every second
With the suggested changes of the next chapter, game is steadily running somewhere between 8 to 10 ms / tick and there's no sudden jump
Changes
With all of that said, I'm suggesting the following changes for primary / secondary weapons:
Primary weapons
TargetCheckInterval = math.max((0.5 * (1.0 / RateOfFire)), 0.5)
AlwaysRecheckTarget = true
TargetPriorities = { something between 4 to 6 elements }
This means that primary weapons can respond to change, they can have decent target priorities and their check interval is reasonably fast in comparison to their attack speed.
One exception: the primary weapons of an experimental unit are allowed to have a lower target check interval and have additional target priorities.
Secondary weapons
TargetCheckInterval = math.max((1.0 * (1.0 / RateOfFire)), 1.0)
AlwaysRecheckTarget = false
TargetPriorities = { ALLUNITS }
This means that the secondary weapons are unable to respond to change, have a lower target check interval and they make no distinction between valid targets.
What is next
Unless I've been persuaded of anything else I will push this through into the game in about two weeks. Therefore use this topic to discuss this - what are the pros and cons? Is it worth the performance? Should we do this or not?
I also highly recommend everyone to replicate the scenario used in the performance section. You can view the sim time (ms / tick) by opening the console (using ~
hotkey) and then typing ren_ShowNetworkStats
. If it suddenly closes, type an e
first and then remove it again.