Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: WMCoolmon on April 15, 2005, 01:16:53 am
-
Completely untested (I could either test it or implement it :p)
Armor.tbl (or *-amr.tbm):
#Armor Type
$Name: Exponential armor
$Type: exponential
;; The table identifiers can be $*:, everything in between the dollar
;; and colon is ignored
;;The columns are damage indexes
;; 0 1 2
$R: (1.0f 1.2f 1.5f) ;;This is armor index 0
$R: (3.0f 3.5f, 1.0f)
#End
#Armor Type
$Name: Multiplicative armor
$Type: multiplicative
;; The table identifiers can be $*:, everything in between the dollar
;; and colon is ignored
;;The columns are damage indexes
;; 0 1 2
$R: (1.0f 1.2f 1.5f) ;;This is armor index 0
$R: (3.0f 3.5f, 1.0f)
#end
Ships.tbl
;;Right before $Flags:
$Armor Index: 0
+ArmorType: Exponential armor ;;Applied in order
+ArmorType: Multiplicative armor ;;Yes you can have multiple types
Weapons.tbl
;;After $Damage:
$Armor Damage Index: 2 ;;Defines the far right value in the example tables above
Formulae for (current) armor type types, easily expanded:
Additivive
Damage + table value
Mulitplicative
Damage * table value
Exponential
Damage ^ table value
It's all in CVS so the next build will have it.
Edit:
I also added a ship flag, "no weapon damage scaling", which will disable the default scaling for a ship.
-
Looks good! I haven't had time to implement this in a table file, and, afaik, TI aren't planning to use the armour abilities, but it would be handy if someone who was looking for this stuff gave it a go ;)
-
Wouldn't this break the main campaign in some places? Some ships not perishing, or not perishing quickly enough, when they should?
-
Only if you give them armor in the TBL files.
-
If additive and multiplicative armor could be combined that would make my ever sought for:
Treshold + Resistance system possible.
-
I need to work on the armor so it can parse the table, but, yes, that will be possible.
Right now you can specify multiple armor types for ships, I plan on making it so you can specify multiple calculation types for each armor type. That way you can create esoteric armor types with as many calculations as you please, but still only have to enter two entries to assign armor to a ship.
-
Maybe if you could apply it to textures through Bobb's new system he's working on, you could have armoured/unarmoured areas etc on the ship?
-
That'd require collision code with the ability to detect which teture it collided with (Something I asked about in another context but Bobb didn't seem to positive on the idea).
-
What exactly does it do...?
-
I'm a tad confused by all these things as well. Care to explain?
-
The table has a list of numbers. Rows represent ship indexes, columns represent weapon indexes.
You assign any ships that you want to use with the system an index, and any weapons you want to use with the system an index.
When a ship and a weapon impact, the intersection in the table is determined and if that point exists, the operation defined with "$Type:" is performed with the number. If it's additive and the number is 20, 20 points of damage are added to the weapon's damage value.
Although since Bobb has gotten an equation system working, it changes things. I'm not sure how, but it changes things. ;)
-
I think I may revise the armor system more like this:
#Armor Type
$Name: Reflective
$Damage Type: Light missile
+Calculation: Multiplicative
+Value: 3.5
+Calculation: Additive
+Value: 20
$Damage Type: Laser
+Calculation: Multiplicative
+Value: .5
;;Or maybe just do something like this, with Bobb's new equation system
$Damage Type: Laser
+Equation: collision_object.damage * .5
;;This would also allow you to do stuff like this
;;This completely ignores the damage assigned to any mega nondeath ray-style weapon, and instead deducts 75% of a ship's current hit points
$Damage Type: Mega Nondeath Ray
+Equation: ship.current_hitpoints * .75
#End
ships.tbl
$Armor Type: Reflective
weapons.tbl
$Name: Subach HL-7
...
$Damage Type: Laser
-
oooh. so if a subach were to be fired at the said ship, the laser blast would be deflected/reflected?
-
No, though that'd be a neat effect and I have a general idea of how to do it.
-
cool. :D
can't wait for it ;)
-
Can you give the armor a value of limited effectiveness according to
use/degredation?
Ie, The Defiant and Sovy classes have ablative armor which greatly increases the amount of damage they can sustain in a fight till the systems covered by those armored sections are impacted, but eventually it does fail after sustained combat. (it's primarily effective against phaser and pure energy weapons)
So eventually if combat lasts long enough the armor could entirely fail and the ship STILL be viable for combat (not destroyed).
-
Would it be at all possible to assign an armor index to a subobject, overriding the first armor index? This might make for parts of ships more heavily armored than the rest and you'd need to use some tactics to counter that.
-
Umm, for a little down the line it would be neat to have reflecting beams if possible.
(mmm... collapsed core moly)
-
Beams would be much harder.
What I'm thinking of is rather than destroying the weapon on impact with a ship, reversing its forward velocity or redirecting its velocity in a random direction.
Beams would require adding another beam section. And what would be the next request? Beams that predictably bounce, so you could have beams and mirrors. :p
I have an intuitive grasp of where stuff should end up, but I'm not quite sure of how to translate it into mathematical terms.
I'll have a new set of builds up in a few with the +Calculation/+Value system.
-
I could give you the math to calculate a reflection vector
-
Er, sure, that'd be great. :D
I don't know if my current armor system revision is working yet, though, and haven't set up expressions (I started to, but realized that I need to learn how everything works in order to get things working properly.)
I did have a thought today, we should maybe have some way to differentiate between table-specifc values and globally available values. I was thinking maybe a "g." prefix for all global variables, but, hmm. I'm going to sleep on it.
-
I = input vector
N = normal of surface
R = output reflection vector
||I||=||N||=||R||=1 (there all unit length, ie normalized)
I, R, and N are coplaner
I•N = -R•N
-I+R=N
(-I)+R = N
(-I+R)•N = N•N =
(-I•N)+(N•R) =
(-I•N)+(-I•N) =
2(-I•N) =
-I + R = N = 2(-I•N)N
tada-> "R = 2(-I•N)N + I "
so to code that would be (remembering parameters off top of head)
void vm_vec_reflect(vector*out, vector*norm,vector*in){
float d= -2*vm_vec_dot(in,norm);
vm_vec_scale(out,norm,d); //assumeing (dest,src,float)
vm_vec_add2(out,in);
}