Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

ALEs. Some answers. Some questions.

The general place to discuss MOD''ing Freelancer!

Post Sat Jul 23, 2005 7:27 pm

ALEs. Some answers. Some questions.

Okie doke folks... I have successfully figured out a few things about ALEs. I need some help to figure out the rest- there are several issues that aren't amenable to simple solutions, unfortunately.

First off, ALEs can consist of several things:

1. A procedural particle effect, purely rendered through Alchemy. Very few ALEs seem to operate this way. In fact, I'm not sure if any of them do, now.

2. A distorted TXM file projected onto a plane or planes, which may or may not have animation instructions. Animation instructions seem to consist of moving a "virtual camera" in X, Y coordinates to the next "frame position". Almost every special effect in FL is generated this way- I will provide some proof-of-concept screenshots below this post. These TXMs may have their RGB colors altered by instructions in the ALE, which is how we end up with different-colored engine flames, etc. The differences in the appearances of engine flames are due to which types of TXM are being applied, as well as their position and scale relative to the viewer.

In short... ALEs are basically a very fancy way of distorting/coloring TXM files, projecting them onto flat planes which are then re-presented to the viewer according to angle. In the case of things with definate dimensions, there may be multiple planes involved, which are each probably labled according to their sequence in animation. Animation of the ALEs for things like engines appears to be a sequence of on/off instructions, transparency instructions, and animation instructions (defining the XYZ positions or range in which the texture frame areas will be projected, which is how DA did things like make some of the engine flames "wiggle", smoke puffs semi-randomly move away from certain generators, etc).

Screenshots will follow below, but basically, what we need to get solved, in order to make totally custom ALEs, are these things:

1. Somewhere, probably in the ALEs themselves, a CRC or other reference to the TXMs that are "valid" for a given ALE. This explains why certain modifications to ALEs do not work- the user-desired changes simply do not "take". If we're going to build custom ALEs using the existing animations, then we're going to need to be able to refer to custom TXMs.

2. We need to crack the animation instructions. I have a feeling that that's easier than it appears- we're looking for state labels (there have to be states for the engine to check against) followed by animation instructions, which presumably include a reference to one or more planes.

Why am I so concerned about custom TXMs, btw? It's simple, really: I've tried several experiments, and while I've been able to alter the contents of existing TXM files without any problems, I have not been able to define new ones and have the game engine use them. Lengthy tests have left me with the conclusion that ... while we can remove TXM references from a given ALE, we cannot add new ones because the ALEs or TXM headers prevent the FL engine from "recognizing" new TXMs. Hopefully this is as simple as a CRC, but my attempts to find valid CRCs for a given TXM (I used smoke.txm as my test) have not proven successful. If somebody would please explain how to generate the infamous "reversed CRCs" which you engineering types have discovered in FL's files but nobody seems to have built an app. to generate, it would be appreciated- perhaps all I need to do is do a search for "smokecard.tga" as a reversed CRC. With that information in hand, I could define new TXMs that might be valid for any number of ALEs, which would open up HUGE new areas for us to mod.

Really, folks... even if we can't ever figure out the way that projection planes are defined and animated within the ALEs themselves... if we could just define new that could be called by existing ALEs, we'd have enormous leeway to make new visuals.

In case everybody thinks this is a waste of time, here's what I've been able to do with just a few changes to existing TXMs:

1. Rebuilt the smoke puffs to be half-size. Alcander apparantly colored the smoke puff's TGA a purple shade- what I did was a bit different. I doubled the size of the TGA, and halved the size of the resulting puff alpha. This has several obvious disadvantages- for one thing, it's grossly inefficient... for another, it means that other things that emit smoke puffs, unlike the thruster (which projects them as flat planes always square to the main camera), suddenly seem to be putting out "less" smoke. In actuality, they're still projecting the exact same number of smokepuffs... but the smaller size means that the resulting smoke looks a lot less robust. The only current way I can see to fix this is to double/treble the number of projectors to make it all look right again, which has obvious implications for game performance...



2. Halved the size of Planetflare. Planetflare is used for an unbelievably large number of things- it and Sarma are used just about everywhere that DA wanted a very generic effect.

As you can see, this halves the percieved dimensions of the texture, but it's still distorted along the frame rectangle to a given x,y position, so it looks pretty funky



3. Finally, messed with Sarma, which is used in a HUGE number of ALEs. Sarma is the "anything we want to look like teeny particles" effect, and it's used all over the place. In this case, I left the dimensions alone, but re-defined the texture, using something very distinctive. We can SEE the frames here- when this is animated, the effect is quite striking, believe me!



So... c'mon folks... help me out here. Alcander doesn't seem to be willing/able to discuss this, and if I can just get whatever it is that makes a TXM to be "unique", then I can define and create a whole range of Very Cool Things- everything from customized engine FX to new Explosions to new shot graphics. The possibilities, even if we can't figure out where an ALE's internal CRC reference is, or make new ones, is very, very large.

But if I can't define new TXMs... then I'm stuck. While I can mess about with smokepuffs, and that'll work OK because of the special limiting factors there, the other things are not amenable to alteration, because they get re-used in so many places, in so many contexts, that there will be a place somewhere where a change means that something looks dreadfully wrong

Post Sat Jul 23, 2005 7:43 pm

Nice work, very nice. I was wondering when somone would start making progress with those annoying alchemy files.

(Yeah, Im semi-back)

That rolling guy.
http://www.aegir.bur.st


Edited by - Aegir on 7/23/2005 8:45:26 PM

Post Sat Jul 23, 2005 8:07 pm

I've been doing experiments with this stuff for quite awhile. The sticking point with defining new TXMs has been where I've been getting stuck the whole time. I just felt maybe some screenshots might get people to realize that this isn't of imaginary value- we can do a lot've things with custom TXMs alone (let alone writing new ALEs somehow, but I'm not holding my breath).

For example... anybody notice that there is precisely one explosion FX used in the entire game? Yup... one. It's called, generically enough, "standardeffects.txm". If I could make more than one of these, I could write a whole series of custom explosions. Y'see, DA deliberately chose to do things with the frame rectangles, because they could re-use things over and over again. They fake out viewers by re-combining different images over and over again, which looks great and all, but it'd be nice (given that a gaming box these days can handle it) to have more, larger and more detailed explosions.

Post Sat Jul 23, 2005 11:45 pm

ALEs define which TXMs are called. I'm 99% sure now. The entries in the INI do not control which TXMs are being called, apparantly. Or, perhaps, there are CRCs buried in Alchemy.dll, but I think not- I think each ALE file has a section defining the TXM files that are being applied to their planar surfaces. If you remove a given TXM reference in the INI, then that does take the TXM out... but not in reverse.

The implication of this, of course, is that we should be able to find out how these TXMs are being referred to... and either change existing ALEs to refer to another TXM, or, better yet, make "new" ALEs that have the old animation instructions and frame sizes, but which refer to "new" TXMs.

Post Sun Jul 24, 2005 8:05 am

I thought we already pointed out what those CRCs were in our conversation in the ALE thread? They are UTF ID/CRC codes and come in two flavors: unsigned int (normal CRC) and signed int (reversed CRC). You can use either type as the game will recognize both but they are not the same length so if you are just hex editing you will have to stick to the type that the ALE file uses.

To change a reverse crc into a normal one here is the formula:

-rCRC + 4294967295 + 1

Don't forget to include the negative sign on the rCRC. Reverse the formula to get a reversed crc from a normal one. Keep in mind that the number you use in the ALE files cannot have a negative sign on it, you just use the number.

Post Sun Jul 24, 2005 8:36 am

Yeah, you pointed it out, and I forgot about it. My bad

Post Sun Jul 24, 2005 5:56 pm

I've just been incredibly busy lately and to sit down and break down all of the ALE files and document everything does take awhile. I have tomorrow free so hopefully I'll have some time to finish things up and post it here.

Edited by - Alcander on 7/24/2005 6:57:14 PM

Post Sun Jul 24, 2005 11:54 pm

I totally understand the "not having time" aspect of things. Hopefully we can get this sorted out, at least insofar as making "new" ALEs that contain new TXM entries is concerned... that would allow for a lot of really new possibilities here, all by itself. It'd be nice to also know how to alter the RGB values for things as well, and ultimately it'd be really nice to have some way to encode new ALEs from the ground up, of course.

Post Mon Jul 25, 2005 9:24 am

Just need the format specification and documentation, then byte-mashing time!

Post Mon Jul 25, 2005 11:27 pm

Well, I dunno about delivering specifications yet, but I'm hunting for the timers on animations. These are not the same as the FPS for a given animation, btw... that entry in animated TXMs does not appear to be obeyed

I found this out this evening, because I painted up a new explosion animation, just as a test, and found out (to my dismay) that the explosions do not run at anything like 60 FPS... instead, they appear to run at whatever speed the ALE calls for. With some ALEs, this means that they'll run quickly... with some, they run so slowly that anything but a very gradual explosion with extremely planned-out frames won't look very good at all

Post Thu Jul 28, 2005 12:25 pm

Ok, I made some interesting though extremely uncommon discoveries here.

I was playing with Sarma, trying to see if my idea of changing the TXM's Directory, nothing else, could make it possible to have new TXMs.

Well I discovered something extremely weird about Sarma...

I knew that things like tradelane, guns, hull hits, etc... used it. But I thought they were all independant (Meaning that IF we could make new TXMs they could be applied to let's say Engines but not weapons), but I was wrong!

And the thing that ties them all together is the only entry found into Data\FX\hull_hits\hull_hits_ale.ini (!). Change the Sarma path there, it will change for (from what I saw) :
-Tradelane effects
-Guns
-Engines
-Hull hits (Duh)

But it wont affect :
-Special effects like the yellow sun in one of the intro scenes (The one with a shiny rotating ring)

So now I am really wondering what could do this.
I searched for references to "gf_br_hull_impact01" into the INIs, and found that they were all in effects.ini
Then I tracked all the effects found, and they only went to shiparch.ini and solararch.ini. If the "surface_hit_effects" found there refer to an effect that refers to a Visual Effect that has a reference to a new Sarma TXM, then all the precedently listed effects will change to that too!

Now if anyone can explain me this weird behavior......

Post Fri Jul 29, 2005 12:02 am

so Argh have reversed (which i humbly suggest we call signed from now on to avoid confusion) CRC's done the trick for your TXMs?

Post Fri Jul 29, 2005 12:27 am

Yeh, that can work. I thought thinking of them as "reverse" CRCs would make it easier for modders but we can call them signed (vs. unsigned) I guess if we want to get more specific.

Post Fri Jul 29, 2005 1:06 am

Perhaps i'm missing something... The only way signed or unsigned could make a difference is in human readability when output to inis... if FL reads it as an unsigned 32bit then internally it's identical. Just my 2 pennies worth.

Return to Freelancer General Editing Forum