New Animations and Events

All the XWAU recent release news from the project can be found here
Post Reply

New Animations and Events

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 03, 2022 12:01 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...

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 03, 2022 12:04 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...

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 03, 2022 12:09 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:

Hull75.jpg
Hull50.jpg
Hull25.jpg

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.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 03, 2022 12:10 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.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 03, 2022 12: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!

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7203
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Sat Sep 03, 2022 9:11 am

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

User avatar
the_stag
Rebel Alliance
Posts: 134
Joined: Sun Jun 14, 2020 3:47 pm

Post by the_stag » Sat Sep 03, 2022 3:18 pm

This is awesome! I can't wait to see this implemented. As always, great work.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Sep 11, 2022 12:48 am

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.
Jamming Beam.jpg

Tractor Beam in blue.
Tractor Beam.jpg
Damage effects all over
Damage1.jpg
Damage2.jpg

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.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Knarfe
Cadet 3rd Class
Posts: 42
Joined: Mon Feb 01, 2021 1:03 pm

Post by Knarfe » Mon Sep 12, 2022 1:18 pm

Will all this be in the next patch (6.0)?

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Mon Sep 12, 2022 5:12 pm

Knarfe wrote:
Mon Sep 12, 2022 1:18 pm
Will all this be in the next patch (6.0)?
Yes but there is no patch due anytime soon.
To add this to ships needs a lot of time and we're working on a new Mega Patch that will have it all in.
Hopefully towards end of the year.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Sep 16, 2022 7:14 am

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.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 17, 2022 5:40 am

Bman wrote:
Fri Sep 16, 2022 7:14 am
Great stuff. Are there other misc. game state events discovered from the engine ?
Not really, these events were already there -- I just couldn't enable them on a per-ship basis. If you have suggestions for other events, I can try and enable them later.

Post Reply