Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Priorities are not standardized among unit types #5919

Open
apollodeathstar opened this issue Feb 19, 2024 · 13 comments
Open

Target Priorities are not standardized among unit types #5919

apollodeathstar opened this issue Feb 19, 2024 · 13 comments
Labels
feature: target priorities related to the target priorities of weapons

Comments

@apollodeathstar
Copy link
Contributor

Describe the bug
Target Priorities are not standardized among unit types, possibly leading to either performance issues or less then optimal unit actions, effecting balance.

Expected behavior
Units that share unit types have standardized targeting behavior at similar performance costs.

Additional context
Under guidance, I would attempt to standardize unit target priorities across unit types.

This bug report will be read by people that have not experienced the bug themselves - this report is all they have to investigate. The more precise your report, the easier it becomes for us to help you.

@apollodeathstar
Copy link
Contributor Author

I also think it may be good to add a new target priority category specifically for T1-3 interceptors/ASF then def Air units will be able to focus their defense on their biggest threats the ASF trying to kill them.

The same category could be added to interceptors/ASF so that they focus other ASF's first but that may have to be checked for performance due to the very large numbers that get amassed in games.

I don't know if there has been much meta play regarding using T1 scouts etc in order to cheese/spoof enemy ASF balls but it is something to think about as a player behind on ASF numbers could tech pump out a bunch of scouts in order to make up for lack of ASF numbers in a fight to have enemy ASF waste salvos and win the fight. It is something to consider though.

This may only be a issue in late game ASF vs ASF engagements so even just adding a category for ASF may be enough to ward off such an issue.

@Garanas
Copy link
Member

Garanas commented Feb 20, 2024

I fully agree that we should try to create default target priorities that just make more sense. There's a lot of junk in the blueprints at this moment. My suggestion would be to start with air units and air interactions.

There's a couple of things to take into account:

  • (1) The more target priorities a weapon has the larger a chunk of the simulation budget it consumes.
  • (2) There are primary weapons and secondary weapons on various units. Primary weapons is what the unit is designed for (e.g., the strategic bomb of the Ambassador). Secondary weapons are usually irrelevant but they look and feel nice (e.g., the anti air of the Ambassador).
  • (3) The more target priorities a weapon has the more time a weapon can spent on aligning the weapon over just firing at whatever is in front of it. An example here is the laser of the Monkeylord:
TargetPriorities = {
    "EXPERIMENTAL",
    "SUBCOMMANDER",
    "TECH3 MOBILE",
    "TECH2 MOBILE",
    "TECH1 MOBILE",
    "(STRUCTURE * DEFENSE - ANTIMISSILE)",
    "ALLUNITS",
},

Imagine the following scenario where red units are tech 3, blue units are tech 2 and the green unit is the Monkeylord:

image

Because tech 3 units (red) are favored over tech 2 units (blue) the monkey lord will spent a lot of time rotating it's main weapon to go from the tech 3 unit at the bottom to the tech 3 unit at the top. Repeat the scenario when tech 3 units trickly in occasionally and the tech 2 army is essentially invulnerable with these target priorities. In my humble opinion they should instead be:

TargetPriorities = {
    "EXPERIMENTAL",
    "SUBCOMMANDER",
    "ALLUNITS",
},

Experimentals and support commanders usually take 10 or more seconds to take out, therefore it's fine to spent several seconds rotating the main weapon. Anything else is destroyed in 2 or less seconds (usually less) and it's not worth constantly rotating the main weapon for that.

  • (4) Categories matter less as the unit becomes less and less significant.

To give a short roadmap, what if we start with brainstorming what the categories should be for certain unit types. For air we have the following unit types:

  • Anti air weapons (t1/t2/t3)
  • Bomb(er) weapons (t1/t2/t3)
  • Ground attack weapons (t1/t2/t3)

That way we can discuss the consequences of our choices before spending time to implement them across all four factions.

@Garanas Garanas added the feature: target priorities related to the target priorities of weapons label Feb 20, 2024
@apollodeathstar
Copy link
Contributor Author

I agree that's the best way to go about it. splitting it into manageable categories will make it easier to submit and track and air units are a good place to start because it will be simpler then more complex interactions.

Is there a targetpriorities list somewhere that has the full list of possible targets? If not that is probably the first thing I can work on gathering from the various unit files.

@Garanas
Copy link
Member

Garanas commented Feb 20, 2024

Target priorities are just (combined) categories. One could consider this to be a list:

But in general for air units GROUNDATTACK means it is a gunship, BOMBER means it is a bomber, TRANSPORTATION means it is a transport and ANTIAIR means it shoots the previous three categories 😃

@Garanas
Copy link
Member

Garanas commented Feb 20, 2024

I also think it may be good to add a new target priority category specifically for T1-3 interceptors/ASF then def Air units will be able to focus their defense on their biggest threats the ASF trying to kill them.

This would be the ANTIAIR category

@apollodeathstar
Copy link
Contributor Author

I also think it may be good to add a new target priority category specifically for T1-3 interceptors/ASF then def Air units will be able to focus their defense on their biggest threats the ASF trying to kill them.

This would be the ANTIAIR category

ANTIAIR covers all units capable of any sort of antiair fire from a tech 1 MAA to a broadsword with its secondary back mounted aa guns. I checked the wasp t3 uef asf and it did have in its categories ASF designation. I dunno if they all do so that's something I will have to check as well.

Categories = {
        "AIR",
        "ANTIAIR",
        "ASF",
        "BUILTBYTIER3FACTORY",
        "HIGHALTAIR",
        "MOBILE",
        "OVERLAYANTIAIR",
        "PRODUCTSC1",
        "RECLAIMABLE",
        "SELECTABLE",
        "TECH3",
        "UEF",
        "VISIBLETORECON",
    }

@Garanas
Copy link
Member

Garanas commented Feb 21, 2024

ANTIAIR covers all units capable of any sort of antiair fire from a tech 1 MAA to a broadsword with its secondary back mounted aa guns. I checked the wasp t3 uef asf and it did have in its categories ASF designation. I dunno if they all do so that's something I will have to check as well.

Units that are not designated as anti air but do have anti air weaponry should have the WEAKANTIAIR category, and not the ANTIAIR category.

Note that between layers (ground to air, air to air) is irrelevant because the weapon is limited by layer by default (that is unrelated to categories).

@apollodeathstar
Copy link
Contributor Author

ANTIAIR covers all units capable of any sort of antiair fire from a tech 1 MAA to a broadsword with its secondary back mounted aa guns. I checked the wasp t3 uef asf and it did have in its categories ASF designation. I dunno if they all do so that's something I will have to check as well.

Units that are not designated as anti air but do have anti air weaponry should have the WEAKANTIAIR category, and not the ANTIAIR category.

Note that between layers (ground to air, air to air) is irrelevant because the weapon is limited by layer by default (that is unrelated to categories).

Makes sense when I am going through thru the units I will check the categories to make sure they are properly set for the unit.

@apollodeathstar
Copy link
Contributor Author

ANTIAIR covers all units capable of any sort of antiair fire from a tech 1 MAA to a broadsword with its secondary back mounted aa guns. I checked the wasp t3 uef asf and it did have in its categories ASF designation. I dunno if they all do so that's something I will have to check as well.

Units that are not designated as anti air but do have anti air weaponry should have the WEAKANTIAIR category, and not the ANTIAIR category.

Note that between layers (ground to air, air to air) is irrelevant because the weapon is limited by layer by default (that is unrelated to categories).

I looked thru the code for a WEAKANTIAIR Category but I turned up no results. I was able to find a calculator

-- Pre-compute weak secondary weapons and weapon overlays

that mentions pre compute of weak weapons but I dont know if thats what you mean.

I did find WEAKDIRECTFIRE that was in 3 units but could not find a direct use of WEAKANTIAIR. sending this message to make sure there is not some code that is adding that in later after some sort of secondary weapon calculation and adding that tag to the unit or something.

If not is changing + adding to categories doable. it was mentioned this might mess with AI so I wanted to double check.

@Garanas
Copy link
Member

Garanas commented Feb 22, 2024

WEAKANTIAIR is added programmatically at the moment. It was only introduced recently to help AIs understand what units are worth building when you're looking for an anti air (or direct fire, etc) unit.

edit: what I'm trying to say is that it still involves some work to update the blueprints 😃 , I can tackle the UEF units this weekend.

@apollodeathstar
Copy link
Contributor Author

WEAKANTIAIR is added programmatically at the moment. It was only introduced recently to help AIs understand what units are worth building when you're looking for an anti air (or direct fire, etc) unit.

edit: what I'm trying to say is that it still involves some work to update the blueprints 😃 , I can tackle the UEF units this weekend.

That sounds good! then I will have your work to go off of and I can jump in and start helping after.

@apollodeathstar
Copy link
Contributor Author

#5969 #5968 #5967 #5964 #5965

@Ejsstiil
Copy link
Member

Ejsstiil commented Apr 1, 2024

WEAKANTIAIR is added programmatically at the moment. It was only introduced recently to help AIs understand what units are worth building when you're looking for an anti air (or direct fire, etc) unit.

edit: what I'm trying to say is that it still involves some work to update the blueprints 😃 , I can tackle the UEF units this weekend.

Hi @Garanas, this is the real world example how bad is any postprocessing done to the blueprints, as mentioned here: #5701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: target priorities related to the target priorities of weapons
Projects
None yet
Development

No branches or pull requests

3 participants