The last two weeks have been relatively light on game work. The main things have been:
- Research into setting up an LLC (i.e making this a “legit business”)
- Making the settings menu
- Adding smoke to the steam engine
The LLC stuff may be a future dev diary, since I haven’t finished yet, but I’ll discuss a bit about the other two.
Settings – I’m not entirely sure what to put here at the moment, apart from volume and a fullscreen toggle. I feel like there should be more, but at the moment I’m drawing a bit of a blank. Volume is separated between sounds and music – if left at default values, the music is very loud and overpowering. For screen resolution, Godot handles the scaling to the actual resolution, so a manual setting isn’t really needed.
Smoke – so I had been putting this graphical detail off, but this was actually a neat little project. So I’ve been using Krishna Palacio’s Minifantasy art to build a lot of Iron Village’s graphics, but this time I’ve gone with Jamie Brownhill’s World of Solaria set. The smoke was originally designed for a house chimney, with the whole column of smoke in one image. Luckily the individual “puffs” of smoke were mostly separate, so I could slice it up into a sprite sheet for the whole lifecycle of one puff.
Next up is actually animating the flume of smoke. I might have been able to get away with just having one sprite representing the whole thing, but this is a key detail of the game so I wanted to do it “properly”. The main mechanics of animating the flume are as follows:
- At a specified time interval, spawn a puff of smoke at the top of the smokestack. Make sure it is not a child node of the train – that is, its movement must no longer be completely linked with the train itself.
- Each puff keeps track of its own velocity, which starts with a y component moving slowly up and an x component starting at the speed of the train. That way, at least initially, it’ll move along with the train, but just go straight up if it stopped.
- Each puff will slowly decelerate. Air resistance slows it down as it disperses through the rest of the air.
- Over the lifetime of the puff, it slowly expands and then shrinks, to represent it expanding and fading away.
- On top of all that, respond to changes in the in-game clock: stop the animation when paused, speed it up during 2x or 4x speed.
- Remove the puff once the animation is done.
All of these are fairly simple by themselves, and get a little more complicated when put together, but the result is a really nice animation that looks smooth too. It just takes a bit of math to roughly approximate the physics.
Anyway, somehow I wrote multiple paragraphs about “relatively little game work”, so I’ll leave you with the video of all of this in action:
See you in a fortnight for the next dev diary – that seems like a pretty good cadence in my opinion.
Leave a Reply