woensdag 23 januari 2013

Trick trails

Dear readers,

First of all we're happy to inform you that Traffic Slam 3 has just been released! You can play it here. I really enjoyed working on Traffic Slam 3 and think it's absolutely a worthy successor of Traffic Slam 2.

In the meantime I've been working on a snowboard game, which is nearing completion. In this game you'll be going through the city and completing challenges. Some challenges are completed by getting a certain score, others by doing certain kind of tricks. With every kind of trick you score points. Needless to say, doing tricks is the main goal of the game. As such, tricks should look cool and be fun to do. Besides making the animations cool, we've also added trails when doing tricks. The trails are added to the hands and the board and only show when a trick is being done. An example is shown below:

Player doing a trick with trails showing the movement of the board and hands.

So how do we create these trails? The trail is a mesh (a strip of triangles) that is updated each frame: whenever the object that the trail is following moves the trail is updated. It generates new vertices on the position where the followed object is now and updates old vertices (setting vertex colors for a fading trail and eventually removing them). It is also important that the generated trail does not create its vertices on one plane but rather banks with the followed object as can be seen below:

A trial is made out of a mesh as shown by the blue lines.

And of course for any kind of feature you create, you should ask yourself: could it be useful in future games as well? If so: can the feature be made generic (to a certain extent and without using too much time) so that parameters can be tweaked. For the trails the answer is yes: trails are pretty common in games. Parameters for the trail can be the trail width, fade speed, color, etc.

-- Stijn

1 opmerking: