**Tutorial** Changing ALE Colors
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