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

**Tutorial** Changing ALE Colors

Here you find the different tutorials on editing and MODing Freelancer

Post Fri Jun 22, 2007 11:28 am

**Tutorial** Changing ALE Colors

Finally, a tutorial on how to edit ALE files in some way! Alcander taught me how to do this a few weeks ago, and now I shall pass along my knowledge to the Freelancer community. Here's what you'll need:

A Float -> Hex converter (it's the bottom download).

A Hex Editing program (I use xvi32, download at the very bottom).

An imaging program (Microsoft Paint works nicely), or something to show you what an RGB value will look like.

A calculator.

There are several unused effects in the game. I'll be editing one called ku_tachyon_01, which looks like this:



I am going to change the color of this from a golden-yellow to purple. Let's open ku_tachyon_01.ale in our hex editor. It's quite ugly, but finding the color values is actually easier than it seems. First, let me tell you about the odd way ALE files store color.

Color is stored in hexadecimal representations of float values. In the float/hex converter, put 1 into the top and click convert to hex; it will give you 3F800000. This is an RGB value of 255 (255 * 1 = 255). To get a value of, say, 128, divide 128 by 255 to get ~ .50196; put this into the top of the converter, convert, and you'll get 3F008073; this is the value for 128. Another hitch is that ALE files store these hex values backwards, meaning that 1 (aka 255) is 00 00 80 3F, while 128 is 73 80 00 3F; that is how you will see it in the ALE file. All values between .5 and 1 start with 3F (end with it, in the ALE files). 3F is, at least in my hex editor, '?', so finding the color values can be found by looking for # # # ? # # # ? # # # ? (# stands for any character). It is possible, however, that one of the colors is lower than .5 (which is 127.5 RGB'), and these would start with 3E, 3D, 3C, all the way down to 00 (though past about 3A, the value is so close to 0 that it is insignificant).

Another thing to note is the separations in the ALE file; there are the first set of impact, flash, proj, etc., followed by impact.app, flash.app, etc., and finally impact.emt, flash.emt, etc. The color values are stored in the .app part. They are usually stored near the beginning of each section, shortly after it says blah blah blah.app. For our example, well, I'll post the entire line of the first occurrence:

Line 32A:

E8 67 87 04 04 01 00 00 00 00 04 01 15 2F 90 3E F2 F0 70 3F 95 94 14 3F 9F 9E 9E 3E 00 02

The bold areas are the float values for the color. I have also noticed that the blue color value is followed by 00 02; this can help, in case one of the colors is 00 00 00 00. At any rate, plug these into the converter backwards, i.e. 3F70F0F2 for the red value. You should get the following float values: .941177, .580392, .309804. To get the RGB values, multiply this number by 255; you should get: 240, 148, 79. Put these into your paint program to get a familiar golden-yellow color.

When I converted it to purple, I used the RGB values of 219, 49, 238. Converting these to float gave me (after inverting them): 51 DA 5B 3F 14 D0 44 3E C0 EC 6E 3F, which I put into the ALE file (note that these are accurate to four decimals; you can take them out as far as you want).

I repeated this step for the other three .app parts of the ALE (NOTE: I wouldn't put them all as the same color, because that would probably give you a rather bland beam; I converted all four of the color sections in the ALE to float, and adjusted them close to the color I wanted in Microsoft Paint while keeping the same level of brightness, instead of picking some RGB values and putting them in). Once this is done, the ALE file will look like:



Wait, wrong one. (Looks through computer) Ah!



And here is a full loadout of purple weapons:



If you have any questions, please contact me or post in this thread, and I'll try to answer them. I want to point out that the technique was entirely discovered by Alcander; my only contribution is compiling it into a tutorial. I've had recent contact with him, and we may see him soon. At any rate, I hope to see some good new ALE files out there; I'm putting these babys into Freelancer Two <is still looking for help>.

MK

Edited by - mknote on 6/22/2007 3:08:23 PM

Dev

Post Fri Jun 22, 2007 1:31 pm

Just a followup on the post above, with (hopefully) clarifications:

The colors are always stored as twelve bytes in a row, with four bytes each for the red, green and blue values, in that order. Color values always go from 0 to 1, so if you look for numbers in that range you will eventually find what you want. However, to speed up the location process, start by looking about 80 bytes after the end of each .app. Some examples:

This is ci_photon_01.ale; the colors start 87 bytes from the end of ci_photon_01_proj.app:

gf_br_largeengine03.ale; the colors (for the flame effect) start 79 bytes from the end of gf_br_largeengine03.app:

gf_br_smallengine01_fire.ale; the colors start 87 bytes from the end of gf_br_smallengine01.app:

Start by changing one value to something very obvious, so that you will immediately know whether you've found the colors when you test it in-game. Once you're certain that you've found the colors, adjust as you want.

Post Sat Jun 23, 2007 2:30 pm

Very Interesting. This opens up a wide Range of Possibilitys. Well Done.

Post Tue Jun 26, 2007 3:44 pm

well this has been long awaited, thx for sharing.
question:
what about the size of particles, he tell you anything about that?

Post Tue Jun 26, 2007 3:59 pm

That'd be nice to know for a few of these complex ones with multiple spheres and rotating do-hickeys and beams firing off in random directions. Inner Sanctum lightning scaled down would be quite useful effect.

Post Tue Jun 26, 2007 5:22 pm

Unfortunatly, no, I don't know anything about the size of effects. I may ask him about it, though... I already have him thinking about something else, and I'd rather not be a burden.

MK

Dev

Post Tue Jun 26, 2007 8:39 pm

I've found the scaling constants in some specific cases, but it's generally not as easy to locate as coloration. For example, in gf_br_smallengine01_fire.ale the (spherical) scale is located at 0x222. For gf_br_largeengine03.ale, it's at 0x4AC. ci_photon_01.ale (and several other photon effects) has an overall scale at 0x826, a length scale at 0x83C and a width scale at 0x852.

Post Wed Jun 27, 2007 7:08 am

thanks Dev,
so i opened ci_photon_01.ale and went to address 0x826.

decode number gave me this:
00 as shortint: 0
00 00 as word: 0
00 00 as integer: 0
00 00 80 40 as longint: 1082130432
00 00 80 40 as 32 bit IEEE single: 4
00 00 80 40 00 02 E2 DA as 64 bit IEEE double: -6,24121582946094E129

are we looking at 32 bit IEEE single? seems like the only result that makes sense to me.
trying to get an image of the range of values, are they between 0-10, 100 or whatever..

Dev

Post Wed Jun 27, 2007 1:00 pm

Yeah, it's a floating point single. Most (if not all) values that you'll care about in the ALEs are singles.

Return to Freelancer Editing Tutorial Forum