Editing explosions

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
OatmealMu
Posts: 9
Joined: Sun, 18. Jun 17, 02:56
x3ap

Editing explosions

Post by OatmealMu » Tue, 29. Aug 17, 02:13

I'm trying to edit the explosion effects the game uses. Things were going well enough until I got to the effect used for capital ships and stations. For whatever reason, the explosion effect uses three identical animations layered on top of each other. I'd like to limit the number of layers used. How do I do this?

I've looked through the settings files and found nothing. I also extracted the appropriate .bod/.bob files and loaded them up in 3ds Max. Unfortunately, each file contains a single plane and nothing else.

This is what I've figured out so far:

Code: Select all

	• Large explosion anatomy
		• Animations.txt
			• Points to files used in the animation
				• Xtm_nuke_flash1a
				• Xtm_nuke_flash1b
				• Xtm_nuke_flash1c
				• Xtm_nuke_flash1d
				• Xtm_nuke_flash1e
				• No file extensions are used
			• Tells game how many images the animation uses
				• 80
			• Gives coordinates of each image on sprite sheet
				• I think…
			• Indicates how long the animation is, although I'm not sure which time scale is used
				• 3600
		• Bodies.txt
			• Designates body type
				• SBTYPE_2D
			• Number of bodies
				• 39
			• Body ID number
				• 11994
		• Effects.txt
			• Effect ID
				• 602
			• Flags
				• Various effect tweaks, both visual and physical
			• 3D flags
				• 2D
					• Flattens effect. This is how I realized that the largest explosion is composed of three layers squished together

Aydan
Posts: 238
Joined: Sat, 8. Sep 07, 20:56

Post by Aydan » Wed, 30. Aug 17, 13:29

As it sounds you're trying to squeeze out some performance by reducing the graphical load when this happens. The form and shape can be found in the effects.txt, as you already have figured out. Look for the ID you found in that txt file and copy the entry. Paste it at the bottom and don't touch the original ones in their order. Give it the highest ID and point your explosion to that ID instead of the 602.

Now you can change several things without screwing up other animations pointing to that ID. Afaik in the effects you can change that animation in rotation, length etc. There's an own UI for things like that in the X3 Editor. I'd suggest starting with an old effects.txt from X3:Reunion, as it is a lot more structured than those from AP. There were far too many entries from different people, and so it gets a bit messy, regarding the technique they use to achieve certain effects.
But...
If you want to change explosions to give you a bit more performance, than start editing the dds files used for the planes. Extremely often there are left overs, as the people tend to use simply the alpha channel to block out a certain type of color and display it as transparent. dds files are displayed different ingame. Of course you can have simply the alpha channel color and declare it as transparent, but the color as such is still there. If you do this, you get a halo around your texture, if its in front of a very bright object, like a sun. Reflections and light dimming is still displayed. It's a lot better to remove any color information in the dds file itself from the pixels that needs to be tranparent. Then the game engine doesn't calculat reflections and reduced light. The texture itself doesn't weigh that much on the actual rendered screen.

To remove the color information in GIMP, start with a dds that has a transparent background in the exact color of the alpha channel. Next step, fill the complete picture with the exact alpha channel color. Paint or paste your desired texture on top of that and fill the remaining parts with the visible alpha channel color with a very bright green/blue... most importantly a color which doesn't exist in the texture you've painted/pasted. Now pick the pipette tool and click on the color you've filled the gaps and declare it as the new alpha channel color. That removes all the color informations about the old alpha channel color. It's a problem in the...hm... compression of dds files. Don't know if it's the compression but anyway... how dds files are generated in GIMP and why you get all those glowy artifacts if you look at your work and a star is behind the explosion. Depending on the size of effect you want to achive, it save up to 45% as you've cut away invisible texture edges, which are not displayed but calculated by the game engine.

I did a lot of new bullets and had to fight the same difficulties. The worst nightmares gave those on impact animtions. The dds files for the explosions are simply in the texture folders. You need to look down to cat/dat 6 or 7, as they'll be probably from stoneage and reused a lot of times. Recycling is a natural habit in the X series... did you know that PSPs had been stars before? :D
I hope i was able to provide some help.

OatmealMu
Posts: 9
Joined: Sun, 18. Jun 17, 02:56
x3ap

Post by OatmealMu » Wed, 30. Aug 17, 17:12

Right now, I'm not too interested in performance gains. Rather, I'm in the process of replacing the game's visual effects. I've already replaced the shockwave effect and have moved onto explosions. Problem is, the test explosion doesn't work with how the game does large explosions. Take a look:

https://i.imgur.com/HrBOYrf.png

Notice how obvious it is that the sprite is duplicated and slightly offset. This is less of an issue with the vanilla explosion as it's mostly a big, white ball of light. Hopefully, the effect isn't hard-coded and can be changed.

Anyway, thanks for the advice. About the only thing I haven't tried is creating a whole new effect in "Effects.txt". And you're absolutely right about the texture recycling. Did you know that one of the lens flare effects is actually a scaled down sun texture? And don't get me started on the lack of naming conventions and nondescript body IDs that point to more nondescript body IDs. At least Litcube named the nebulae textures in a sensible manner.



{Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked - Terre}

OatmealMu
Posts: 9
Joined: Sun, 18. Jun 17, 02:56
x3ap

Post by OatmealMu » Wed, 30. Aug 17, 23:28

I made a new effect in "Effects.txt" and attached it to some Xenon capital ships. I put a single body on it: "11994". I'd hoped that some other entry was causing the duplicate sprites. Alas, the problem persists. So, if it's not "Effects.txt" causing the problem, what is?

Best I can figure, the issue lies within "11994". Unfortunately, I can only find two references to "11994": in "Effects.txt" and in "Bodies.txt", and the former's been ruled out. That leaves me with "Bodies.txt". Problem is, "11994" is mentioned only once at the beginning of the file:

Code: Select all

//bodies for specific purposes
//body type;num bodies;
//[body id/name]
SBTYPE_2D;39;
78;385;428;254;587;589;592;593;594;10653;10655;10656;10657;10658;10659;10660;
10661;10662;10663;10664;10665;10666;10670;10434;11997; 11994; 11998; 12000; 12001; 
12002;12003;12004;12005;12006;12008;
effects\menugfx\dockhere;
effects\menugfx\docked;
environments\asteroids\asteroiddust;
ships\terraformer\cpuship_destr_d;
How does the game know that "11994" is the explosion animation? "Animations.txt" lists the sprites used among other things, but doesn't give the animation an ID. Here's what's in "Animations.txt":

Code: Select all

TAT_TAGONESHOT; NULL; 0; 0; 80;                       // "80" is the number of sprites used
	TATF_COORDS;xtm_nuke_flash1a;45;0.00;0.00;
	TATF_COORDS;xtm_nuke_flash1a;45;0.25;0.00;
	TATF_COORDS;xtm_nuke_flash1a;45;0.50;0.00;
	TATF_COORDS;xtm_nuke_flash1a;45;0.75;0.00;
	TATF_COORDS;xtm_nuke_flash1a;45;0.00;0.25;
	TATF_COORDS;xtm_nuke_flash1a;45;0.25;0.25;
	TATF_COORDS;xtm_nuke_flash1a;45;0.50;0.25;
	TATF_COORDS;xtm_nuke_flash1a;45;0.75;0.25;
	TATF_COORDS;xtm_nuke_flash1a;45;0.00;0.50;
	TATF_COORDS;xtm_nuke_flash1a;45;0.25;0.50;
	TATF_COORDS;xtm_nuke_flash1a;45;0.50;0.50;
	TATF_COORDS;xtm_nuke_flash1a;45;0.75;0.50;
	TATF_COORDS;xtm_nuke_flash1a;45;0.00;0.75;
	TATF_COORDS;xtm_nuke_flash1a;45;0.25;0.75;
	TATF_COORDS;xtm_nuke_flash1a;45;0.50;0.75;
	TATF_COORDS;xtm_nuke_flash1a;45;0.75;0.75;

	TATF_COORDS;xtm_nuke_flash1b;45;0.00;0.00;
	TATF_COORDS;xtm_nuke_flash1b;45;0.25;0.00;
	TATF_COORDS;xtm_nuke_flash1b;45;0.50;0.00;
	TATF_COORDS;xtm_nuke_flash1b;45;0.75;0.00;
	TATF_COORDS;xtm_nuke_flash1b;45;0.00;0.25;
	TATF_COORDS;xtm_nuke_flash1b;45;0.25;0.25;
	TATF_COORDS;xtm_nuke_flash1b;45;0.50;0.25;
	TATF_COORDS;xtm_nuke_flash1b;45;0.75;0.25;
	TATF_COORDS;xtm_nuke_flash1b;45;0.00;0.50;
	TATF_COORDS;xtm_nuke_flash1b;45;0.25;0.50;
	TATF_COORDS;xtm_nuke_flash1b;45;0.50;0.50;
	TATF_COORDS;xtm_nuke_flash1b;45;0.75;0.50;
	TATF_COORDS;xtm_nuke_flash1b;45;0.00;0.75;
	TATF_COORDS;xtm_nuke_flash1b;45;0.25;0.75;
	TATF_COORDS;xtm_nuke_flash1b;45;0.50;0.75;
	TATF_COORDS;xtm_nuke_flash1b;45;0.75;0.75;

	TATF_COORDS;xtm_nuke_flash1c;45;0.00;0.00;
	TATF_COORDS;xtm_nuke_flash1c;45;0.25;0.00;
	TATF_COORDS;xtm_nuke_flash1c;45;0.50;0.00;
	TATF_COORDS;xtm_nuke_flash1c;45;0.75;0.00;
	TATF_COORDS;xtm_nuke_flash1c;45;0.00;0.25;
	TATF_COORDS;xtm_nuke_flash1c;45;0.25;0.25;
	TATF_COORDS;xtm_nuke_flash1c;45;0.50;0.25;
	TATF_COORDS;xtm_nuke_flash1c;45;0.75;0.25;
	TATF_COORDS;xtm_nuke_flash1c;45;0.00;0.50;
	TATF_COORDS;xtm_nuke_flash1c;45;0.25;0.50;
	TATF_COORDS;xtm_nuke_flash1c;45;0.50;0.50;
	TATF_COORDS;xtm_nuke_flash1c;45;0.75;0.50;
	TATF_COORDS;xtm_nuke_flash1c;45;0.00;0.75;
	TATF_COORDS;xtm_nuke_flash1c;45;0.25;0.75;
	TATF_COORDS;xtm_nuke_flash1c;45;0.50;0.75;
	TATF_COORDS;xtm_nuke_flash1c;45;0.75;0.75;

	TATF_COORDS;xtm_nuke_flash1d;45;0.00;0.00;
	TATF_COORDS;xtm_nuke_flash1d;45;0.25;0.00;
	TATF_COORDS;xtm_nuke_flash1d;45;0.50;0.00;
	TATF_COORDS;xtm_nuke_flash1d;45;0.75;0.00;
	TATF_COORDS;xtm_nuke_flash1d;45;0.00;0.25;
	TATF_COORDS;xtm_nuke_flash1d;45;0.25;0.25;
	TATF_COORDS;xtm_nuke_flash1d;45;0.50;0.25;
	TATF_COORDS;xtm_nuke_flash1d;45;0.75;0.25;
	TATF_COORDS;xtm_nuke_flash1d;45;0.00;0.50;
	TATF_COORDS;xtm_nuke_flash1d;45;0.25;0.50;
	TATF_COORDS;xtm_nuke_flash1d;45;0.50;0.50;
	TATF_COORDS;xtm_nuke_flash1d;45;0.75;0.50;
	TATF_COORDS;xtm_nuke_flash1d;45;0.00;0.75;
	TATF_COORDS;xtm_nuke_flash1d;45;0.25;0.75;
	TATF_COORDS;xtm_nuke_flash1d;45;0.50;0.75;
	TATF_COORDS;xtm_nuke_flash1d;45;0.75;0.75;

	TATF_COORDS;xtm_nuke_flash1e;45;0.00;0.00;
	TATF_COORDS;xtm_nuke_flash1e;45;0.25;0.00;
	TATF_COORDS;xtm_nuke_flash1e;45;0.50;0.00;
	TATF_COORDS;xtm_nuke_flash1e;45;0.75;0.00;
	TATF_COORDS;xtm_nuke_flash1e;45;0.00;0.25;
	TATF_COORDS;xtm_nuke_flash1e;45;0.25;0.25;
	TATF_COORDS;xtm_nuke_flash1e;45;0.50;0.25;
	TATF_COORDS;xtm_nuke_flash1e;45;0.75;0.25;
	TATF_COORDS;xtm_nuke_flash1e;45;0.00;0.50;
	TATF_COORDS;xtm_nuke_flash1e;45;0.25;0.50;
	TATF_COORDS;xtm_nuke_flash1e;45;0.50;0.50;
	TATF_COORDS;xtm_nuke_flash1e;45;0.75;0.50;
	TATF_COORDS;xtm_nuke_flash1e;45;0.00;0.75;
	TATF_COORDS;xtm_nuke_flash1e;45;0.25;0.75;
	TATF_COORDS;xtm_nuke_flash1e;45;0.50;0.75;
	TATF_COORDS;xtm_nuke_flash1e;45;0.75;0.75; 3600;// 93 XT nuke flash1 'explosion' medium-long
I figure that there's something in between "Bodies.txt" and "Animations.txt" that I'm missing -- some bit of data that gives the explosion it's ID and duplicates the animation.

I hope this isn't hard-coded...

Aydan
Posts: 238
Joined: Sat, 8. Sep 07, 20:56

Post by Aydan » Thu, 31. Aug 17, 17:57

You've missed the actual body itself ;) Bullets and explosions are existing objects in the game engine who are using simple planes. I'd suggest looking for a bod/bob named "11994" or better "SBTYPE_2D". You never know ;) but the entry points at SBTYPE_2D. That's probably an ID, not a flag. In that file the actual planes are defined, which side the plane is facing with its texture. In bullets it's often times that they use 8 instead of 4 planes, to enhance the visible color in terms of saturation, by having them rotated 180°. The upside is that you get a highly saturated image on screen, the downside is that you display a lot more polys than needed. /edit: You need to do this in a proper way.... the bodies are often in use for other things. Probably also for smaller explosions, so copy your body file (not the txt, the bob/bod file) and rename it, then point your new entry you made yourself to that. ;) Otherwise you'll get weird results and you need to go through the whole bob/bod tranfers again.

The entry you posted is defining the actual body first, the following numbers are length, rotation, shrink and grow definition and some other flags. The numbers from 10653 are actually dds files used on the bod/bob planes which are displayed and removed in the order given in that entry. Afaik they're somewhere very deep in the cat/dats "v" folder, but i did that 7 years ago and i may not remember correctly where they are... search for 10*.dds if you have unpacked the cat/dats.
Try to use an older version of the X3 Editor if you can get your hands on that and work with a effects.txt from X3:Reunion. This is a lot more understandable, as the X3 Editor UI is explaining a lot of the entries you can see here as sheer numbers. If you look just at the effects.txt your only hope will be that someone from the darkages of X Series is still alive and working in the Ego dev team. If he does have a lot of time and patience he may be able to shed some light on the queue of numbers, their meaning and the time/length scale which is in use. Even the old X3 Editor isn't able to pin down any effect, but at least it's better to understand. AP is a lot worse, because there are mixed entries and new animations from several people using the effects.txt in a different way. So Albion Prelude is not really good to dig something out.

You shouldn't temper the animation.txt, as these entries are called by a lot of different things and just define the deformation, but not the source of the animation itself. You can see that as these are x;y;z pairs of coords, not IDs nor time lengths or rotations.
As far as the engine goes, you'll find pairs of three if they're coords. As soon as you get into movement entries, there are rotation modifiers added (xyz for coords and abc for rotation->yaw, pitch, roll). That's most common in the universe map, if the models of asteroids/fabs are located in the sector entry. So you can define by just looking at the numbers what it'd be. Every other entry is most commonly an ID type or something defining a length.
So to change your explosion, your best bet is to stick with the effects and body txt files. Replace the files 10653 to 10670 with something very easy to recognise, like a red square. Never use spheres or circles ;) You won't recognise any rotation. Have a look at the bod/bob file, the X3 Editor can transfer bob to bods and vice versa, so can load them into GMax or something similar. Most important, don't try to figure out which entry doea what in effects, use the X3 Editor. Otherwise it gets really frustrating to figure out which number does what. It takes literally days to dig through this, and most of the old modders who could help are long gone ;)

WuDeN
Posts: 29
Joined: Tue, 7. May 13, 16:00
x3ap

Re:

Post by WuDeN » Fri, 26. Oct 18, 16:34

Aydan wrote:
Thu, 31. Aug 17, 17:57
You've missed the actual body itself ;) Bullets and explosions are existing objects in the game engine who are using simple planes. I'd suggest looking for a bod/bob named "11994" or better "SBTYPE_2D". You never know ;) but the entry points at SBTYPE_2D. That's probably an ID, not a flag. In that file the actual planes are defined, which side the plane is facing with its texture. In bullets it's often times that they use 8 instead of 4 planes, to enhance the visible color in terms of saturation, by having them rotated 180°. The upside is that you get a highly saturated image on screen, the downside is that you display a lot more polys than needed. /edit: You need to do this in a proper way.... the bodies are often in use for other things. Probably also for smaller explosions, so copy your body file (not the txt, the bob/bod file) and rename it, then point your new entry you made yourself to that. ;) Otherwise you'll get weird results and you need to go through the whole bob/bod tranfers again.

The entry you posted is defining the actual body first, the following numbers are length, rotation, shrink and grow definition and some other flags. The numbers from 10653 are actually dds files used on the bod/bob planes which are displayed and removed in the order given in that entry. Afaik they're somewhere very deep in the cat/dats "v" folder, but i did that 7 years ago and i may not remember correctly where they are... search for 10*.dds if you have unpacked the cat/dats.
Try to use an older version of the X3 Editor if you can get your hands on that and work with a effects.txt from X3:Reunion. This is a lot more understandable, as the X3 Editor UI is explaining a lot of the entries you can see here as sheer numbers. If you look just at the effects.txt your only hope will be that someone from the darkages of X Series is still alive and working in the Ego dev team. If he does have a lot of time and patience he may be able to shed some light on the queue of numbers, their meaning and the time/length scale which is in use. Even the old X3 Editor isn't able to pin down any effect, but at least it's better to understand. AP is a lot worse, because there are mixed entries and new animations from several people using the effects.txt in a different way. So Albion Prelude is not really good to dig something out.

You shouldn't temper the animation.txt, as these entries are called by a lot of different things and just define the deformation, but not the source of the animation itself. You can see that as these are x;y;z pairs of coords, not IDs nor time lengths or rotations.
As far as the engine goes, you'll find pairs of three if they're coords. As soon as you get into movement entries, there are rotation modifiers added (xyz for coords and abc for rotation->yaw, pitch, roll). That's most common in the universe map, if the models of asteroids/fabs are located in the sector entry. So you can define by just looking at the numbers what it'd be. Every other entry is most commonly an ID type or something defining a length.
So to change your explosion, your best bet is to stick with the effects and body txt files. Replace the files 10653 to 10670 with something very easy to recognise, like a red square. Never use spheres or circles ;) You won't recognise any rotation. Have a look at the bod/bob file, the X3 Editor can transfer bob to bods and vice versa, so can load them into GMax or something similar. Most important, don't try to figure out which entry doea what in effects, use the X3 Editor. Otherwise it gets really frustrating to figure out which number does what. It takes literally days to dig through this, and most of the old modders who could help are long gone ;)
EDITED: Better to go with my post below
Last edited by WuDeN on Sat, 27. Oct 18, 00:44, edited 1 time in total.

WuDeN
Posts: 29
Joined: Tue, 7. May 13, 16:00
x3ap

Bigger, longer lasting explosions 'how to'

Post by WuDeN » Fri, 26. Oct 18, 22:07

Hi eeveryone !

So I'm using litcube/mayhem and after making some light touches to their amazing work I really wanted to improve the explosions a little bit but I'm at a loss when it comes to the animations/effects .txt files.

Basically what I'm trying to accomplish is:

1) Quadruple the duration of the explosion animation for any given ship (ie it takes a ship 4x times longer to finish exploding)

2) Assign capital explosion animation to every ship, assign factory explosion to capitals.
(I can make some adjustments later if it's too overdone or too huge of a performance hog)

I thought it'd be an 'easy' job, just interchanging some values but when I started looking at the effects and animation files I was just totally lost lol. Went around looking in the forum but I can't find the answers I'm looking for.

Anybody know how to go about this ?

Thank you

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30436
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Editing explosions

Post by Alan Phipps » Fri, 26. Oct 18, 22:19

@ WuDeN: Since you have already reanimated this dormant thread, I'll move your other explosions modding question here too.
A dog has a master; a cat has domestic staff.

WuDeN
Posts: 29
Joined: Tue, 7. May 13, 16:00
x3ap

Re: Editing explosions

Post by WuDeN » Fri, 26. Oct 18, 22:26

Alan Phipps wrote:
Fri, 26. Oct 18, 22:19
@ WuDeN: Since you have already reanimated this dormant thread, I'll move your other explosions modding question here too.
Thank you Alan ! Yes sorry, I thought it might be more appropriate to start my own thread because I felt I may of been highjacking his, but yeah I mean it's been like a year and best compile everything into one, much appreciated.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”