0
\$\begingroup\$

In this page, Amit explains that splines can be used to achieve movement on a found path.

In the picture below, he explains that:

The blue paths use splines, with dark blue being low order splines and light blue being a higher order spline.

What are exactly high order splines? How to achieve the light blue movement?

enter image description here

\$\endgroup\$
1
\$\begingroup\$

A spline is a curve built from a number of conjoined polynomial equations. Higher order splines are splines built of higher order polynomials. Generally speaking the higher the order, the more fluid the curve (sort of), with linear splines being a series of straight lines.

Here are some examples or different orders (from the Wikipedia page on Bézier curves, a type of spline).

Linear:

Linear Bézier Curve

Quadratic:

enter image description here

Cubic:

enter image description here

These GIFs show generally how these curves are constructed, and higher order = more control points. In Amit's example, those control points are consecutive points along the path, so a higher order spline means that there is a smoother interpolation along a larger set of those points at a time.

Put another way, instead of looking at just the next point to move toward (linear), it might look at the next two points (quadratic) or next three points (cubic). This allows for more natural movement of your game entities along the path that has been constructed - the underlying logical path doesn't change, just the actual movement on screen.

There is more information on the Wikipedia page about how to construct these curves.

\$\endgroup\$
  • \$\begingroup\$ Great thanks for your explanation, it works! Now I realise that I also need to be able to "join" multiples curves to follow a long path, but I will open a new question for that :) \$\endgroup\$ – Hermann Oct 20 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.