Dynamic diesel smoke

Discuss anything related to Train Simulator from DoveTail that does not fit in one of the more specific categories.

Re: Dynamic diesel smoke

Postby AndiS » Mon Jun 02, 2014 8:16 pm

Not the slightest problem, James. We enjoyed ourselves, as you can see. Maybe not as much as you but still ...
AndiS
Top Link Driver!
 
Posts: 810
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 270 times
Been thanked: 320 times

Re: Dynamic diesel smoke

Postby deltic009 » Sun Nov 02, 2014 4:31 pm

Hello everybody, my my it's been a while since I visited here! Anyway, I know one should avoid resurrecting dead threads but the title and subject matter are applicable.

Now, although I don't have WHLE (yet), I note that the Class 37 seems to do exactly what we are discussing here in having exhaust fumes dependant on what the engine is actually doing. But why the thread resurrection?

Well, I'm currently in the process of putting together a large reskin pack for the DTG Class 52 and as a final piece of icing upon the cake, I would LOVE to implement this into the Class 52. I don't mind trialling out suggestions (and I'm going to revisit earlier replies) on a basic loco, but may need help getting it to happen in a script for a loco that already has a script running.
deltic009
Full Time Fireman
 
Posts: 62
Joined: Mon Apr 14, 2014 12:52 pm
Has thanked: 16 times
Been thanked: 34 times

Re: Dynamic diesel smoke

Postby Caliban » Sun Nov 02, 2014 4:57 pm

The WHL 37 isn't as complex as I wanted, but yes - the smoke is dependent on engine load, RPM and whether it's revving up - this matters somewhat, because there's more unburned fuel when the engine is accelerating and the fuel racks are somewhat in advance of the ideal position.

You can set colour and alpha in one call ( SetEmitterColour? ), rate in another although the way it work is horrible, and the initial velocity in another one I forgot the name of. There are a bunch of things I wish you could do, but those are enough to bring life to the exhaust at least. Most of the hassle is working out engine load and fuel burn - for a DH load should be easy given that torque converters aren't adjustable like alternators. There is an ideal amount of fuel for each specific RPM as a diesel takes a fixed amount of air at a given RPM ( assuming turbos have spooled up etc ), the more fuel injected above that the more likely it'll come out the exhaust partly burned ( and so the blacker the smoke ).
Caliban
General Shed Duties
 
Posts: 20
Joined: Wed Sep 17, 2014 3:26 am
Has thanked: 1 time
Been thanked: 7 times

Re: Dynamic diesel smoke

Postby deltic009 » Sun Nov 02, 2014 5:46 pm

Caliban wrote:The WHL 37 isn't as complex as I wanted, but yes - the smoke is dependent on engine load, RPM and whether it's revving up - this matters somewhat, because there's more unburned fuel when the engine is accelerating and the fuel racks are somewhat in advance of the ideal position.

You can set colour and alpha in one call ( SetEmitterColour? ), rate in another although the way it work is horrible, and the initial velocity in another one I forgot the name of. There are a bunch of things I wish you could do, but those are enough to bring life to the exhaust at least. Most of the hassle is working out engine load and fuel burn - for a DH load should be easy given that torque converters aren't adjustable like alternators. There is an ideal amount of fuel for each specific RPM as a diesel takes a fixed amount of air at a given RPM ( assuming turbos have spooled up etc ), the more fuel injected above that the more likely it'll come out the exhaust partly burned ( and so the blacker the smoke ).

Cool, well that's all I'm after, something crude but effective, more so than plain pulsing smoke. Can you explain, in REALLY SIMPLE terms, what and where I'd have to type - I may be okay at reskins and child objects but beyond that I really know nothing.

Thanks for the initial help though.
deltic009
Full Time Fireman
 
Posts: 62
Joined: Mon Apr 14, 2014 12:52 pm
Has thanked: 16 times
Been thanked: 34 times

Re: Dynamic diesel smoke

Postby cjbarnes5294 » Tue Nov 04, 2014 1:05 am

I'm guessing the 52 mega pack uses the scripting from the AP pro pack? If so, you'd have to make a new script that includes the AP script, which is explained very nicely here:

http://forums.uktrainsim.com/viewtopic. ... 8#p1687192

It's something I've never tried before for myself, but it should make for a nice and simple task to do before going into particle scripting. I would create a simple script that requires the original script and test that it works before going further. So using nschichan's example as a base:

Code: Select all
--original_Script is a string variable that we assign the file path between two quotation marks " "
original_Script = "Assets\RSC\Class52Pack01\RestOfPathToScript\APsEngineScript.out" --I'm afraid I don't know the name of the script or where it's located
require(original_Script);

-- store legacy functions before redefining them, although I think you'd only need to redefine Initialise and Update for particles
old_Initialise = Initialise;
old_Update = Update;


function Initialise
   old_Initialise()
   --turn on and off the various emitters as required, e.g:
   EmitterOn("StationaryFumes");
   EmitterOff("EngineExhaust");
   EmitterOff("EngineClag");
   --see below for explanations for EmitterOn and EmitterOff
end

function Update(time)
   old_Update(time)
   --code to control the particles, you could include some of the ideas from earlier in this thread
end

--extra function for turning on emitters without needing to retype the long call function
function EmitterOn(name)
   Call(name..":SetEmitterActive", 1);
end

--same as the above, but for turning emitters off instead
function EmitterOff(name)
   Call(name..":SetEmitterActive", 0);
end


The above is an idea of how you could start off, although be wary if you copy and paste it, as I haven't bug tested it or even attempted this method for myself before. :shock: ;) And of course, you'd need to make a few changes anyway, such as typing out the correct file path etc, but you are more than welcome to use it as a starting point to play with.

Chris
The Red Queen Hypothesis, applicable to train sim development?

"Here, you see, it takes all of the running you can do, to keep the same place."
cjbarnes5294
Driver
 
Posts: 398
Images: 82
Joined: Mon Mar 31, 2014 12:40 pm
Location: Gloucestershire/North Yorkshire
Has thanked: 551 times
Been thanked: 187 times

Re: Dynamic diesel smoke

Postby cjbarnes5294 » Tue Nov 04, 2014 1:10 am

Caliban wrote:You can set colour and alpha in one call ( SetEmitterColour? )


I use SetEmitterColour to change the RGB values i.e. Call("Name:SetEmitterColour", red, green, blue), but I didn't think you could change the alpha as well? I wonder if passing it 4 arguments, RGBA, instead of 3, RGB, would work? It would certainly be extremely useful if the alpha channel can be controlled.

Chris
The Red Queen Hypothesis, applicable to train sim development?

"Here, you see, it takes all of the running you can do, to keep the same place."
cjbarnes5294
Driver
 
Posts: 398
Images: 82
Joined: Mon Mar 31, 2014 12:40 pm
Location: Gloucestershire/North Yorkshire
Has thanked: 551 times
Been thanked: 187 times

Re: Dynamic diesel smoke

Postby DominusEdwardius » Tue Nov 04, 2014 2:54 am

Hmm would it really that useful since doesn't that call bulk set colour, if alpha was the same then you'd just be changing the transparency of the entire stream rather than what might be useful in some cases and have the alpha vary along the stream i.e darker and thicker near the point of emission and fading away
regards
Edward
Regards Edward

Meshtools - Scripter and Sound Artist
http://www.meshtools.co.uk
https://www.facebook.com/Meshtools
User avatar
DominusEdwardius
Passed Fireman
 
Posts: 114
Joined: Mon Mar 31, 2014 11:25 am
Location: Loughborough, UK
Has thanked: 10 times
Been thanked: 40 times

Re: Dynamic diesel smoke

Postby Caliban » Tue Nov 04, 2014 12:03 pm

cjbarnes5294 wrote:
Caliban wrote:You can set colour and alpha in one call ( SetEmitterColour? )


I use SetEmitterColour to change the RGB values i.e. Call("Name:SetEmitterColour", red, green, blue), but I didn't think you could change the alpha as well? I wonder if passing it 4 arguments, RGBA, instead of 3, RGB, would work? It would certainly be extremely useful if the alpha channel can be controlled.

Chris


It's RGBA for arguments now, since ts2013 I think. Having used it, it *is* very useful. You don't have to pass alpha though.

Will think about some easy to apply code for the 52, but it is actually pretty complicated.
Caliban
General Shed Duties
 
Posts: 20
Joined: Wed Sep 17, 2014 3:26 am
Has thanked: 1 time
Been thanked: 7 times

Re: Dynamic diesel smoke

Postby cjbarnes5294 » Tue Nov 04, 2014 12:55 pm

:twisted: :twisted: :twisted:

Mwahahaha, that is very good news indeed, thank you very much. :)

Chris
The Red Queen Hypothesis, applicable to train sim development?

"Here, you see, it takes all of the running you can do, to keep the same place."
cjbarnes5294
Driver
 
Posts: 398
Images: 82
Joined: Mon Mar 31, 2014 12:40 pm
Location: Gloucestershire/North Yorkshire
Has thanked: 551 times
Been thanked: 187 times

Re: Dynamic diesel smoke

Postby deltic009 » Wed Nov 05, 2014 9:03 pm

Thanks for all the input guys, I'm terrible when I'm out of my comfort zone but hopefully I'll get what I need to bolster up this pack into a MUST have for everyone (along with the excellent AP sounds).
deltic009
Full Time Fireman
 
Posts: 62
Joined: Mon Apr 14, 2014 12:52 pm
Has thanked: 16 times
Been thanked: 34 times

PreviousNext

Return to Train Simulator Mess Room

Who is online

Users browsing this forum: No registered users and 0 guests