Back to Main Page

Saw a comment in the description of the Kitsune Trains mod about trains not animating, specifically steam trains. Decided to investigate...

Page 1

Kitsune Trains - Part 2.

Update 21st February 2021: Chaos... it's that thing that breaks the monotony and repetitive nature of all we see and hear. It's also the thing I like to add into any mod that generates effects.

Anyone who has used my Helicopter Effects mod will have seen that in the constant changing colours in the generated dust. Just as physical particles produced and their interaction with light are never the same twice, sound is also the same. With steam trains, pressure variations will alter the amount of steam being expelled and as such, the type of sound that is generated. I decided today that I was going to try and introduce that factor into the sounds in this mod.

The sound engine very nicely accepts a Playback speed value of 1f, which means normal speed. You can vary that value for each sound you play back, which is a direct interface to chaos. So I introduced two factors into the equation:

1) The speed at which the train is travelling.

2) A random variation to the sound produced as a result of number 1.

So as the train increases speed, it gets a gradual rise in playback speed, causing a gradual rise in pitch. I then take a random number between 0f and .2f and apply that to the already speed-modified sound. The result is a subtle, constantly shifting sound that reflects the natural variation you would normally get. It's not massive pitch shift, because that's not what really happens but it's enough to break the sound away from being the same sound every single time.

Sometimes RNG is a curse in games, especially when you are expecting that game to give you something as a result (see Casino Lucky Wheel for evidence of that) but RNG can also mean the difference between bland and exciting if used in the right way. I think I use it in the right way and I hope that stops my effects from seeming bland.

Latest sound video just uploaded to YT.

Update 23rd February 2021: Two days of almost nothing happening apart from config tool changes and bug-bug-bug fixes.

Certain trains are proving troublesome to get working smoothly with this animation system, so investigation is underway to try and find real-life data about the parts being used and their actual length values.

The system doesn't use any physics constraints but the way it works, relies on things being sizes that would work in real-life. A radius being too small might cause something to not move far enough, a rod being too long might cause something to move too far. It's all a balancing act that requires careful and accurate parts and configuration. The problem is, that information isn't always easily available.

The biggest problem with this, is that when things start to fail, I begin to doubt the reliability of the system I have created and the code I am writing. The danger here is that I eventually get tired of writing something that doesn't work and lose interest.