Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: WMCoolmon on May 23, 2005, 07:26:55 pm
-
Armor.tbl theory
The general idea behind armor.tbl is the interaction of two attributes; the ability of the ship being damaged to resist that damage, and the ability of the weapon damaging the ship to deal damage.
This is done by grouping ship armor into different types, and weapon damage into different types. This is because some types of armor are more effective against certain types of damage.
As an example, say you have a ship made entirely out of glass. Against ballistic weapons, it doesn't stand a chance; the slightest hit will cause it to shatter. Against beams, however, the ship will actually fair pretty well; the cannons will poke holes in it, but the ship will still maintain its overall hull integrity.
You also have a ship made out of paper. This ship will fair well against ballistic weapons - they'll just slice through it - but beam cannons will light it on fire and it'll quickly burn up. (This assumes combat takes place in an oxygen-heavy nebula)
So, your armor.tbl would look something like this:
#Armor Type
$Name: Glass
$Damage Type: Beam cannon
+Calculation Type: Multiplicative ;;Beam cannons penetrate instantly, so half
+Value: 0.5 ;;the destructive energy is wasted going through the empty hole
$Damage Type: Ballistic
+Calculation Type: Multiplicative ;;Impact force cracks and will finally shatter glass
+Value: 5.0 ;;so do 5x the damage value of the weapon
#End
#Armor Type
$Name: Paper
$Damage Type: Ballistic
+Calculation Type: Multiplicative ;;Explosives don't even detonate
+Value: 0.25 ;;Just whiz through the ship
$Damage Type: Beam cannon
+Calculation Type: Multiplicative
+Value: 99999 ;;A single hit will make this ship catch fire and die
#End
Note that you can use other calculation types, and you can use more than one calculation type (modifiers are applied in sequence to the original damage value of the weapon). I didn't do that in this example to keep things simple. But it would look something like this:
$Damage Type: Beam cannon
+Calculation Type: Multiplicative
+Value: 99999 ;;A single hit will make this ship catch fire and die
+Calculation Type: Additive
+Value: 42 ;;Just to add insult to injury, do 42 more damage as well
-
What are all the calculation types again?
Is the wiki refusing to let you edit pages? it's working for me right now.
-
I have some unanswered questions regardless of my sniffing around with multiple related threads.
- Is it possible to change or add armor types to different ships in fred?
- How do you add self-repairing abilities to armor type? For example, repair X amount of hitpoints every X seconds/minutes.
Originally posted by FireCrack
What are all the calculation types again?
Calculation types that I know of:
Additivive: Damage + table value
Mulitplicative: Damage * table value
Exponential: Damage ^ table value
-
1: I dont think so, atleast not at this time
2: No, but that should be able to be done with other things.
...
$Hitpoints
+Hull Repair Rate
+Subsystem Repair Rate
$Armor Type: Reflective
...
another calculation
Exponential base: TableValue^Damage
This is a tad confusing as it is, Exponential should be called Power, and exponential base should be simply Exponentail.
Edit, wikied
-
Oh yes, I completely forgot about those repair lines. :)
-
- Is it possible to change or add armor types to different ships in fred?
- How do you add self-repairing abilities to armor type? For example, repair X amount of hitpoints every X seconds/minutes.
- No, it shouldn't be too difficult to make it settable on a per-ship basis, getting it in FRED may be another story.
- Doesn't exist atm. You can use the Hull Repair Rate option in ships.tbl, though, to achieve the same result.
-
I tested the subsystem repair thingy with Goober's 20050719 build, seems to work but several notes:
+Hull Repair Rate needs to be $Hull Repair Rate
+Subsystem Repair Rate needs to be $Subsystem Repair Rate
Also, $Subsystem Repair Rate: 0.01 does not work, 0.011 and 0.009 works, as did all other values I tried.
At this time I did not test whether this is also an issue with hull repair.
-
Because I was semi-lazy in coding the feature. :p
The original subsystem repair rate was 0.01, and didn't affect capital ships. So I figured that I'd check if it was set to that, and assume it wasn't set in that case. It saved me some extra work, or an extra variable. Not that hard to fix.
-
OK, fixed it, I'll have it in CVS once I make sure it compiles.
I've switched both fields to be percentages, in the interest of modder-friendliness. That is, a value of "1" should repair at a rate of 1 percent a second.
You can of course screw with the value in realtime (ie during a mission) in the lab.
Edit: And before anyone asks for it, yes, you can enter negative values. :p
-
Which means old values won't work anymore?
-
They'll work, but be decremented in their effect by a factor of 100.
Just move the decimal point two digits to the right for all current values and they should work exactly as before. :)
-
i don't know if this is possible, but can you extend the armor types to shields too? for example:
#Shield Type
$Name: Graviton Shield
$Damage Type: Beam cannon
+Calculation Type: Multiplicative ;;fast moving laser beams have no time to get deflected
+Value: 1.0 ;;do full damage
+Pierce Probability: 0.5 ;;perhaps pierce the shield and hit the armor half the time
$Damage Type: Ballistic
+Calculation Type: Multiplicative ;;bullets deflected easily by the gravity waves
+Value: 0.25 ;;so don't do much
+Pierce Probability: 0.0 ;;never pierce the shields either
#End
-
A peirce factor would make more sense, so mabye half of the damage would eb taken by a calculation whereas the other half would fall straight to the hull, or possibly a "hull dropoff" calculation type that just drops an amount of whatever is left directly to the hull
$Damage Type: Beam cannon
+Calculation Type: Multiplicative
+Value: 0.5 ;;dived damage by 2
+Calculation Type: Hull Dropoff
+Value 1.0 ;; and apply all to hull
would simply make beams do half damage to your hull as long as your sheild is up.
ofcourse, next thing you know i'l want a thing that reads the sheild integrity and plies it to a calulation, same for hull, so you best ignore me.
But,i do have a practical calculation type, somthing that would just set to zero if you have a negative value if you want damages below a certian amount doing 0.
-
I once again have to quote the decade long formula I've been spouting out for eternity:
Hull Damage = (Weapon Damage - Armor Treshold) * Armor Resistance%
Absorbed Damage = (Weapon Damage - Armor Treshold)(1-Armor Resistance%)
Armor Damage = (Absorbed Damage/(Armor HP - Absorbed Damage))*Absorbed Damage
Armor Treshold is the ammount of damage, the armor can shrug off or simply can't even scratch it. Like firing a 9mm on a Tank - it won't do anything.
Armor Resistance is the ammount of damage the Armor Can absorb.
Armor Damage is a good formula 'casue it will give a gradual damage curve in relation to the weapon's absorbed damage and the thickness (armor HP) of the armor.
The first 2 formulaes are from Fallout (1&2) while the third is from Morrowind.
Armor HP can be calculated into the damage model like this:
Hull Damage = (WD - (AT *AS%)) * Armor Resistance% * AS%
Absorbed Damage = (WD - (AT * AS%))*(1-Armor Resistance%) * AS%
AS% = 100*Max(Armor HP)/Current(Armor HP)
That way the armor will take damage.
If you can assign an own table / variables for different parts of the ship the above formulae would work for individual armor plates too.
-
Hull Damage = (Weapon Damage - Armor Treshold) * Armor Resistance%
#Armor Type:
$Name: Fallout
$Damage Type: Whatever
+Calculation Type: Cutoff
+Value: 20.0 ;;Weapons have to do more than 20 damage to even scratch the armor
+Calculation Type: Multiplicative
+Calculation Type: 0.75 ;;Armor shrugs off 75% of damage.
#End
Cutoff does not actually subtract any damage. It merely sets it to '0' if the damage value at that point is less than that number. So if you added a calculation to the top that was a multiplicative of "4", weapons dealing 5 damage would do damage.
Or if I replaced the bottom multiplicative value with an additive calculation of 35, all weapons originally dealing damage of less than 20 would deal exactly 35; weapons doing 20 damage or more would deal their damage plus 35.
Unfortunately it doesn't support order of operations, I figure I'll leave that up to whatever expression eval system ends up being implemented.
-
Added new calc types:
"reverse cutoff" - if the current damage value is greater than the specified amount, the damage value is set to 0.
"instant cutoff" - if the current damage value is less than the specified amount, the damage value is set to 0 and the calculation series is instantly ended (So no matter what you have afterwards, the weapon will do no damage)
"instant reverse cutoff" - if the current damage value is greater than the specified amount, the damage value is set to 0 and the calculation series is instantly ended.
Note that when I say "damage value", I mean the weapon's original damage modified by calculations for the damage type in question. Once all calculations are finished the damage value is applied to the hull. (Does not go through shields, too extensive for now)
Capitalization doesn't matter, so make things look nice. :p