Who Turned Out The Lights?

I only managed a couple of hours work today, but they were pretty good ones. As mentioned yesterday, the empty spaces off to the sides of the road were annoying me, so the first thing to do was knock up a couple of quick bits of scenery – one for either side. As with the rest of the game so far, these are all made with Unity’s primitive shapes right now, because otherwise I’d have to finally get around to learning how to use Blender to create 3D objects (I’ve spent 20-odd years using 3DS Max, but can’t justify the expense right now so need to make the change, but it’s a very reluctant one. Also, I hate learning new software – I genuinely find it immensely frustrating to have powerful tools but not the knowledge to use them – and it’s one of the few areas in life where I lack any degree of patience. It’s why I generally learn the bare minimum I need to get by with any software package, and use those tools exclusively – even if I’m aware there are better ways to tackle a job, but would need to learn how to use them.)

Anyhow, after maybe quarter of an hour of playing with capsules and cylinders and cubes I’ve got something serviceable, and I think it helps a lot. The grass verges make me think the car should shudder when travelling over them, and kick up dust. It’s also a good excuse to add camera shake, so these get added to the list of things to do. All non-essential, but all will add to the feel of the game, which is all I’m after right now.

Next I decided to address the horn, changing it from a short beep to a loopable sound, allowing the player to sound properly angry if they wish. I suggested yesterday that maybe the horn would intimidate the car in front – I’m wondering now if making that a function of time would work too – so some drivers panic immediately, while others need a longer blast (possibly over-complicating things, but probably worth looking into). I recently got a bunch of sound effects in a Humble Bundle, so I looked through these and found several car horns, but none of them looped. So I picked one I liked, opened it in Audacity and cut out the middle section and tried playing it looped. Huge clicking sound when it looped, so I nibbled a bit off the end and tried again. And again. And again. Then I tried nibbling a bit of the start. And again, and again. After whittling away at it for ages I finally had a (very short) loop that wasn’t too bad – it still clicks a bit, and will need replacing, but it will do for now. Audio is one of my least favourite jobs (which is a shame, because it has such a huge impact on a game).

Next up I decided to look at adding night time to the mix (this will also pave the way for all manner of colour schemes). A little tinkering with the light settings helped me find decent values to make a start, so I then coded a routine to fade between different sets of light settings at the press of a button (for now). That worked a treat – could hardly see a thing, so next up I strapped a couple of spotlights to the front of the player’s car, and – crikey – for something so cobbled together it actually looks rather neat. As you can see in the video below – night falls like a dropped brick right now – I’ll slow that down later. Next up I added tail lights to all the cars, and then when night falls the game manager script tells all the cars to put their lights on. The important thing here is that the cars each generate a random delay before they do this, to prevent all the lights coming on at the same time as if a switch had been pushed. Pleased with this.

Whilst rummaging around in the RenderSettings to adjust the lighting values I noticed the settings for fog too – I hadn’t thought of this, but fog would work a treat. So next up I spent a bit of time monkeying around with fog values – again putting them on a button press for ease of testing. I’ve soon got a real pea-souper. It’s not right, but it has definite potential:

So, next I think what happens if I mix it with night time, and this is what you get, which again could be really nice:

This is part of why it’s so very hard to finish a game. At this end of development, it’s almost like the game makes itself. It’s like it runs away, and you’re just trying to keep up with it, new ideas coming thick and fast, and you cobbling stuff together in minutes and getting cool results. It’s almost intoxicating. At the other end of development, you end up desperately trying to drag the bloody thing across the finish line, and it’s really reluctant to go. Every little thing seems to take an age to finally put to bed, and whilst what you’re working on is probably essential, you know nobody will even notice it. At some point the balance tips from that rush of ideas to that slog of just trying to kick the thing out the door, and at that point starting something new and interesting is always going to look much more appealing.

Anyway, at this point I decide to make a build to grab a video, and realise that the fog doesn’t show up in a build. A quick Google shows this is a known issue – fog works in the editor, but not in the final build. I try a few of the suggested workarounds, but none of them work for me. I soon get bored of this, so turn to the Unity Asset Store and find a few snazzy-looking foggy assets – and that’s where I’m at now – trying to decide whether to buy some fog I didn’t know I needed 20 minutes ago. They do look very good, so I’m very tempted (who knew you could make money selling fog?).

Tomorrow I’ll probably decide about the fog, and maybe look at adding camera shake and a few particle effects. After that I’m probably either going to have to bite the bullet and start using Blender to get some proper geometry in there as I search for an art style, or I’m going to have to look at getting the traffic working properly (which is perhaps the biggest unknown right now). Or I might put these off, and mess around with a few more cosmetic touches, because that’s much more fun.

One thought on “Who Turned Out The Lights?

Comments are closed.