Tags

, ,

So, it is finally finished. Valentine’s Day Escape, my first Unity game that wasn’t a piece of shite, has been completed. You can find it here.

Looking back on it, it was a good learning experience. The biggest (practical) problem I had was how to procedurally generate the track, or how to build a random track as the player progresses. My solution to this is not innovative, but it works quite smoothly: the track segments, along with every obstacle and pick-up, are already placed in the scene before the game even begins, and then swapped in and out as needed. The track updates are triggered by a static collider that sits across the track and ignores everything by the player; when the player enters it, the first five pieces of the track are removed, five more are chosen at random and added to the end of the track. The collider is then moved further up the track, and it continues until the player dies.

The key point here is that I used an invisible collider to make track updates event-based, rather than constantly checking if the next update is due. This is generally better practice, as it means the CPU has to track less. Polling is a bit like a kid constantly asking “Are we nearly there yet?” – about the only reasons you’d do it is because there are no alternatives, or you might be doing something every frame (e.g. movement and input). In fact, a lot of Web-based applications are becoming more event-driven, particularly by using WebSockets.

Another problem I had, about six months ago, was lack of motivation. After working on it for a few months, I just got fed up and did a few other things. Then somebody commented on my WIP thread on the Unity forums, partly because I had looked at one of his, and his suggestions gave me the motivation I needed to finish this. So, one thing I need to work for future projects on is getting more feedback. With Spamocalypse, I am going to start posting to the Feedback Friday threads that run in the Design sub-forum on the Unity3D site.

All in all, I am reasonably proud of this. It’s not my first game, nor even the first long-term one, but it is the first I consider polished enough for general consumption.

Advertisements