Author Topic: Destroy subsystem = target protected??  (Read 5493 times)

0 Members and 1 Guest are viewing this topic.

Destroy subsystem = target protected??
I just found this in the code:

if (current_goal->ai_mode != AI_GOAL_DESTROY_SUBSYSTEM) {
    if (aip->target_objnum != -1) {
        //   Only protect if _not_ a capital ship.  We don't want the Lucifer accidentally getting protected.
        if (!(Ship_info[Ships[shipnum].ship_info_index].flags & SIF_HUGE_SHIP))
            Objects[aip->target_objnum].flags |= OF_PROTECTED;
        }


Is it possible to deactivate this behavior via ai_profiles flag? This is a very strange behavior maybe needed for retail but really bad for certain mods including Saga.

if I order my wingmen to attack a subsystem on a capital ship this basically results in a total protection of that ship until I change my orders. This is .. disturbing.
I might order certain ship to support an attack by destroying the engines or a weapon system and the result is that the ship will no longer be attacked...

I'm not sure everyone is aware of this...

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Destroy subsystem = target protected??
Doesn't that code pretty much state that it will only kick in on non-capital ships?
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Destroy subsystem = target protected??
Seems like it says right there it only works on non-capital ships.

 
Re: Destroy subsystem = target protected??
Probably HUGE != capital ship.

I stepped through the code during runtime... it DOES get executed for a corvette class ship in Saga.

Retail had several different types of capships, several of which we don't use. This does get executed for certain capships, which is bad.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Destroy subsystem = target protected??
That is bad.

 
Re: Destroy subsystem = target protected??
The code says:

#define   SIF_SMALL_SHIP            (SIF_FIGHTER | SIF_BOMBER | SIF_SUPPORT | SIF_ESCAPEPOD )
#define   SIF_BIG_SHIP            (SIF_CRUISER | SIF_FREIGHTER | SIF_TRANSPORT | SIF_CORVETTE | SIF_GAS_MINER | SIF_AWACS)
#define   SIF_HUGE_SHIP            (SIF_CAPITAL | SIF_SUPERCAP | SIF_DRYDOCK | SIF_KNOSSOS_DEVICE)


Which means not only small ships will be protected but also all big ships, cruisers, freighters, transports, corvettes, gas miners, and awacs.  I consider that very very bad.
Especially for corvettes and cruisers.

Edit: Maybe an ai_profiles flag or something that includes SIF_BIG_SHIP in there.

Somehow it does seem ok for transport, freighter, awacs , but cruiser and corvette?

If this is really wanted beavior then this should really be WELL documented somewhere so people stay away from "corvette" and "cruiser" type ships and declare them "capital" instead.
« Last Edit: July 05, 2009, 12:58:19 pm by KeldorKatarn »

 
Re: Destroy subsystem = target protected??
Another thing about this is... if an order to attack subsystems results in a protection...

that kinda implies that protected ships are NOT protected against subsystem strikes? Which means I can order my wingmen to destroy practically all systems of a protected ship?

That is... STRANGE... to say the least.

This this results in behavior that can sometimes look like bugs, I'd really like to see an ai_profiles flag to turn this off entirely. It seems... wrong somehow and probably results in very strange AI behavior every now and then.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Destroy subsystem = target protected??
It's not a bug at all. It's definitely deliberate and if you stop to think about it for a while you'll see exactly why.

First, this doesn't affect AI_GOAL_DESTROY_SUBSYSTEM. Re-read that first line again.

Code: [Select]
if (current_goal->ai_mode != AI_GOAL_DESTROY_SUBSYSTEM) {
Notice the ! It affects the other two goal modes this case includes, i.e AI_GOAL_DISABLE_SHIP and AI_GOAL_DISARM_SHIP. And it should be fairly obvious why you'd want the AI to stop attacking a ship when you've ordered them to disable/disarm it and they have done so. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Destroy subsystem = target protected??
Well then we cannot use those affected ship classes anymore because for us this is not wanted behavior. We have several missions in which fighters are supporting a huge strike by disarming certain ships and the last thing we want is everybody else stopping to fire on that ship.

I guess we'll just have to ignore all BIG category ship classes then.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Destroy subsystem = target protected??
This seems something that probably should have been placed into the objecttypes.tbl
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Destroy subsystem = target protected??
Well then we cannot use those affected ship classes anymore because for us this is not wanted behavior. We have several missions in which fighters are supporting a huge strike by disarming certain ships and the last thing we want is everybody else stopping to fire on that ship.

I guess we'll just have to ignore all BIG category ship classes then.

And it never occurred to you to simply unprotect the ships when they are disabled/disarmed like people have been doing since retail? :p


I swear, having access to the code is making all of us so damn lazy. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Destroy subsystem = target protected??
Isn't this supposed to be there? To keep your wingmen from destroying stuff in capture missions?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Destroy subsystem = target protected??
That's exactly the point I made. :)

If this wasn't present your wingmen would disable the transport you were after and then blow the crap out of immediately afterwards. Instant failed mission.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Destroy subsystem = target protected??
Ha. I wasn't even thinking about the 'after' part. I was just thinking about the "SHIVA H. VISHNU! generic profanity Don't use a Helios to take out the turret subsystem of a freighter!" part.

 
Re: Destroy subsystem = target protected??
Well and it never occured to you that this might not be wanted?
Transport ok.. but this also goes in effect for corvettes and cruisers.

And unprotect it once it is disarmed.. well... yeah.. if this was documented anywhere. So far I didn't even know this happened for certain ship types.

And for us it makes no sense for fighting ships like corvettes and cruisers, since we order some wings to destroy the turrets to help the bombers. That doesn't imply that the bombers should stop attacking while the other wing is trying to disarm.

The only reasonable course of action for us right now is to classify cruisers and corvettes also as "capital" since we definately do not want the attack to stop only because some fighters are disarming at the same time.

if I want a ship to be protected and not accidently blown up, then I check for that in FRED and protect or guardian it. The engine shouldn't do stuff like that for me.


Anyway, since this is considered WAD, we'll just have to avoid the ship classes affected by this. All I'm really saying is: This should be documented somewhere.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Destroy subsystem = target protected??
That's exactly the point I made. :)

If this wasn't present your wingmen would disable the transport you were after and then blow the crap out of immediately afterwards. Instant failed mission.

Would the fact that they do this all the time in multi be a bug then?
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Destroy subsystem = target protected??
Well and it never occured to you that this might not be wanted?

It's the way Freespace has always done it. And as I said it should be pretty obvious why it did it. If you want to change the behaviour, feel free. I won't be because there are plenty of ways to work around it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Destroy subsystem = target protected??
Agree with karajorma.  This is not only expected behavior, it's required behavior.

 
Re: Destroy subsystem = target protected??
All I'm saying is that lack of documentation of this 'feature' lead to false-negative bug reports and to us not assigning different ship classes in the first place. i stumbled over this by accident trying to debug a turret 'malfunction'.

This could just as well have made it into release and nobody would have known what the hell the AI is doing.

stuff like this should really be documented somewhere.

It's the same as the "how do I correctly make subsystems rotate" in the other thread I opened. nobody really knows where to find any information about how it is done or what certain flags REALLY do.

I know this is really more a concern for the wiki project but this is something only the developers really know.

Just a suggestion from a modder's point of view.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Destroy subsystem = target protected??
Could this behavior be responsable for a bug in some earlier versions (haven't played latest one) of the FSPort during the Ramses mission, where the Shivans will refuse to attack the Ramses?  The player's mission is to disable and disarm the Ramses, so the Protect-Ship defaulting status could have filtered over to the Shivans treatment of the Ramses.
The Trivial Psychic Strikes Again!