New Animations and Events
New Animations and Events
- blue_max
- Posts: 2284
- Joined: Wed Mar 20, 2019 5:12 am
This is basically what I'm talking about:
https://www.youtube.com/watch?v=dtDG-14p3Po
Up to this point, all animations have been linked to global events: what you define in a .mat file as an animation will show on all instances of that ship -- which is why animations have been limited so far to the Exterior OPTs and the Cockpit (mostly). With ddraw version 2.0.5, it is now possible to define animations that only apply to specific ships once they trigger certain events. These are the events that are available at this moment:
IEVT_DAMAGE_75,
IEVT_DAMAGE_50,
IEVT_DAMAGE_25,
IEVT_SHIELDS_DOWN,
IEVT_TRACTOR_BEAM,
IEVT_JAMMING_BEAM
These events will apply hull damage, shields-down, tractor and jamming beam animations. For instance, when a single T/F is damaged in a flight group, only the damaged ship will display damage. These animations can be layered on top of regular textures using the LYR_SCREEN and LYR_MULT modifiers. LYR_SCREEN will use the screen blending mode and LYR_MULT will use the multiply blending mode. For example, the following:
anim_once = IEVT_DAMAGE_25, LYR_MULT, Effects\GenericDamage.dat, (0-0,0.1,0)
anim_once = IEVT_DAMAGE_50, LYR_MULT, Effects\GenericDamage.dat, (0-1,0.1,0)
anim_once = IEVT_DAMAGE_75, LYR_MULT, Effects\GenericDamage.dat, (0-2,0.1,0)
will display damage textures when the hull of the current ship reaches 75%, 50% and 25% health, and the damage textures will be blended using the multiply blending mode. The following will add the shields down and beam effects to material:
frame_once = IEVT_SHIELDS_DOWN, LYR_SCREEN, Effects\GenericDamage.dat-2, 20, 0, 0.0, 0
frame_once = IEVT_TRACTOR_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-1, 20, 0, 0.0, 0
frame_once = IEVT_JAMMING_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-3, 20, 0, 0.0, 0
But wait, there's more...
https://www.youtube.com/watch?v=dtDG-14p3Po
Up to this point, all animations have been linked to global events: what you define in a .mat file as an animation will show on all instances of that ship -- which is why animations have been limited so far to the Exterior OPTs and the Cockpit (mostly). With ddraw version 2.0.5, it is now possible to define animations that only apply to specific ships once they trigger certain events. These are the events that are available at this moment:
IEVT_DAMAGE_75,
IEVT_DAMAGE_50,
IEVT_DAMAGE_25,
IEVT_SHIELDS_DOWN,
IEVT_TRACTOR_BEAM,
IEVT_JAMMING_BEAM
These events will apply hull damage, shields-down, tractor and jamming beam animations. For instance, when a single T/F is damaged in a flight group, only the damaged ship will display damage. These animations can be layered on top of regular textures using the LYR_SCREEN and LYR_MULT modifiers. LYR_SCREEN will use the screen blending mode and LYR_MULT will use the multiply blending mode. For example, the following:
anim_once = IEVT_DAMAGE_25, LYR_MULT, Effects\GenericDamage.dat, (0-0,0.1,0)
anim_once = IEVT_DAMAGE_50, LYR_MULT, Effects\GenericDamage.dat, (0-1,0.1,0)
anim_once = IEVT_DAMAGE_75, LYR_MULT, Effects\GenericDamage.dat, (0-2,0.1,0)
will display damage textures when the hull of the current ship reaches 75%, 50% and 25% health, and the damage textures will be blended using the multiply blending mode. The following will add the shields down and beam effects to material:
frame_once = IEVT_SHIELDS_DOWN, LYR_SCREEN, Effects\GenericDamage.dat-2, 20, 0, 0.0, 0
frame_once = IEVT_TRACTOR_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-1, 20, 0, 0.0, 0
frame_once = IEVT_JAMMING_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-3, 20, 0, 0.0, 0
But wait, there's more...
- blue_max
- Posts: 2284
- Joined: Wed Mar 20, 2019 5:12 am
Inherited Animations
Because it would be really tedious to make damage textures for every ship in the game, non-global (i.e. "Instance Events") can be attached to the Default material in a .mat file and that will cause _every texture_ in that ship to automatically inherit the events and animations. However, these inherited animations can be overriden for specific textures. For instance, in the following .mat file:
[Default]
Metallic = 0.5
Intensity = 0.5
Glossiness = 0.1
NMIntensity = 1
frame_seq = IEVT_SHIELDS_DOWN, LYR_SCREEN, Effects\GenericDamage.dat-2, 20, 0, 0.0, 0
frame_seq = IEVT_TRACTOR_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-1, 20, 0, 0.0, 0
frame_seq = IEVT_JAMMING_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-3, 20, 0, 0.0, 0
...
[TEX00005]
NormalMap = Effects\AssaultGunboat.dat-0-5
anim_once = IEVT_SHIELDS_DOWN, Effects\TieFighter.dat, (1-2,0.1,1)
The IEVT_SHIELDS_DOWN event is attached to the Default material, so all textures in this ship will display an animation when the shields go down -- even the ones without a section in the .mat file. However, TEX00005 defines its own IEVT_SHIELDS_DOWN, so that animation will override the animation inherited from the Default material.
In some cases, you may want to avoid displaying damage textures on some areas. In that case, you can override the events and replace them with blank textures. In the ZIP file for ddraw, the blank texture is 9-0, so you'd have to do something like this:
[TEX0000X]
anim_once = IEVT_DAMAGE_25, LYR_MULT, Effects\GenericDamage.dat, (9-0,0.1,1)
anim_once = IEVT_DAMAGE_50, LYR_MULT, Effects\GenericDamage.dat, (9-0,0.1,1)
anim_once = IEVT_DAMAGE_75, LYR_MULT, Effects\GenericDamage.dat, (9-0,0.1,1)
That will prevent hull damage events to be displayed on TEX0000X.
In a few words, this feature enables anyone to add support for damage textures, shields and beams to any ship with just a handful of lines.
But wait, there's even more...
Because it would be really tedious to make damage textures for every ship in the game, non-global (i.e. "Instance Events") can be attached to the Default material in a .mat file and that will cause _every texture_ in that ship to automatically inherit the events and animations. However, these inherited animations can be overriden for specific textures. For instance, in the following .mat file:
[Default]
Metallic = 0.5
Intensity = 0.5
Glossiness = 0.1
NMIntensity = 1
frame_seq = IEVT_SHIELDS_DOWN, LYR_SCREEN, Effects\GenericDamage.dat-2, 20, 0, 0.0, 0
frame_seq = IEVT_TRACTOR_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-1, 20, 0, 0.0, 0
frame_seq = IEVT_JAMMING_BEAM, LYR_SCREEN, Effects\GenericDamage.dat-3, 20, 0, 0.0, 0
...
[TEX00005]
NormalMap = Effects\AssaultGunboat.dat-0-5
anim_once = IEVT_SHIELDS_DOWN, Effects\TieFighter.dat, (1-2,0.1,1)
The IEVT_SHIELDS_DOWN event is attached to the Default material, so all textures in this ship will display an animation when the shields go down -- even the ones without a section in the .mat file. However, TEX00005 defines its own IEVT_SHIELDS_DOWN, so that animation will override the animation inherited from the Default material.
In some cases, you may want to avoid displaying damage textures on some areas. In that case, you can override the events and replace them with blank textures. In the ZIP file for ddraw, the blank texture is 9-0, so you'd have to do something like this:
[TEX0000X]
anim_once = IEVT_DAMAGE_25, LYR_MULT, Effects\GenericDamage.dat, (9-0,0.1,1)
anim_once = IEVT_DAMAGE_50, LYR_MULT, Effects\GenericDamage.dat, (9-0,0.1,1)
anim_once = IEVT_DAMAGE_75, LYR_MULT, Effects\GenericDamage.dat, (9-0,0.1,1)
That will prevent hull damage events to be displayed on TEX0000X.
In a few words, this feature enables anyone to add support for damage textures, shields and beams to any ship with just a handful of lines.
But wait, there's even more...
- blue_max
- Posts: 2284
- Joined: Wed Mar 20, 2019 5:12 am
Random Animation Groups
Because the world would be a very boring place if we only displayed the same damage textures over and over, there's a way to define multiple damage textures to add some variety. For instance, take a look at the following example:
[TEX00032]
anim_once = IEVT_DAMAGE_25, Effects\TieFighter.dat, (0-2,0.1,1)
anim_once = IEVT_DAMAGE_50, Effects\TieFighter.dat, (0-1,0.1,1)
anim_once = IEVT_DAMAGE_75, Effects\TieFighter.dat, (0-0,0.1,1)
anim_once = IEVT_DAMAGE_25, Effects\TieFighter.dat, (1-2,0.1,1)
anim_once = IEVT_DAMAGE_50, Effects\TieFighter.dat, (1-1,0.1,1)
anim_once = IEVT_DAMAGE_75, Effects\TieFighter.dat, (1-0,0.1,1)
anim_once = IEVT_DAMAGE_25, Effects\TieFighter.dat, (2-2,0.1,1)
anim_once = IEVT_DAMAGE_50, Effects\TieFighter.dat, (2-1,0.1,1)
anim_once = IEVT_DAMAGE_75, Effects\TieFighter.dat, (2-0,0.1,1)
In this example, IEVT_DAMAGE_* is defined multiple times for the same texture but with different textures and groups Ids. It may seem redundant at first, but each section defines a group of textures, so here we have 3 groups. The system will randomly select one of these groups and play the animations in the group. That way, damage textures can be incremental, like this:
Notice how each texture adds scorch marks to the previous one. The random selection is done on a per-ship basis. So different ships of the same type will get assigned different damage textures automatically.
And finally, there's one more thing we can do now...
Because the world would be a very boring place if we only displayed the same damage textures over and over, there's a way to define multiple damage textures to add some variety. For instance, take a look at the following example:
[TEX00032]
anim_once = IEVT_DAMAGE_25, Effects\TieFighter.dat, (0-2,0.1,1)
anim_once = IEVT_DAMAGE_50, Effects\TieFighter.dat, (0-1,0.1,1)
anim_once = IEVT_DAMAGE_75, Effects\TieFighter.dat, (0-0,0.1,1)
anim_once = IEVT_DAMAGE_25, Effects\TieFighter.dat, (1-2,0.1,1)
anim_once = IEVT_DAMAGE_50, Effects\TieFighter.dat, (1-1,0.1,1)
anim_once = IEVT_DAMAGE_75, Effects\TieFighter.dat, (1-0,0.1,1)
anim_once = IEVT_DAMAGE_25, Effects\TieFighter.dat, (2-2,0.1,1)
anim_once = IEVT_DAMAGE_50, Effects\TieFighter.dat, (2-1,0.1,1)
anim_once = IEVT_DAMAGE_75, Effects\TieFighter.dat, (2-0,0.1,1)
In this example, IEVT_DAMAGE_* is defined multiple times for the same texture but with different textures and groups Ids. It may seem redundant at first, but each section defines a group of textures, so here we have 3 groups. The system will randomly select one of these groups and play the animations in the group. That way, damage textures can be incremental, like this:
Notice how each texture adds scorch marks to the previous one. The random selection is done on a per-ship basis. So different ships of the same type will get assigned different damage textures automatically.
And finally, there's one more thing we can do now...
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2284
- Joined: Wed Mar 20, 2019 5:12 am
Removing textures when ships get disabled.
Textures can now be removed when a ship becomes disabled. This can be used to turn off engines or other effects. The format is:
[TEX000XX]
SkipWhenDisabled = 1
This can be used to turn off lights or other stuff on ships, but it requires the OPT to have these elements on separate textures.
Textures can now be removed when a ship becomes disabled. This can be used to turn off engines or other effects. The format is:
[TEX000XX]
SkipWhenDisabled = 1
This can be used to turn off lights or other stuff on ships, but it requires the OPT to have these elements on separate textures.
- blue_max
- Posts: 2284
- Joined: Wed Mar 20, 2019 5:12 am
Please look at the contents of the ddraw ZIP. I've added a file called Effects\GenericDamage.dat that has basic animations for shields down, beams and hull damage that can be used everywhere. Also look at the .mat files for the T/F and the GUN, they contain examples of how these effects can be used.
Enjoy!
Enjoy!
- Forceflow
- Posts: 7184
- Joined: Wed Oct 20, 1999 11:01 pm
- Contact:
This is really great work @blue_max, the possibilities this opens up are incredible. Cannot wait to see this being implemented into the ships. That will certainly add a lot of immersion!
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project
- the_stag
- Posts: 129
- Joined: Sun Jun 14, 2020 3:47 pm
This is awesome! I can't wait to see this implemented. As always, great work.
- Ace Antilles
- Posts: 7705
- Joined: Sat Jan 22, 2000 12:01 am
- Contact:
These new effects are going to make shooting stuff down even more fun. 
A look at some of the effects in action.
Jamming Beam in Red.
Tractor Beam in blue. Damage effects all over
I've actually toned this down on this particular opt but it gives you an idea.

A look at some of the effects in action.
Jamming Beam in Red.
Tractor Beam in blue. Damage effects all over
I've actually toned this down on this particular opt but it gives you an idea.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Great stuff. Are there other misc. game state events discovered from the engine ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.