Post news Report RSS Fun with Splines!

In our efforts to make sure Kung Fu Kingdom doesn't play like its built on a grid (which it is, of course) we have decided to use splines for rivers and roads instead of making them tile based. For those of you who are not in the know about splines, let's get you in the know.

Posted by on

This is what a spline is. OH SNAP! That still doesn't make any sense!

Basically a spline is a curve made from a series of points. In games, we apply a repeating texture, or a repeating series of textures, to the spline line in order to make a road or a river! They can be used for other things, and they are pretty important because, as I mentioned in the summary, they can be used to take your game off the grid, so to speak.

Here were some early tests.


As you can see, there are some serious stretching problems (putting aside how ugly the texture is - Sorry Somjade).

After a few tweaks by Terry (Lead Programmer) we managed to get pretty good looking splines. One of the bigger problems we had was when we wanted to do really sharp turns. By using a separate, 90 degree turn texture we have somewhat alleviated this problem, though as always it has introduced new ones.


I'll post again once we have finished the road texture and made something truly sexy looking. All this work was made petty easy by the Flat Red Ball engine using their Sprite Chain's, which are basically splines.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: