Author Topic: IFF table proposal  (Read 2486 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Okay, here's the iff_defs table as it now stands.
Code: [Select]
#IFFs

;; Every iff_defs.tbl must contain a Traitor entry.  Traitors attack one
;; another (required by the dogfighting code) but it is up to you to
;; decide who attacks the traitor or whom else the traitor attacks.
$Traitor IFF: Traitor

;------------------------
; Friendly
;------------------------
$IFF Name: Friendly
$IFF Color: ( 0, 255, 0 )
$Attacks: ( "Hostile" "Neutral" "Traitor" )
$Default Ship Flags: ( "cargo-known" )

;------------------------
; Hostile
;------------------------
$IFF Name: Hostile
$IFF Color: ( 255, 0, 0 )
$Attacks: ( "Friendly" "Neutral" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )
+Sees Hostile As: ( 0, 255, 0 )

;------------------------
; Neutral
;------------------------
$IFF Name: Neutral
$IFF Color: ( 255, 0, 0 )
$Attacks: ( "Friendly" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )
+Sees Hostile As: ( 0, 255, 0 )
+Sees Neutral As: ( 0, 255, 0 )

;------------------------
; Unknown
;------------------------
$IFF Name: Unknown
$IFF Color: ( 255, 0, 255 )
$Attacks: ( "Hostile" )
+Sees Neutral As: ( 0, 255, 0 )
+Sees Traitor As: ( 0, 255, 0 )
$Exempt From All Teams At War

;------------------------
; Traitor
;------------------------
$IFF Name: Traitor
$IFF Color: ( 255, 0, 0 )
$Attacks: ( "Friendly" "Hostile" "Neutral" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )

#End
And, for good measure, the latest upgrade of species_defs:
Code: [Select]
#SPECIES DEFS

;------------------------
; Terran
;------------------------
$Species_Name: Terran
$Default IFF: Friendly
$FRED Color: ( 0, 0, 192 )
$MiscAnims:
+Debris_Texture: debris01a
+Shield_Hit_ani: shieldhit01a
$ThrustAnims:
+Normal: thruster01
+Afterburn: thruster01a
$ThrustGlows:
+Normal: thrusterglow01
+Afterburn: thrusterglow01a
$AwacsMultiplier: 1.00

;------------------------
; Vasudan
;------------------------
$Species_Name: Vasudan
$Default IFF: Friendly
$FRED Color: ( 0, 128, 0 )
$MiscAnims:
+Debris_Texture: debris01b
+Shield_Hit_ani: shieldhit01a
$ThrustAnims:
+Normal: thruster02
+Afterburn: thruster02a
$ThrustGlows:
+Normal: thrusterglow02
+Afterburn: thrusterglow02a
$AwacsMultiplier: 1.25

;------------------------
; Shivan
;------------------------
$Species_Name: Shivan
$Default IFF: Hostile
$FRED Color: ( 192, 0, 0 )
$MiscAnims:
+Debris_Texture: debris01c
+Shield_Hit_ani: shieldhit01a
$ThrustAnims:
+Normal: thruster03
+Afterburn: thruster03a
$ThrustGlows:
+Normal: thrusterglow03
+Afterburn: thrusterglow03a
$AwacsMultiplier: 1.50

#END

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Hmm, I don't like the way things are arranged, it seems counter-intuitive.

First of all, everything is relative, so the $IFF Color: (Or is it $Color: ?) field should always be green, using default FS2 colors. ie, Hostile should look like:
Code: [Select]
$IFF Name: Hostile
$Color: ( 0, 255, 0 )
+As Seen By Friendly: ( 255, 0, 0 )
+As Seen By Neutral: ( 255, 0, 255 )
$Attacks: ( \"Friendly\" \"Neutral\" \"Traitor\" )


Second, I think you have 'Neutral' and 'Unknown' mixed up.

Third, I think "traitor" should be an IFF flag, rather than just a variable. Leaving the variable in to specify which IFF the dogfight code uses would be a good idea.

And fourth, I think it should be possible to specify 'generic' colors rather than specific ones for factions. That is, this team is this color for everyone who hates it, this color for those who don't care, this color for those who like it. That way adding another IFF entry doesn't mean you have to go back and redo everything. (And opens the door for modular tables with IFF, which might be useful for standalone missions)

Edit: "$Exempt From All Teams At War" looks like another good candidate for an IFF flag.
-C

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Quote
Originally posted by WMCoolmon
Hmm, I don't like the way things are arranged, it seems counter-intuitive.
It's not once you think of it.  I'll explain:
Quote
First of all, everything is relative, so the $IFF Color: (Or is it $Color: ?) field should always be green, using default FS2 colors. ie, Hostile should look like:
Code: [Select]
$IFF Name: Hostile
$Color: ( 0, 255, 0 )
+As Seen By Friendly: ( 255, 0, 0 )
+As Seen By Neutral: ( 255, 0, 255 )
$Attacks: ( \"Friendly\" \"Neutral\" \"Traitor\" )
[/b]
Er, no.  $IFF Color is the "objective" color, the one that appears on the briefings and on the HUD normally.  The +As Seen By lines are only there because in TVT and All Teams At War missions there's code which forces allies to be green and enemies to be red.

The code I have accounts for both possibilities.  If you have a GTA vs. PVN match, let's say, you could have GTA be orange and PVN be silver and you could tell at a glance who the enemy is, depending on which color you're fighting against.  But if you prefer the HUD to display the classical "green = friendly, red = enemy" scheme, you can do that too.

Quote
Second, I think you have 'Neutral' and 'Unknown' mixed up.
No, they're correct.
Quote
Third, I think "traitor" should be an IFF flag, rather than just a variable. Leaving the variable in to specify which IFF the dogfight code uses would be a good idea.
It's there for more reasons than just dogfight.  I thought this over for quite a bit and even thought of removing the Traitor IFF from the table completely, but this way is better.  It lets you specify exactly what happens when you turn traitor.
Quote
And fourth, I think it should be possible to specify 'generic' colors rather than specific ones for factions. That is, this team is this color for everyone who hates it, this color for those who don't care, this color for those who like it. That way adding another IFF entry doesn't mean you have to go back and redo everything. (And opens the door for modular tables with IFF, which might be useful for standalone missions)
I very much doubt modular tables would work here, since IFFs rely on other IFFs and you have no idea what IFFs are going to be in the base table.  And if you think about it, my +As Seen By color scheme allows precisely what you're describing here.  You could even extend this to a scenario where one team knows the true identity of a fighter, because they have better sensors and can distinguish his IFF dot properly, while one team remains oblivious.

I really spent a great deal of time looking over the IFF code while drawing this table up, so I can assure you that I've anticipated most of the arguments. :) That doesn't mean all the arguments, just that the table as it is now has gone through several revisions already and should work in most if not all scenarios.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
But what if you want more than one team of traitors?
What if more flags are wanted?

Let's say I go ahead and add a "PVN" faction in addition to friendly...I seem to have to now go through each IFF and add a "+As Seen By" flag. Not to mention, what if I'm on the 'Unknown' team? What color will other people see me as? What color will I see them as - there's no color defined for Unknown.

If the "As Seen By" defines refer to generic positions, how does the code tell whether people are friendly or neutral? How do you define specific colors for factions? And why are they named in a way that can be easily confused with the specific factions?

If the "As Seen By" defines refer to specific factions, how do I add in a faction and have it be properly colored without changing every single other faction?

If I make a standalone mission that I want to add a faction to, how do I do that without breaking everyone else's standalone missions?

Quote
I very much doubt modular tables would work here, since IFFs rely on other IFFs and you have no idea what IFFs are going to be in the base table.


Only if you write it in such a way that it isn't modular table-friendly. Otherwise mods and missions could add on their own factions; then they could be fairly sure that the base FS2 ones would be intact.

EG rather than just "$Attacks" there could be an "$AttackedBy" field as well.
-C

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Quote
Originally posted by WMCoolmon
But what if you want more than one team of traitors?
There can only be one traitor IFF.  That's the IFF the game sets you to if you go off and start shooting your own team.  If you're thinking traitors in a storyline sense like the NTF,  you have to add an NTF IFF.
Quote
Let's say I go ahead and add a "PVN" faction in addition to friendly...I seem to have to now go through each IFF and add a "+As Seen By" flag. Not to mention, what if I'm on the 'Unknown' team? What color will other people see me as? What color will I see them as - there's no color defined for Unknown.
The +As Seen By flags are optional.  If you don't specify any, the game uses the standard IFF color.  This is so you can have a mission with multiple factions and tell them all apart by which color they have: blue, yellow, orange, whatever.  If you want to tell precisely which dot is which faction, you use the standard color.  If all you're interested in is who's your ally and who's your enemy, you use the +As Seen By color.
Quote
(a) If the "As Seen By" defines refer to generic positions, how does the code tell whether people are friendly or neutral? How do you define specific colors for factions? And why are they named in a way that can be easily confused with the specific factions?

(b) If the "As Seen By" defines refer to specific factions, how do I add in a faction and have it be properly colored without changing every single other faction?

(c) If I make a standalone mission that I want to add a faction to, how do I do that without breaking everyone else's standalone missions?
(a) It's specific factions; (b) you only have to worry about that if you're using the allies vs. enemies scheme; (c) your standalone mission should adapt itself to the IFFs used in the main mod or else not be a standalone mission.

The IFF table will not be modular table friendly and conceptually cannot be modular table friendly.  It doesn't work the same way as ships.  If you add a new ship the other ships couldn't care less about it.  But if you add a new IFF the other IFFs need to know how to respond.  The IFF table must define not only the IFFs but the relationships between the IFFs.  That's why the whole thing needs to be specified in one file.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I think there should be an $allied: tag, I'm guessing anything an IFF doesn't attack it ignores untill it is attacked by it, it's posable that you could get a ship of one IFF that acedently hits a ship of a different IFF that it is suposed to be frendly with. so a ship of IFF A that is allied to IFF B will not attack IFF B ships even if IFF B ships attack IFF A ships

there should also be a warping/indeterminate IFF.

and perhapse a priority, if that would be posable, though I doubt it is.


if the relationships can be defined in either a comeing or going manner then I think modular tables could be posable. ie, you currently have an +As Seen By *: and $Attacks:, if you also had +*sees me as: and $is attacked by: then all relationships can be defined in an add onfashion. though the whole useing IFFs before they are declaired thing kind of rubs me the wrong way. (if I'd have done this I would have had an IFF section and a relationship section, but that's just me)
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Quote
Originally posted by Bobboau
I think there should be an $allied: tag, I'm guessing anything an IFF doesn't attack it ignores untill it is attacked by it, it's posable that you could get a ship of one IFF that acedently hits a ship of a different IFF that it is suposed to be frendly with. so a ship of IFF A that is allied to IFF B will not attack IFF B ships even if IFF B ships attack IFF A ships
This is true, and you have to account for it when designing the table.  But IFFs who don't have "Attack X" on their list will not attack X even if attacked first.
Quote
if the relationships can be defined in either a comeing or going manner then I think modular tables could be posable. ie, you currently have an +As Seen By *: and $Attacks:, if you also had +*sees me as: and $is attacked by: then all relationships can be defined in an add onfashion. though the whole useing IFFs before they are declaired thing kind of rubs me the wrong way. (if I'd have done this I would have had an IFF section and a relationship section, but that's just me)
Lots of things are used before they're declared.  And as for relationships, they're inherently declared in a one-way fashion.  But you bring up a good point with +As Seen By; I'll make it +Sees X As instead.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
and would it be posable to have trator IFF defined in the mission file (useing the table as defaults), preferably on a per IFF basis, so if you wanted a mission were if you turned on your side you'd be given hostile IFF and the guys you were fighting a minute ago would now be your frends?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
You'd have to script that.  It can be done easily using sexps.

 
I would leave my comments but, this all seems like greek to me :D
maybe a few weeks from now i figure out wat's being said
Lightning....im always first

  
umm.. isn't supposed a traitor to be an enemy once he/she defected?