Does this target prioritization looks OK??

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
fireanddream
Posts: 247
Joined: Sun, 13. Dec 15, 08:15
xr

Does this target prioritization looks OK??

Post by fireanddream » Fri, 2. Feb 18, 04:34

I'm trying to make scripts to polish the vanilla fighting AI. Starting from targeting.

The algorithm takes into account:
[THIS]fire power defined by laser cap.
[TARGET]current hull, current shield, speed, steering, and fire power defined by class.

First we have a bunch of ships. Assume all are within weapon range.

Valkyrie (max shield, max hull)
Valkyrie, 20% shield
Valkyrie, 0% shield, 10% hull
Elite
Elite, 20% shield
Elite, 0% shield, 10% hull
LX
LX, 20% shield
LX, 0% shield, 10% hull
Dragon
Dragon, 20% shield
Dragon, 0% shield, 10% hull
Heavy Centaur
Heavy Centaur, 20% shield
Heavy Centaur, 0% shield, 10% hull
Cerberus
Cerberus, 20% shield
Cerberus, 0% shield, 10% hull
Odysseus
Odysseus, 20% shield
Odysseus, 0% shield, 10% hull
I
I, 20% shield
I, 0% shield, 10% hull


For a LX, the target priorities look like this:
Odysseus, 0% shield, 10% hull
I, 0% shield, 10% hull
Cerberus, 0% shield, 10% hull
Heavy Centaur, 0% shield, 10% hull
Dragon, 0% shield, 10% hull
LX, 0% shield, 10% hull
Elite, 0% shield, 10% hull
Heavy Centaur, 20% shield
Elite, 20% shield
Valkyrie, 0% shield, 10% hull
Dragon, 20% shield
Valkyrie, 20% shield
Elite
Cerberus, 20% shield
Valkyrie
LX, 20% shield
Heavy Centaur
Dragon
LX
Cerberus
Odysseus, 20% shield
Odysseus
I, 20% shield
I

For a PX:
Odysseus, 0% shield, 10% hull
I, 0% shield, 10% hull
Cerberus, 0% shield, 10% hull
Heavy Centaur, 0% shield, 10% hull
Dragon, 0% shield, 10% hull
Cerberus, 20% shield
Odysseus, 20% shield
LX, 0% shield, 10% hull
Heavy Centaur, 20% shield
Elite, 0% shield, 10% hull
Dragon, 20% shield
Elite, 20% shield
Valkyrie, 0% shield, 10% hull
Heavy Centaur
Dragon
Elite
Valkyrie, 20% shield
LX, 20% shield
Valkyrie
LX
Odysseus
Cerberus
I, 20% shield
I

For a Q:
Odysseus, 0% shield, 10% hull
I, 0% shield, 10% hull
Odysseus, 20% shield
Odysseus
I, 20% shield
I
Cerberus, 0% shield, 10% hull
Cerberus, 20% shield
Cerberus
Heavy Centaur, 0% shield, 10% hull
Dragon, 0% shield, 10% hull
Heavy Centaur, 20% shield
Dragon, 20% shield
Heavy Centaur
Dragon
LX, 0% shield, 10% hull
Elite, 0% shield, 10% hull
LX, 20% shield
Elite, 20% shield
Valkyrie, 0% shield, 10% hull
Elite
Valkyrie, 20% shield
LX
Valkyrie

For a K:
Odysseus, 0% shield, 10% hull
I, 0% shield, 10% hull
Odysseus, 20% shield
Odysseus
I, 20% shield
I
Cerberus, 0% shield, 10% hull
Cerberus, 20% shield
Cerberus
Heavy Centaur, 0% shield, 10% hull
Dragon, 0% shield, 10% hull
Heavy Centaur, 20% shield
Dragon, 20% shield
Heavy Centaur
Dragon
LX, 0% shield, 10% hull
LX, 20% shield
LX
Elite, 0% shield, 10% hull
Elite, 20% shield
Elite
Valkyrie, 0% shield, 10% hull
Valkyrie, 20% shield
Valkyrie

For an I:
Odysseus, 0% shield, 10% hull
I, 0% shield, 10% hull
Odysseus, 20% shield
Odysseus
I, 20% shield
I
Cerberus, 0% shield, 10% hull
Cerberus, 20% shield
Cerberus
Heavy Centaur, 0% shield, 10% hull
Dragon, 0% shield, 10% hull
Heavy Centaur, 20% shield
Dragon, 20% shield
Heavy Centaur
Dragon
LX, 0% shield, 10% hull
LX, 20% shield
LX
Elite, 0% shield, 10% hull
Elite, 20% shield
Elite
Valkyrie, 0% shield, 10% hull
Valkyrie, 20% shield
Valkyrie

Sorry for the wall of text. Anything out of place?
I noticed M6s and M7s prioritizing fully shielded M2s over 10% hull M7s, do you think it's justified?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 21106
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Fri, 2. Feb 18, 13:08

If all ships are within firing range I would expect the LX to focus first on the fighter ships and not on the capital ships. Even if an I or an Odysseus is a target hard to miss, bringing down 10% of the hull will take some time, during which the LX may have destroyed several of the smaller ships already. Especially as with increased hull damage they become slower, thus are easier to shoot at. Likewise with the PX ship. I would expect it to first attack ships of its own class (M6/M7), obviously starting with those with shield/hull damage. After that it can move on to other ships. In this regard, I'm not even sure if the PX has to care about fighter ships (esp. M5 and M4 ones) at all. The turrets of the PX should be powerful enough to destroy these small ships on their own. M3 ships may be a different story though.
Besteht Interesse an einem Nopileos-Hörbuch?

Farnhams Legende und Nopileos als E-Books!

"People who think they know everything are a great annoyance to those of us who do." - Isaac Asimov

"If it's not impossible, there must be a way to do it." - Sir Nicholas Winton

User avatar
Killjaeden
Posts: 5035
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Fri, 2. Feb 18, 14:04

I noticed M6s and M7s prioritizing fully shielded M2s over 10% hull M7s, do you think it's justified?
Obviously not.

But % is not everything. You need to consider the absolute values as well. 10% hull can mean several passes or just one shot for front weapons and firing time for turrets, all depending on the object.

The focus should be on "who can i take out in the fewest amounts of attack passes". If i can choose between taking out a heavy centaur in one pass, or a Nova in one pass, i will take the heavy centaur out first, because it is more powerfull. If the heavy centaur has less % left compared to a nova, but requires >5 passes to take out i propably would focus on the nova instead, because i can reduce considerable amount of hostile firepower by much less work.

Its also worth keeping in mind effective firepower... Firepower on paper is worlds apart from effective firepower in combat. M6 are extremely bad in bringing their main weapons to bear against fighters. They are constantly outmaneuvered and can't line up for an attack run properly. M6+ have the same problem - they are only dangerous because of their increased number of turret weapons.

And lastly laser battery - if my batteries are empty i can't count on beeing able to make consecutive passes on a target with the same effectiveness as on the first pass. If my batteries are empty i'm not going to try and take out a target that has higher shield reload rate than what damage my lasergenerator can recover in the same time frame - unless there are no other targets, or i have allies fighting with me.

So to provide true "intelligent" target selection based on just stats is a little more involved. The even more tricky part would be intelligent target selection based on positions. I'm not going to choose a target with 60% overall health, compared to a target with 80% over all health that floats right in front of my crosshair, if they can be taken out fairly quickly (e.g. fighter vs fighter).

I think it makes sense to prioritize fire on classes that are of equal class, one above and one below. Everything higher is propably too much to handle in short time, and everything lower not a big threat (alone) and also too difficult to attack effectively with frontal weapons because of too low maneuverability.

I would start rating targets based on remaining "health points" - hull and shield together. A seperate rating list with "effectiveness to engage" based on comparing ship classes. And a rating list with "firepower" that can be roughly guesstimated by counting installed laser amount and ship laser regen. Then combine that to filter out the most promising 'candidates'.
Image
XTC Mod Team Veteran. My current work:
Image

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”