IPB

Welcome Guest ( Log In | Register )

 Forum Rules Forum Rules
 
Closed TopicStart new topic
> How damage is modeled in AS, a relatively brief explanation
ShadoWarrior
post Dec 10 2005, 09:32 AM
Post #1


Chief UFO Modder
****

Group: Honoured
Posts: 3882
Joined: 28-October 05
From: Twilight Zone
Member No.: 1316



Grendel sent me a PM asking some questions whose answers I felt should be seen by everyone. I hope he won't mind my replying here. (Hopefully, this might save me the hassle of explaining this again in the future.)

QUOTE
Can one incorporate multiple existing damage types into a 'new' round?  For example, when round hits, AP damage is applied to the target (Tungsten penetrator accelerated to 4000 fps by the RDX charge), HE damage appied to all within a small radius (jacket spall and fragmentation), and maybe even a smaller incindiary effect (zirconium carbide particles)...

Another possible approach would be to "spawn" the two (HE & Incind.)ammo types on the target when the original round hits if the engine can be coaxed to do this...if this were OFP, I could script this in about 30 minutes, but I have no idea how AS is configured yet...

It's more complicated than applying more than one damage type. The short answer is no. For two reasons. First, you cannot apply two damage types simultaneously. Second, because of the underlying mechanics of how targetting works. (However, you can create a new damage type that is a hybrid. More on this later.) But before I go further, I think I need to explain a bit about the damage mechanism in AS, as gleaned from studying the equipment file.

First, I'll give a brief explanation of damage types. Damage types key into a 13-element array of values defined for each armor representing the percentage penetration (ie: inverse of resistance) to that type of damage. So a value of "1.0" means 100% of the damage gets through, while "0.2" means that 20% of the damage is applied (80% resistance). That's all damage types are: a means to determine resistance to the attack.

For example, if you want to model API ('Hard' and 'Burn' damage types), you could devise a new damage type that uses the lowest resistances of 'Hard' and "Burn'. Then you have to go through the massive effort of adding the new damage type to every single armor of every single actor (friend and enemy) in the game, since you're expanding the damage type array. That's edits to many hundreds of text files. Say that you manage to accomplish this monumental task. So far so good, you think? But wait, we're not done. We haven't really modelled the API round, which not only does AP ('Hard') penetration damage, but also has WP that continues to burn in the wound after the round has expended its kinetic energy. That's two effects: impact, and burning. (If it's a Raufoss round, there are 3 effects: impact, explosion, and burning.) We'll now look at how these seperate effects are treated by AS.

The other thing you must know about damage is something called the Influencer. It's how damage is applied to target(s) before damage type (resistance) is considered. There are 9 types of 'influences'. Each type defines a method for affecting (influencing) a target. I'll discuss the three most commonly associated with weapons: 'Target', 'Fragment', and 'Constant'.

Target: applies an effect (may be damage, may be healing, or something else) to a designated target (and only that target). The target may or may not be at range. All projectile and laser weapons, for example, use 'Target', and have a 'Time' value of 0 (meaning the effect, damage, is applied in full instantly).

Fragment: applies an effect in a range (radius) around the target location. The effect's strength decreases as distance increases from the center of effect.

Constant: applies an effect in a range (radius) around the target location. The effect's strength remains the same regardless of distance from the center of effect.

'Fragment' is used in the game to represent explosions. (There's a seperate value called 'Pellets' that represents the actual frags.) Real explosions, as well as those in the game, have decreasing concussion the further you are from the center of a blast. Fragment models this well. If you wanted to model a small nuke, you'd also use 'Fragment' as radiation intensity also decreases with distance. Most explosions in the game also have 'Time' of zero, since a blast is an instantaneous event.

'Constant' is used in the game to model such things as an area covered in flames. The effects of the fire will be (generally) the same regardless of where in the flames you are unfortunate enough to be standing in. Most Constant effects have a non-zero 'Time' value as the effects last for a while.

The point of all this? You may only specify ONE influence for an attack, and you may only specify ONE damage type for the influence.

So, for API, you cannot specify 'Hard' for 'Target' with 'Time' of zero, and 'Burn' also for 'Target' with non-zero 'Time'. (ie: instantaneous impact of AP, plus prolonged burning due to WP) The best you can do in modelling API is using 'Hard' or 'Burn' and specifying a non-zero 'Time', or creating a new damage type, either of which will apply the combined/hybrid damage over time. You cannot apply the damages seperately, one as an instant, the other over time.

It's far worse for Raufoss ammo, which has explosive effects as well as API. To properly do Raufoss, you'd need to be able to do 'Target' and 'Fragment' influences at the same time, which is impossible in AS.


--------------------
IPB Image
Go to the top of the page
 
+Quote Post
Grendel
post Dec 13 2005, 04:13 PM
Post #2


Newbie
*

Group: Members
Posts: 12
Joined: 6-December 05
Member No.: 2203



Thanks for taking the time to explain this thouroughly, ShadoWarrior.
Go to the top of the page
 
+Quote Post
ShadoWarrior
post Dec 19 2005, 01:47 PM
Post #3


Chief UFO Modder
****

Group: Honoured
Posts: 3882
Joined: 28-October 05
From: Twilight Zone
Member No.: 1316



Addendum I:

As Caelum discovered when he was working on testing the new flamethrowers in my mod, in order for area-effect damage-over-time to correctly be applied you must specify the Ranged type as "Rocket" or "Grenade", not "Gun".

Example -
CODE
     Ranged Ranged RECORD
       range FLT 40
       accuracy FLT 20
       time FLT 0.2
       recoil FLT -1
       type STR "Grenade"


--------------------
IPB Image
Go to the top of the page
 
+Quote Post
ShadoWarrior
post Dec 23 2005, 05:34 PM
Post #4


Chief UFO Modder
****

Group: Honoured
Posts: 3882
Joined: 28-October 05
From: Twilight Zone
Member No.: 1316



Addendum II:

Most players do not understand the mechanics of shotguns in the game. All ammo in the game has a value called "pellets" which indicates how many sub-pieces there are to the ammo. All regular guns have exactly one pellet (the ammo is a single slug). Grenades have many pellets (aka frags, up to 16). Each such piece has its own individual to-hit roll (equal to the hit % number you see displayed in tactical combat) and small amount of damage that it inflicts. The listed base damage of a pelleted weapon in the game is the total base damage for all pellets assuming that they all hit. In the case of normal shotgun shells, there are 12 pellets, and for the SPAS 12, the damage per pellet is 120. 12x120=1440 (which is the number you see in the info window in inventory). The actual damage you will get in the tactical game will vary based on how many pellets hit, the soldier's enemy skill, and whether they achieve a critical hit. (It seems that if a critical hit is achieved then ALL the pellets that hit do extra damage; it appears that one master check is made for critical damage, not one per pellet. I may be wrong, but that's been my observation.)


--------------------
IPB Image
Go to the top of the page
 
+Quote Post
Cathexis
post Dec 23 2005, 08:27 PM
Post #5


Member
**

Group: Members
Posts: 100
Joined: 29-November 05
From: Seattle, Washington, United States
Member No.: 2061



That's really elegant. I'd figured it was something like that but I wasn't sure. I presume it does an attack roll for each pellet at the percentage displayed when targetting?

As for the critical hit being a single check, that makes a degree of sense, because assuming the spread on the shotgun isn't terribly high, where you point the weapon is where the majority of the shot is going to end up, and critically hitting is a case of the operator picking (either on purpose or by accedent) a "good" spot to hit, which is where most of the shots are going to end up (also I'd imagine that if critical hits were determined per pellet, shotguns would knock people over all the time but wouldn't do appricably more damage per shot).


--------------------
Repensum est Canicula
Go to the top of the page
 
+Quote Post
ShadoWarrior
post Dec 23 2005, 09:39 PM
Post #6


Chief UFO Modder
****

Group: Honoured
Posts: 3882
Joined: 28-October 05
From: Twilight Zone
Member No.: 1316



QUOTE (Cathexis @ Dec 23 2005, 02:27 PM)
I presume it does an attack roll for each pellet at the percentage displayed when targetting?

Yes. I said as much: "equal to the hit % number you see displayed in tactical combat". wink.gif


--------------------
IPB Image
Go to the top of the page
 
+Quote Post
Cathexis
post Dec 23 2005, 09:53 PM
Post #7


Member
**

Group: Members
Posts: 100
Joined: 29-November 05
From: Seattle, Washington, United States
Member No.: 2061



Yup, you sure did. I'm having one of those days I guess :)


--------------------
Repensum est Canicula
Go to the top of the page
 
+Quote Post
Space Voyager
post Jan 18 2006, 12:21 PM
Post #8


Advanced Member
***

Group: Honoured
Posts: 319
Joined: 17-May 04
Member No.: 135



ohmy.gif You sure dug yourself into Aftershock, ShadoW!
Go to the top of the page
 
+Quote Post
Joe!
post Apr 17 2006, 01:17 PM
Post #9


Newbie
*

Group: Members
Posts: 29
Joined: 15-April 06
Member No.: 3131



i asked my roommate to work on the game code itself so he can add my custom damage codes into it... maybe i can ask him to re code it in a way that the function will call the data from the editable txt files rather than from whithin the code. hope this works tongue.gif
Go to the top of the page
 
+Quote Post
ShadoWarrior
post Apr 17 2006, 02:42 PM
Post #10


Chief UFO Modder
****

Group: Honoured
Posts: 3882
Joined: 28-October 05
From: Twilight Zone
Member No.: 1316



In case you aren't aware of it, changing the game code in any way whatsoever is illegal in almost every country on Earth. Furthermore, I'll warn you that discussing it on these forums is likely to get you banned.


--------------------
IPB Image
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 10th September 2010 - 09:35 AM