Skip to content

Spline curve paths #1455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HybridDog opened this issue Jul 7, 2020 · 2 comments · Fixed by #1624
Closed

Spline curve paths #1455

HybridDog opened this issue Jul 7, 2020 · 2 comments · Fixed by #1624

Comments

@HybridDog
Copy link
Contributor

As far as I know, the paths in Supertux are Spline curves of order 2, i.e. they consist of connected piecewise line segments defined by the ordered points and times. Therefore, I often see a flying platform which suddenly (i.e. C1 discontinuous) changes its velocity at a node instead of flying along a smooth curve.
I think for smooth platform movement and other purposes, cubic Spline paths could be added.
There also exists a quadratic Spline, but it is not C2 continuous, which means that the acceleration is constant within the line segments and thus it looks less smooth. Conceptually quadratic Spline means that if the platform has some propellor, at the line segment transitions the propellor would suddenly change the direction and strengths with which it accelerates the platform.
For a bit motivation: Here is a video of a cow flying along a Spline curve

@Alzter
Copy link
Member

Alzter commented Jul 14, 2020

I think this is a good idea, currently the paths are quite linear and don't feel very polished. When you say spline curves will the curves themselves be adjustable like bezier curves or is it automatic? Also, will old levels have to be adjusted to accommodate for this? Either way I think this would be a welcome change.

P.S. nice cow 👍

@HybridDog
Copy link
Contributor Author

HybridDog commented Jul 14, 2020

When you say spline curves will the curves themselves be adjustable like bezier curves or is it automatic?

They can be adjusted, but not in the same way than bezier curves.
There exist multiple ways to graphically interact with spline curves, for example it is possible to manually change the basis points, or to move points lying on the spline curve.
Implementing this interaction and visualizations in the Editor may require the most effort.
To get sharp corners, it is possible to add curve segments with zero time intervals.

Also, will old levels have to be adjusted to accommodate for this?

No, spline curve paths would be a new feature and backwards-compatible (except if somebody implements it wrongly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants