Log inRegister
Editing explosions
Post new topic Reply to topic
View previous topic :: View next topic
Author Message

Joined: 18 Jun 2017
Posts: 8 on topic

Thank you for registering your game
PostPosted: Tue, 29. Aug 17, 02:13    Post subject: Editing explosions Reply with quote Print

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:

   • 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

Back to top
View user's profile Send private message

Joined: 08 Sep 2007

PostPosted: Wed, 30. Aug 17, 13:29    Post subject: Reply with quote Print

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.
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? Very Happy
I hope i was able to provide some help.

Back to top
View user's profile Send private message

Joined: 18 Jun 2017
Posts: 8 on topic

Thank you for registering your game
PostPosted: Wed, 30. Aug 17, 17:12    Post subject: Reply with quote Print

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:


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}

Back to top
View user's profile Send private message

Joined: 18 Jun 2017
Posts: 8 on topic

Thank you for registering your game
PostPosted: Wed, 30. Aug 17, 23:28    Post subject: Reply with quote Print

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:

//bodies for specific purposes
//body type;num bodies;
//[body id/name]
10661;10662;10663;10664;10665;10666;10670;10434;11997; 11994; 11998; 12000; 12001;

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":

TAT_TAGONESHOT; NULL; 0; 0; 80;                       // "80" is the number of sprites used




   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...

Back to top
View user's profile Send private message

Joined: 08 Sep 2007

PostPosted: Thu, 31. Aug 17, 17:57    Post subject: Reply with quote Print

You've missed the actual body itself Wink 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 Wink 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. Wink 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 Wink 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 Wink

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Wed, 20. Jun 18, 05:55

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.09284 seconds, sql queries = 19