Monday, 24 October 2011

Update: Feature Progress


I've finished many of the major additions to the original game concept, in terms of features. Here is a list!

  • Dynamic road system (lanes)
  • Updated player class (to use extra lanes)
  • Dynamic traffic (more and better AI)
  • Speed zone detection / game health
  • Game timer
The new road system is a queue of scrolling road pieces which fit together, and are randomly generated. I am using probabilities to get the output I want (low chance of opening another lane) and each RoadSection object has an array of 'valid successors' which allowed the RoadHandler to know which road sections are allowed to come next. This keeps all the graphics tight and tiled nicely. It will look dandy with proper art, rather than my quick hacked together test art. It's pretty flexible with height and width of road pieces provided, so it should be an easy transition to new art. We had toyed with the idea of roads that actually turn, but once I fully sketched out the implications of that I decided against it. The AI would have to know how to navigate corners, for a start, and there is an issue with player turning. With accelerometer turning, I had decided to make the only option 'head for the next lane', because otherwise the player could carefully position the car on the white line and accelerate to their hearts content without fear of failure (just like the original GTA!). But with a curved or turning road, the player's car would need it's own intelligence to navigate the moving lane, because the player's only job is deciding when and how to switch lanes. With weaving through traffic and making noises at the iPad all the time being enough of a challenge, I decided corners weren't vital enough to warrant the work cascade caused by implementing them.

The player class can now use these lanes, and detects whether or not there is a lane to switch into. The AI sticks to the central lanes, making these sides lanes a handy occurance. The lane switching speed is much higher now, which is both more satisfying and harder, since it makes it harder to hold the centreline by switching lanes rapidly (thanks Ken for showing me this exploit!).

The traffic AI is simple, but pretty neat. Like the roads, they are in an array and get culled once off the bottom of the screen. They all spawn with a random speed and lane, and are placed always in front of the farthest car (to avoid being stuck on top of one). The issue, and beauty, with random speed is that the cars can catch each other up. So I have made them all check ahead for cars, and match speed with the car in front if they get close enough. This makes really convincing looking traffic line behaviour when the car numbers increase, so that's a big win for such a simple behaviour.

As I showed at the interim, there are speed zones being tracked now. The player starts with 100 health, and when this reaches 0 it's game over. This is a game abstraction, I'm still wondering how to explain this well to the player (what is this thing?), it's something like 'how close are the space police to catching you'. I guess the story of Speed Freq has been glossed over a bit....Anyway, the health will decrease when speed is under 50kph, and increase back up to a max of 100 when the speed is over 70. This bracket will increase as the game goes on (although it doesn't yet) with a graphical indication of how extreme the chase has become. EXTREME! This is the kind of word Dangerlabs can get behind. This little dance is the main game tension, and the timer (which equates to score) shows how long you have managed to maintain it. These figures are just numbers at present, displayed as such for debug purposes, but they can easily take different forms now that they exist in code.

You'll also notice the Back button, provided by Sam, which hints at the other views that are in place. The game has a main menu screen and several other screens besides the one I posted, but that is Sam's area so I'll leave it to him to post. Our task split is more solid now, with me on just the core game view and Sam concentrating on all the things that wrap and support the game itself (of which there are a surprisingly high number). Ken is still on art, and as you'll notice there is no final art in the game yet! He has prototypes and a near-completed car, but this is lagging a little behind what I had hoped. I remain optimistic however.

In other good news, Dangerlabs.co now correctly routes to the site, so we can use that in our presentation. Yuss!

Next to tackle in earnest: Accelerometer controls. Must must must have these.

No comments:

Post a Comment