Tweaking Engine Glows
-
Greetings one and all,
I’m part of the development team on the Freeworlds 2.0 project, having answered the call Sushi gave for junior coders to help out. I’ll be honest, I’m pretty new to the world of coding. I’m learning as I go but there is so much I just don’t know. I got ideas, just lack the precise knowledge on how to execute it!
I’ve gotten far enough in regards to some tasks, such as adding ships and the like, thanks to Sushi teaching me and others. While doing this, it got me thinking about doing engine glows for the ships.
I know there are a few tutorials regarding messing with ALE files, but they all, to me at least, seem a bit generalised. I haven’t found anything specific tutorial wise specificly regarding doing engine glows. If there is, and I missed it, would be much obliged to be pointed in that direction.
Originally, I considered using the stock FL ones, but there are only so much. I do understand them, even took pictures of the various engines as a catalogue dictionary of which engine number effect did which. Helpful for understanding. But I’d really like to go one step forward and be able to tweak them.
I’d be happy to even know which elements of the coding I need to look towards to even tweak engine glow colours. While complete news would be nice, I’m also trying to keep them sensible to the Star Wars slant. So if I know how to change colours on a basic engine glow files, that would be awesome.
Hopefully someone can point this wet behind the ears coder in the right direction regarding this.
-
I think ALEs are much too vast for there to be specific references. Engine glows follow certain patterns, but it’s still very freeform in how you decide to code them, depending on what effect you want to have in the end.
Your best bet is to download the ALE Editor from Digital Brilliance and just open up an engine file. You should stick with “smallengine” ALEs, as they have more details and generally work better. I’d say you can safely ignore playtrail and trail ALEs, as those are for engine trails you see on ships other than yours and are therefore details. I believe (not sure here) that “_fire” is for cruise while not having any suffix is the actual glow.
Once you open them up with the ALE Editor, you should be able to see a structure. Go ahead and open up quite a few; you’ll see patterns pretty soon. If you want to modify colors, open up the ANL files (not AEL) from what the editor gave you and look for “BasicApp_Color”. You will have at least one “SubEntry” under this node. Basically, you can add as many subentries as you desire, each being considered a keyframe in an animation. The formatting is T, R, G, B. T is a multiplier for the time, from 0 to 1, which you need to use with the particle’s lifetime (found under the Emitter related to the Appearance as Emitter_InitLifeSpan). So 0.5 on a lifetime of 2 would make the particle be of the color you chose at 1 second. RGB are all color values, from 0 to 1. Again, those are multipliers. A good way to calculate decimal RGBs is to pick the color you want in “standard” RGB (from 0 to 255) and then to divide each number by 255. Multiply by 255 to reverse the process. FLDev, which is available here, has an integrated parser for those calculations.
So, an example would be:
SubEntry = 0, 1, 1, 1 SubEntry = 0.5, 0 0, 1 SubEntry = 1, 0, 1, 0
This would make the particle be white at first, then blue at half of its lifetime and green at the very end.
Again, I highly suggest you just toy around with it; remember to make backups though!
If you have any question, feel free to ask. Hope this’ll get you started
-
Thanks for that, definitely know more than a did a few hours ago!
A quick follow up question, how do I repack the ANL and AEL files back into an ALE file. Realised after trying to tweak a little bit that I had no discernible way to put the decoded file back together.
-
Just use the ALE Editor, click on the “encode” button and browse to your ANL file; it’ll give you a TALE file which you can rename to ALE and then use just like you usually would.
-
Oooh, now we are getting somewhere.
I decided to just test out your above example, to see how it came off. So here is the ‘spot the difference’ image of it.
I plan to tweak around it more in the morning to see what else I can learn by trial and error. I could probably bet a couple of bob I’ll be back with more questions soon enough as I dig deeper and try to learn more.
Thanks for the assist!
-
Yeah… my plan is to work custom glows for each ship, or at least have generic ones that suit all. Ambitious, but I figure I might as well aim high and miss than aim low and miss.
I do have a follow up, question. This is concerning the engine_ale file and the coding for each Visual Effect.
[VisEffect] nickname = gf_ci_smallengine01_fire alchemy = fx\engines\gf_ci_smallengine01_fire.ale effect_crc = 255026680 textures = fx\planetflare.txm
Now, I understand pretty much all of it, except the ‘effect_crc’ line. From what I have learned, the numbers in that are specific to each effect. So how does one come up with these numbers. I’d rather have the modified glows with their own line of code, rather than just have them overwriting the vanilla code.
-
@omayksilo:
Yeah… my plan is to work custom glows for each ship, or at least have generic ones that suit all. Ambitious, but I figure I might as well aim high and miss than aim low and miss.
I do have a follow up, question. This is concerning the engine_ale file and the coding for each Visual Effect.
[VisEffect] nickname = gf_ci_smallengine01_fire alchemy = fx\engines\gf_ci_smallengine01_fire.ale effect_crc = 255026680 textures = fx\planetflare.txm
Now, I understand pretty much all of it, except the ‘effect_crc’ line. From what I have learned, the numbers in that are specific to each effect. So how does one come up with these numbers. I’d rather have the modified glows with their own line of code, rather than just have them overwriting the vanilla code.
This is precisely why I wrote this tutorial. Duplicating effects is one of the most important things in modding ALEs.
http://the-starport.net/index.php?option=com_smf&Itemid=26&topic=985.msg7738#msg7738
-
Hey guys,
Hope you don’t mind if I follow up my first round of questioning with another. Figured it was easier to re-use this thread rather than waste space with another!
I have been plodding away with my work on the engine glows. I’ve been putting the knowledge and direction you guys gave me to good use. Don’t get me wrong, nothing I am doing is groundbreaking, but given my extremely limited knowledge of coding - I am pulling off exactly what I was hoping for and everyone on the mod project is delighted with it.
Like I said, I have a few follow-ups that I am hoping you can point me in the right direction. While I have a rough idea about what each section of the ALE code does, there are a couple of functions I could really do with knowing which lines of code to look for.
The first of which is the length of the engine glow trail. I thought I had stumbled upon it in the ‘Node Transform’ part of the code, but, well… lets just say the result was what was known as an ‘X-Wing Engines on Viagra’ scenario. So, if there is a specific line/lines/section I need to be looking at for that, be much obliged.
Secondly, is the overall size of the glow. There are a few ships that have the engine exhausts quite close together, for example, the ETA-2 Jedi Starfighter, that would be complimented if I could just decrease the overall size of engine glow.
Finally, is there any way to keep the engines the same… intensity throughout the power build up? This is just something I have been toying with - wanting to keep the engine glow pretty much the same throughout power up/power down, since Star Wars isn’t known for mad trails from there engine. I have them edited it down right now that they are not too long at all. But, if I can go that one step further, why not go all the say, I say.
So again, anyone who can point me in the direction of the needle in the haystack, be much obliged. If not, well, thanks for giving me the time of day and reading this.
-
@omayksilo:
The first of which is the length of the engine glow trail. I thought I had stumbled upon it in the ‘Node Transform’ part of the code, but, well… lets just say the result was what was known as an ‘X-Wing Engines on Viagra’ scenario. So, if there is a specific line/lines/section I need to be looking at for that, be much obliged.
Length of the glow can be adjusted by adjusting the time the engine flame particles have to live. This value is set in the emitter, with a property of something to the effect of “lifespan” or “timetolive”. I cannot recall off the top of my head, but you will know it when you see it.
Secondly, is the overall size of the glow. There are a few ships that have the engine exhausts quite close together, for example, the ETA-2 Jedi Starfighter, that would be complimented if I could just decrease the overall size of engine glow.
The size of a particle is adjusted by the particle itself, not the emitter. Under the appearance section of the particle your looking for, there will be a size setting.
the format is SubEntry: time, size, time, size, time, size, etc…
With time being a multiple of the time to live set by the emitter. For example if your particle has a lifespan of 10 seconds, a value of 0.1 in the time means that at 1 second, the particle has a set size.
Finally, is there any way to keep the engines the same… intensity throughout the power build up? This is just something I have been toying with - wanting to keep the engine glow pretty much the same throughout power up/power down, since Star Wars isn’t known for mad trails from there engine. I have them edited it down right now that they are not too long at all. But, if I can go that one step further, why not go all the say, I say.
I believe you are asking for engine size to not be affected by throttle correct? This is hidden somewhere in the emitter’s frequency setting. I had recently done this to engine trails, so that they show up at full power regardless of throttle settings. However it was a very specific part of I believe the frequency setting that controlled this. I will reply later with more information.
One last thing, I stay far, far away from the Node Transform, its a very scary thing that I haven’t a clue how to adjust. Nearly everything I try to adjust in there ends in the effect being invalid, not showing up at all, or doing something completely different from what I need. I simply find the effect closest to what I need, and copy paste its node transform.
-
I knew I should’ve taken notes
I had it all figured out a while ago, but I forgot bits of it. I’ll try to piece it back together, but in a nutshell:
If you want to modify one axis of the particle effect you are working with, add a basic Node_Transform to your Appearance in this way:
Node_Transform = { Flag = 4 Header = 0.0000000000000000, 0.0000000000000000 HFlag = 4 HTail = 0 Header = 0.0000000000000000, 0.0000000000000000 HFlag = 4 HTail = 0 Entry = 0.0000000000000000, 0.0000000000000000 EFlag = 4 EType = 1 ETail = 0 Entry = 0.0000000000000000, 0.0000000000000000 EFlag = 4 EType = 1 ETail = 0 Entry = 0.0000000000000000, 0.0000000000000000 EFlag = 4 EType = 1 ETail = 0 Entry = 0.0000000000000000, 0.0000000000000000 EFlag = 4 EType = 1 ETail = 0 Entry = 0.0000000000000000, 1.0000000000000000 EFlag = 4 EType = 1 ETail = 0 Entry = 0.0000000000000000, 1.0000000000000000 EFlag = 4 EType = 1 ETail = 0 Entry = 0.0000000000000000, 1.0000000000000000 EFlag = 4 EType = 1 ETail = 0 }
Now, I don’t exactly remember which Entry controls which axis (x, y, z) in which way (translation, rotation, scale), but I’m pretty sure the three MIDDLE ones control rotation (that is, the 4th to 6th). In order to actually make the Entry editable, you have to swap the trailing ETail to 16 and add the following code:
SEntry = SFlag = 0
The bigger nut to crack is SEntry, which uses keyframes kept as four different values: initial value, final value, initial speed, final speed, with speeds being in metric per second. For example, considering rotation, a totally smooth full turn lasting a total of 4 seconds would require this:
SEntry = 0,0,0,90,4,360,90,0
Rotation is in degrees and accepts negatives. Scale uses multipliers, with 1 being the default. Translation of course uses simple metrics like in the game. I believe the last three SEntries hold the data for scale while the first three hold positions, but don’t hold me up on this as it’s been a while and I really didn’t get enough time to fiddle with them. The first three values may also need some special code which I don’t remember, considering they are not using the same code (the values should be the same, but the properties might be named differently).
-
Thanks again, lads. Once more, you have been a big help in cutting through a lot of the techno babble that my eyes glaze over when I look at all those lines of codes! With a bit of trial and error on the suggested lines, I’ve been able to pull of effects with that I am more or less happy with.