Weapon target check intervals

As an example, you mention cruisers with direct fire weapons. Sometimes I will build a Cybran cruiser for the primary purpose of using its direct fire weapon, since on some maps it's the optimal unit for taking out a firebase (although having said that I dont actually know what its default priorities are so maybe it wouldnt make much difference).

This is an example where I would not consider their direct fire a 'secondary' weapon. They actually do decent damage, they can actually take out a unit. I was thinking of the UEF / Aeon cruisers when writing this 🙂

Seraphim sub hunters would be another example where you might build them both for the AA and for the anti-sub capabilities.

Another example where it is not a 'secondary' weapon in the sense that it can actually take out a torpedo bomber.

I'd therefore suggest a stricter threshold, where the weapon must both be a secondary purpose, and also be very bad at that secondary purpose.

I agree - you phrased it better than I did.

A work of art is never finished, merely abandoned

Everything here sounds pretty good to me. I personally hate when units decide to change targets themselves and leave a unit nearly dead. Unfortunate we hit another limit of not having engine access though. That said, good job working with what you have access to Jip.

@snagglefox said in Weapon target check intervals:

Everything here sounds pretty good to me. I personally hate when units decide to change targets themselves and leave a unit nearly dead. Unfortunate we hit another limit of not having engine access though. That said, good job working with what you have access to Jip.

Me too - I'd prefer them to just fire away. But that is something to discuss with the balance team.

A work of art is never finished, merely abandoned

This post is deleted!

@jip Is it available on faf dev branch?

No - it is not.

edit: i'll make a small sim mod in this case, to allow you to reproduce the results of the performance test.

edit: here it is

ad3a2940-1d96-43a8-b5f5-e9980007b499-image.png

You can find the unit in the cheat menu:

8c079b7c-72a0-4a7a-93f7-fdba2e0f6abf-image.png

No other unit is adjusted. The unit in question also doesn't die properly. This mod is purely for making the performance comparison 🙂 .

Make sure to match the situation:

c8cf6e28-3339-4fdf-bc92-75c02ceb1fed-image.png

And restart when testing for different units.

The scenario in question:

  • 100 frigates in formation
  • 300 asf patrol in the center of the frigates (that are in formation)
  • look at sim time by using the console command ren_ShowNetworkStats

Make sure to do a full restart of the map to prevent lingering units / wrecks from impacting the results.

A work of art is never finished, merely abandoned

I'm wondering how does the advanced targeting mod impact the sim and with the retargeting intervals?

It's not part the game but it's used quite often

@brannou said in Weapon target check intervals:

I'm wondering how does the advanced targeting mod impact the sim and with the retargeting intervals?

It's not part the game but it's used quite often

Some of them are quite simple, others are terrible.

priorityTables = {
    ACU = "{categories.COMMAND}",
    Power = "{categories.ENERGYPRODUCTION * categories.STRUCTURE}",
    PD = "{categories.DEFENSE * categories.DIRECTFIRE * categories.STRUCTURE}",
    Units = "{categories.MOBILE - categories.COMMAND - categories.EXPERIMENTAL - categories.ENGINEER}",
    Shields = "{categories.SHIELD}",
    EXP = "{categories.EXPERIMENTAL}",
    Engies = "{categories.ENGINEER * categories.RECLAIMABLE}",
    Arty = "{categories.ARTILLERY}",
    Fighters = "{categories.AIR * categories.ANTIAIR - categories.EXPERIMENTAL}",
    SMD = "{categories.TECH3 * categories.STRUCTURE * categories.ANTIMISSILE}",
    Gunship = "{categories.AIR * categories.GROUNDATTACK}",
    Mex = "{categories.MASSEXTRACTION}",
    Snipe = "{categories.COMMAND, categories.STRATEGIC, categories.ANTIMISSILE * categories.TECH3, "..
        "categories.MASSEXTRACTION * categories.STRUCTURE * categories.TECH3, categories.MASSEXTRACTION * categories.STRUCTURE * categories.TECH2, "..
        "categories.ENERGYPRODUCTION * categories.STRUCTURE * categories.TECH3, categories.ENERGYPRODUCTION * categories.STRUCTURE * categories.TECH2, ".. 
        "categories.MASSFABRICATION * categories.STRUCTURE, categories.SHIELD,}",
    Naval = "{categories.MOBILE * categories.NAVAL * categories.TECH3, categories.MOBILE * categories.NAVAL * categories.TECH2, categories.MOBILE * categories.NAVAL * categories.TECH1}",
    Bships = "{categories.BATTLESHIP}",
    Destros = "{categories.DESTROYER}",
    Cruiser = "{categories.CRUISER}",
    SACU = "{categories.SUBCOMMANDER}",
    Factory = "{categories.TECH3 * categories.STRUCTURE * categories.FACTORY, categories.TECH2 * categories.STRUCTURE * categories.FACTORY, categories.TECH1 * categories.STRUCTURE * categories.FACTORY}",
},

As an example, the Snipe version is terrible. But a lot of them are quite simple, and in general better for performance. It influences the TargetPriorities property, it doesn't influence anything else.

A work of art is never finished, merely abandoned

transport anti ground weapons are for ghettos gunships and therefore have an important role

Forumpros doing balance https://www.youtube.com/watch?v=4wTcguJZh3A .
When a canis player remembers to build more than 3 units https://www.youtube.com/watch?v=7hjp8xJHuyA .

I'm not suggesting to remove them. Just to make them less responsive and significantly cheaper on the simulation.

A work of art is never finished, merely abandoned

I think for all anti-air as a secondary, you want to at least include HIGHPRIO, and then all other units in the priorities.

Otherwise you will have, say destros or battleships simply dying to scouted mercies...

If Advanced Target Priorities is still available, and would act to immediately override the defaults and prompts a target check when it is selected, then I don't see a downside to making this change for rank and file units, bring on the uber simspeed !

High priority is not used by mercys. See also this list:

It is commonly used for campaign related units and the CZAR 🙂 .

Otherwise you will have, say destros or battleships simply dying to scouted mercies...

I'd say this is fine if you choose to send in units with no proper air support. Any additional proper AA would prioritize the mercies and take them out. But we could, I suppose, have AA prioritize bombers / gunships and then everything else 🙂 . That is still quite simple and low on simulation costs.

If Advanced Target Priorities is still available

That remains available, just like Snipe mode will remain.

A work of art is never finished, merely abandoned

@jip said in Weapon target check intervals:

High priority is not used by mercys. See also this list:

It is commonly used for campaign related units and the CZAR 🙂 .

Otherwise you will have, say destros or battleships simply dying to scouted mercies...

No I mean mercies have 'HIGHPRIAIR' as one of their unit categories, not shared by any others AFAIK, and unit anti-air, even minor, has this as first priority, and mercies with their 10 hps are straight countered by it, as long as they are not just blips.

I'd say this is fine if you choose to send in units with no proper air support. Any additional proper AA would prioritize the mercies and take them out. But we could, I suppose, have AA prioritize bombers / gunships and then everything else 🙂 . That is still quite simple and low on simulation costs.

I'd say this would be a rather large balance change 🙂 so I would definitely want this added to all the secondary AA at least, over bombers or gunships

@black_wriggler said in Weapon target check intervals:

I'd say this would be a rather large balance change so I would definitely want this added to all the secondary AA at least, over bombers or gunships

Don't worry, that is what the balance team is for to make a compromise with 🙂 .

A work of art is never finished, merely abandoned

Is there a way to override the normal weapon behavior for ASF fights, like if the system detects more than 100 ASF fighting more than 100 ASF, instead of using the normal process of checking for targets and tracking each projectile individually, the system just simulates the weapons firing.

For example, if you're in a situation where this mode is turned on: pick a "Team B" ASF that is close to multiple Team A ASF that are ready to shoot (not necessarily in range, but let's say within 150% of the Team A's range). Then figure out how many shots it would take to kill that ASF. For n shots, pick n of Team A's ASFs that are ready to shoot and unload their weapon (so they have to reload before they can fire). And kill the selected ASF from Team B. Following this process would make ASF fights MUCH faster.

To avoid unfairness to the other team (if 1 team gets to shoot first) perhaps run this at the same time for both sides. So even if an ASF is selected for death, it still gets to make a simulated shot at enemy ASF.

So all ASF would essentially be on hold fire, and every so many ticks (maybe every 3 ticks) you count how many ASF for both sides are ready to shoot, and use that to kill an appropriate number of ASF from the other side. I anticipate that this would be MUCH faster than tracking every projectile individually. If the ASFs don't even fire a weapon animation, it wouldn't look so good, but it would be super fast.

That is possible, but I'm not sure if the solution would be faster. I'm also not sure if we want it to work like that - it breaks with the idea of the game.

If anything, the balance should not encourage you to mass spam ASFs. That is the only approach to prevent slow downs to such a degree.

A work of art is never finished, merely abandoned

I just have to say this is a very dangerous thing to be messing with, one of, if not the main, reasons that this rts stands far above any other for me is the fact that it is a full simulation, sacrificing parts of that for performance gain is not acceptable (yes I know it would still be a "simulation" even with this, but lesser than what it was, and how far will this continue in the name of performance?). I would rather play it at -2 during larger fights than play at +0 something that isn't it, so I hope this isn't the first in many performance improvements that are gained by sacrificing the game's soul for it.

Unresponsive and stupid units are a bigger problem to me, which it seems this will cause. Therefore I do wonder if many players consider this less of a problem because it only interferes with "automatic unit behavior" rather than "manually microed units", as I really prefer to set up what units should do ahead of time rather than to have to constantly babysit them to do it in real time (manual reclaim and dodging for example), and supreme commander's another key reason for being better than other rtss is that it has far better control over your units and automation of menial tasks.

As for solutions, considering advanced target priorities mod proves that it is possible to change target priorities of individual units on the fly, even if they had to be set up in files beforehand, is it perhaps also possible that the variables used for target check interval times can be controlled the same way as target priority lists and thus be changed mid-game for any unit, even possibly automatically? and then, automatically change depending on how many enemy units are nearby? so that way we could have both "normal" and "optimized" target check intervals at same time, used at appropriate times?

So that in case it doesn't matter, such as asf fights or some scouts flying over 100 frigates or even... 100 mantis vs 100 mantis, the units don't check their targets as often since the outcome is the same, and in cases it does matter, such as when there are few units around, they pick their targets more carefully? No I don't want to nor should need to micro them to not act stupid or not ignore enemy in front of them.

Also what effect will this have on target priorities mod? Will we be forced to have small priority lists considering players can manually control these in their files to be any size? I for one have many manual lists that some may consider weird.

We really need access to the engine...

@Mach a lot of what you're asking has been discussed and answered before. But allow me to 🙂 .

I would rather play it at -2 during larger fights than play at +0 something that isn't it, so I hope this isn't the first in many performance improvements that are gained by sacrificing the game's soul for it.

We're here to make the game better, not to make it lose its soul.

Unresponsive and stupid units are a bigger problem to me, which it seems this will cause. Therefore I do wonder if many players consider this less of a problem because it only interferes with "automatic unit behavior" rather than "manually microed units", as I really prefer to set up what units should do ahead of time rather than to have to constantly babysit them to do it in real time (manual reclaim and dodging for example), and supreme commander's another key reason for being better than other rtss is that it has far better control over your units and automation of menial tasks.

Unresponsive units sounds like bad game design. The aim is to make units responsive while keeping the values sane.

A few examples:

  • A unit that fires every one to two seconds doesn't need to check its target every 0.2 seconds, checking every 0.5 to 1.0 seconds is sufficient. Note that the tracking radius is there to help with being responsive for the first target, as that allows it to scan for targets outside its firing range.
  • By default units do not automatically recheck their targets as long as they have them. But luckily, targets tend to die quite quickly. Every time a target is lost they have to scan for new targets. The average fight is no different in practice.

For the complete criteria on units I highly recommend you to read through the Lua code:

To give some context on the changes, the statistics of the average unit in general remains about the same. Sometimes it improves quite a bit in terms of responsiveness, simply because some units were never looked at. The stats dump shows this. Note that this stats dump is dated, and is not the actual values used in-game. I do not have a more recent stats dump.

A few key changes are related to interceptors (from 0.5 target check interval to 0.3), ASF (from 0.5 target check interval to 0.4) and essentially all torpedo weapons are almost two to three times as responsive.

As for solutions, considering advanced target priorities mod proves that it is possible to change target priorities of individual units on the fly, even if they had to be set up in files beforehand, is it perhaps also possible that the variables used for target check interval times can be controlled the same way as target priority lists and thus be changed mid-game for any unit, even possibly automatically? and then, automatically change depending on how many enemy units are nearby? so that way we could have both "normal" and "optimized" target check intervals at same time, used at appropriate times?

This is not possible - these values are set in stone at the start of the game. We can only choose sane defaults.

Also what effect will this have on target priorities mod? Will we be forced to have small priority lists considering players can manually control these in their files to be any size? I for one have many manual lists that some may consider weird.

You can do with these whatever you want - just as you're doing now. We do not impact or limit the target priorities that you set via the UI.

With that said - these changes have been on FAF Develop for a few weeks now. They merged into the main branch today. As far as I can see the game feels exactly the same as it did before, but with a lot more performance under its belt.

A moderator can close this topic.

A work of art is never finished, merely abandoned

Great final post, I think everything related to the topic was being discussed.