Author Topic: AI Weapon targeting selection?  (Read 1786 times)

0 Members and 1 Guest are viewing this topic.

Offline brandx0

  • 210
  • The Angriest Angel.
    • Fate of the Galaxy: The Star Wars Conversion for Freespace
AI Weapon targeting selection?
Is there any way at all to force the AI to use certain weapons against certain classes of object?  Obviously it has a preference, but for example, telling it not to use flak guns against a capital ship, or large beams against fighters (or for that matter, using large beams against fighters)

Basically it's not a requirement for a project of mine, but would certainly help me out a lot, some sort of flag or something that could force the AI to only fire certain weapons at certain types of enemy.
Former Senior Modeler, Texturer and Content Moderator (retired), Fate of the Galaxy
"I love your wrong proportions--too long, no, wait, too short
I love you with a highly symbolic torpedo up the exhaust port"
-swashmebuckle's ode to the transport

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: AI Weapon targeting selection?
Well... weapons do have several such flags available... From http://www.hard-light.net/wiki/index.php/Weapons.tbl

"small_only"
Forces AI to use weapon only against small targets (such as fighters and bombers).

"Huge"
Forces AI not to use weapon against small targets like fighters and bombers and can further be extented to not to target bombs - with ai profiles table.

Also "Bomber+"
Which can be used with "Huge" flag to allow the AI to fire the weapon against bombers but not at fighters.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Shade

  • 211
Re: AI Weapon targeting selection?
In addition to those, there are two SEXPs for mission designers to set the targeting priority of turrets (such as bombs->ships->asteroids, for example): ship-turret-target-order and turret-set-target-order, where the first is for all turrets on a ship and the second for individual turrets.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline brandx0

  • 210
  • The Angriest Angel.
    • Fate of the Galaxy: The Star Wars Conversion for Freespace
Re: AI Weapon targeting selection?
Oh, thanks.  I'd never seen small only, and I thought that huge was the counterpart to big damage for ships.
Former Senior Modeler, Texturer and Content Moderator (retired), Fate of the Galaxy
"I love your wrong proportions--too long, no, wait, too short
I love you with a highly symbolic torpedo up the exhaust port"
-swashmebuckle's ode to the transport

 

Offline Raptor

  • 210
Re: AI Weapon targeting selection?
Also "Bomber+"
Which can be used with "Huge" flag to allow the AI to fire the weapon against bombers but not at fighters.

So If a weapon has both 'huge' and 'bomber+', it will shoot at bombers and above but not fighters?

I've been using 'bomber+' on its own, and the weapons still fire at fighters...
...There ought to be something surreal about a Zoid offering romantic advice...and yet there is not. It seems perfectly normal that the Liger is giving Bit advice on relationships, and it shouldn't, but it does. Dangit man, you've confused me again.[/I]
NGTM-R review of one of the chapters in my fanfic story :D Story is here! -> 'Ancient Legacies'

 
Re: AI Weapon targeting selection?
I'd like to see huge weapons that can target fighters when no other large ships are in target range.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline brandx0

  • 210
  • The Angriest Angel.
    • Fate of the Galaxy: The Star Wars Conversion for Freespace
Re: AI Weapon targeting selection?
An extrapolation of this idea: Anti-missile systems?

First off, if we could define the bomb flag to not only have it be destroyable by weapons fire, but also be able to toggle whether the AI prefers it to use on large ships or not.  Then, one could hypothetically make all missiles in the game with the bomb flag, minus the preference for anti-ship use.  After that, one could expand the flags option on primaries to make a weapon only shoot at these bombs (or not, if desired) and put it on a turret and voila, anti-missile/phalanx system.
Former Senior Modeler, Texturer and Content Moderator (retired), Fate of the Galaxy
"I love your wrong proportions--too long, no, wait, too short
I love you with a highly symbolic torpedo up the exhaust port"
-swashmebuckle's ode to the transport

 

Offline Raptor

  • 210
Re: AI Weapon targeting selection?
An extrapolation of this idea: Anti-missile systems?

First off, if we could define the bomb flag to not only have it be destroyable by weapons fire, but also be able to toggle whether the AI prefers it to use on large ships or not.  Then, one could hypothetically make all missiles in the game with the bomb flag, minus the preference for anti-ship use.  After that, one could expand the flags option on primaries to make a weapon only shoot at these bombs (or not, if desired) and put it on a turret and voila, anti-missile/phalanx system.

There's been some discussion about this topic in the SCP Forum.  But in my experiance the Coders are not going to do anything with the Turret sections of code.  'Very messy' according to them. :sigh:

By default, whenever a bomb is launched, all the turrets on a ship target it, even those that can't actually see it :wtf:  Thus one bomb is fired, and the ship becomes completely focused on shooting it down, regardless of all other considerations (I've seen it happen many a time :rolleyes:)

There are work arounds, the best at the moment is the use of the 'SEXPs' Shade posted before, though it does mean you have to add them in to every mission for every capship :nervous:

You can get huge weapons to not shoot at bombs by default (which makes sense... the weapon can't target a fighter, so it never could tag a bomb) with the use of a new .tbl file the SCPers came up with.  But getting one is nigh on impossible (I've tried and failed :()
...There ought to be something surreal about a Zoid offering romantic advice...and yet there is not. It seems perfectly normal that the Liger is giving Bit advice on relationships, and it shouldn't, but it does. Dangit man, you've confused me again.[/I]
NGTM-R review of one of the chapters in my fanfic story :D Story is here! -> 'Ancient Legacies'

  

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: AI Weapon targeting selection?
You can get huge weapons to not shoot at bombs by default (which makes sense... the weapon can't target a fighter, so it never could tag a bomb) with the use of a new .tbl file the SCPers came up with.  But getting one is nigh on impossible (I've tried and failed :()
You mean the file?

http://koti.mbnet.fi/vekkup/FS2/tbms/test-aip.tbm

You need to copy that file to mod/data/tables and then use fred to select the ai_profile for the mission.
Do not meddle in the affairs of coders for they are soggy and hard to light