Author Topic: AI and puncture weapons  (Read 3356 times)

0 Members and 1 Guest are viewing this topic.

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
AI and puncture weapons
Simple question, complex answer: With FRED and table modding, how can I designate ships as valid targets for ONLY puncture weapons?

As an example, let's take the first Silent Threat / ST:R mission, Silence All Voices. In the original mission, it's a battle royale with Terrans and Vasudans attacking each other, and the player (as GTI) 'sanitizes' the area by killing everyone leaving no survivors. But let's say we wanted to be more conservative; what if the GTI is assigned to arrest everyone?

The FreeSpace AI is set up to destroy, not disable. But in this scenario, your wingmen should A) engage the enemy with puncture weapons only, then B) move on after disabling the targets. The cumbersome way to handle this would be to set AI orders to disable every ship, and then protect-ship or change-IFF after they're disabled, but this requires a ton of events.

It's also difficult to give wingmen orders to protect or engage if they're armed with lethal weapons, or if they continue hammering on helpless targets in futility. This isn't even getting into capital ships and turret-mounted weapons; they need to defend themselves from bombs, but not bombers.

Is there a ship property in FRED, or something in IFF_defs.tbl, that can blanket designate certain targets (or a certain IFF) as valid for capture but not destruction?
« Last Edit: December 18, 2015, 04:30:09 pm by Galemp »
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: AI and puncture weapons
It's pretty easy to force ships to prioritize bombs before bombers with set-turret-target-order.

 

Offline Axem

  • 211
Re: AI and puncture weapons
I believe disarmed and disabled ships are already auto-protected (or ignored) to the ai. I think the intent with that is if you're disabling/disarming a ship, you're intending to probably capture it too. So in theory, you should be able to just give your wings a bunch of disable orders and it should work itself out. (Note I've never actually tried this!)

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: AI and puncture weapons
I believe disabled enemy fighters will self-destruct after a bit.

 

Offline Axem

  • 211
Re: AI and puncture weapons
Ah yes, disabled or disarmed fighters in a wing will self destruct after 90 seconds... That was the cause of the "Kill Scar" bug in BtRL.

Well then you could have a when-argument when a ship is disabled or disarmed to "repair" their engines to 1 (and guardian the subsystem) and then force a play-dead order with a 200 priority so it'll stay harmless. (Change the IFF to unknown too if you like!)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: AI and puncture weapons
Ah yes, disabled or disarmed fighters in a wing will self destruct after 90 seconds... That was the cause of the "Kill Scar" bug in BtRL.

Actually it wasn't. I took steps to prevent that from happening by subsystem-guardianing the engines and weapons systems IIRC.

I never actually figured out what the hell was causing Scar to sometimes die as I could never reproduce it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: AI and puncture weapons
It occurs to me that this could very easily be prevented with a ship flag.  I created a PR.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: AI and puncture weapons
Don't suppose you could request a SEXP / ship flag that treats a target as Protect-ship except for weapons with the Puncture flag? Optional argument to set this property as applicable to certain IFFs only? (Thinking of the HOL Ramses vs SC Taranis here.)
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: AI and puncture weapons
That sort of thing is quite a bit more complicated than just a flag, as this Mantis ticket explains.  But as Axem says here, ships to be disabled or disarmed are already auto-protected.  (In fact, the Mantis ticket was to reverse this behavior for WCSaga.)

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: AI and puncture weapons
I understand that ships that have been disarmed and disabled are protected. What I'm looking for is some way to have an armed and... enabled ship protected from all weapons other than puncture weapons. So if you order your wingmen to engage enemy, they will switch from Prometheus to Disruptor cannons depending on whether their targets have this property set, without having to issue individual 'disarm' and 'disable' orders for every wingman on every target.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: AI and puncture weapons
This smells complicated.  The code is heavily biased toward the assumption that if it's an enemy, you want to kill it.

Do you need this via wingmen orders or are FRED sexps sufficient?  Because it would be possible to issue blanket disarm/disable orders using when-argument sexps.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: AI and puncture weapons
FRED Sexps on a per-mission basis should be fine, and I'm sure for a handful of missions it would be a lot less work than coding the feature. But it's less flexible than a ship property, or an IFF flag, for future use.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem, but under Tiger Parents
    • Skype
    • Steam
    • Twitter
Re: AI and puncture weapons
And what about LUA scripting?
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Full Projects:
Shattered Stars

Campaigns:
Lost in the Mist - Cyrene vs. Psamtik
FreeSpace: Reunited

Ships:
GTS Hygeia, GTT Argo, SC Raguel

Tools:
FSO TC/Game template

I've been under attack by Tiger Parents like Jennifer Pan...

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: AI and puncture weapons
Scripting would likely be the best compromise as it would be portable to other missions/campaigns without requiring a later build.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem, but under Tiger Parents
    • Skype
    • Steam
    • Twitter
Re: AI and puncture weapons
Then, in any case, requires more additions/tweaks to Lua scripting.
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Full Projects:
Shattered Stars

Campaigns:
Lost in the Mist - Cyrene vs. Psamtik
FreeSpace: Reunited

Ships:
GTS Hygeia, GTT Argo, SC Raguel

Tools:
FSO TC/Game template

I've been under attack by Tiger Parents like Jennifer Pan...

  

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: AI and puncture weapons
 :bump:

This feature request is still outstanding. I've put together a training mission on a proposed advanced IFF system, intended for police and peacekeeping. Please use the attached table and mission to see exactly what kind of behavior I want to teach to the AI.

[attachment stolen by Russian hackers]
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...