Search Unity

Super Splines

Discussion in 'Assets and Asset Store' started by NococoDiVrenti, Oct 5, 2011.

  1. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Hello friends!

    After days of programming and hours of testing and optimizing I am finally proud to present my first extension for the Unity Editor to you: Super Splines!

    Did you ever need to have splines supported in the Unity Editor? Or did you ever want to quickly generate a road with only a few clicks? Or did you ever have to code a script for a Camara that follows the player on a predefined path?

    Well I did! A couple of weeks ago I had to face the problem that Unity doesn't directly support animation of objects along dynamically generated curves. Working on a project that would make heavy use of splines and other curved paths I had to write a powerful and efficient spline interpolator myself.
    During development of that project the spline interpolator's range of functions had also been extended continuously, so I decided to make it a separate project and share it on the Asset Store.

    By now it supports – among other things – 3 different curve types (Hermite, Bézier, B-splines) , 3 different ways to interpolate rotations,
    Mesh deformation (used for roads, tubes, ropes, tunnels etc.) and it provides handy functions that take the work out of programmers' hands.

    This website demonstrates and explains some of the most useful features of Super Splines.

    You might check out the online reference in order to see the variety of functions that Super Splines offers.

    You can download Super Splines on the Asset Store at the price of 25$.

    You can also download the pro version of the Plugin on the Plugin which includes all of the project's sourcecode at the price of 65$.

    To get a better idea of what Super Splines looks like in the Unity Editor, here are some screenshots:





     
    Last edited: Oct 14, 2011
  2. spk

    spk

    Joined:
    Jan 9, 2009
    Posts:
    532
    Haha, where were you 2 days ago when I needed that and had to roll it myself :p
    This is looking great, I might get it ;)

    I suppose you have implemented arc-length parameterisation to move objects along the curve at constant speed?

    Also, would it be possible to have a look at the API (online documentation or something equivalent would do) to get an idea of the scripting methods exposed, please?
     
    Last edited: Oct 5, 2011
  3. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Yes, objects are approximately moving at constant speed along the spline, although I used a numerical rather than an analytical approach to achieve this. I planned to implement an analytical technique in a future release of Super Splines.

    If you want to get a little overview of the API you can check out the documentation. :)
     
  4. spk

    spk

    Joined:
    Jan 9, 2009
    Posts:
    532
    Hi, I checked your API a bit, it's looking good. However, I couldn't find a method to get a point on the spline at a specific distance from its starting point - Did I miss it or is it not available? Also, do you have a practical example on how to use your package to make an object follow a given spline?

    I'm really tempted to get this, especially at such a nice price point, but i'm a bit reluctant due to the sources not being included. I've had too many problems with black box products in the past. Would you consider either including it with your package (and maybe bump the price up) or selling it as a separate package?
     
  5. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Ok, I have to admit, this could be a little tricky with the current version of Super Splines.
    Basically all points on the spline can be calculated using the function
    Code (csharp):
    1. Vector3 GetPositionOnSpline( float param )
    param can be a value from 0 to 1, where param = 0 will return the start point and param = 1 will return the end point. If you want to get a point with a specific distance to the spline's start point, you would have to divide the desired distance by the whole length of the spline in order to normalize it to the interval [0..1]. The problem is that Super Splines doesn't store the spline length in the component, although it is calculated in the code. (I wonder why I didn't store it :confused:)
    I'm going to fix this in the next days and add some new functions for calculations using the actual spline length.

    Sure. Here's the SplineAnimator-Script that is also included in the package!

    Yes, no problem! I could release a pro-version of Super Splines with the source code included at a slightly higher price.
    Maybe I will do so within the next two weeks.
     
  6. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Hello Nococo,

    in PLAY mode , i try making diseappear spline and control nodes by unchecking Mesh Renderer with no success . Any advice ? Thanks.

     
  7. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Hi Sefou,

    the spheres and lines are gizmos, so they are drawn automatically by Unity. In order to make them disappear, just klick the "Gizmos"-button in the right upper corner of the game-view. That should do the trick!

    Cheers!
     
  8. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Thanks. I'm simply an idiot. :D
     
  9. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Hi folks!

    I just uploaded a little update that fixes some bugs and adds a variety of new functions.

    With the new version you can calculate lengths and distances on the spline!
    A new class called "SplineSegment" has been implemented allowing you to determine between which control nodes a spline parameter / point is located.
    Also the other classes offer more functions for easier handling. For more information on the new functions, check out the improved documentation .

    Releasing the first update I also uploaded a pro version of Super Splines that contains all source code related to the project allowing you to alter it's functions to fit your game project perfectly.

    The links to the new versions of the plugin can be found in my first post!

    Cheers!
     
  10. wheats

    wheats

    Joined:
    Aug 3, 2011
    Posts:
    14
    I know this is an editor plugin that will help me generate splines. But if I create a spline that moves through a tunnel will it work for iPad or iOS devices?
     
  11. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Yes, it will work for all current iOS devices! I tested it on iPhone 3GS, iPhone 4 and iPad 1 2 and it worked fine.
     
  12. xeHidden

    xeHidden

    Joined:
    Sep 5, 2010
    Posts:
    3
    I Have purchased this tool,How do I create a traffic simulation with this? The city roads are models,super spline can create splines snap to mesh?
     
  13. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    In order to simulate traffic with Super Splines I would do the following:

    1. Setup some control points that describe your roads paths
    2. Connect these control points with the plugin's Spline-component
    3. if you don't have road meshes yet, let them be generated using the SplineMesh-component
    4. Write a script that animates vehicles along your splines (you can use this one as a reference)
    Maybe simulating traffic on crossroads will be a little tricky: your splines would share some control points and you would have to check when a vehicle should switch from one spline to an other one.
    Traffic simulation certainly is possible with Super Splines, but if you have any further questions, just contact our support.

    Cheers
     
  14. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Hello folks!

    There has been a second update to the plugin bringing you the following improvements:

    • More accurate velocity-constant interpolation
    • Advanced UV-mapping-functions
    • Improved performance: Length calculations are execudted nearly twice as fast

    Check this page for the complete changelog!

    Cheers!
     
    Last edited: Nov 16, 2011
  15. megmaltese

    megmaltese

    Joined:
    Mar 19, 2009
    Posts:
    2,153
    This last link points to your hard disk, mind to share it? ihihihh
     
  16. larvantholos

    larvantholos

    Joined:
    Oct 29, 2009
    Posts:
    668
    <..< advanced UV mapping functions? do tell. Are you now able to use spline mapping like in 3ds max? Cause I tell you that is win :) If I can import splines too, that would be the amazing.
     
  17. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Whoops :D I've just corrected this one!

    @larvantholos:
    Actually the new UV-mapping options enables you to define how often the texture will be drawn onto a mesh that you create with the plugin's SplineMesh-component. Thus you don't have to set the texture tiling in the material-properties allowing you to use only one material for multiple meshes of different length that have been generated with SplineMesh.
    I'm not that familiar with 3ds max, but I suppose that's not quite the function you're looking for. Nevertheless you can tell me what function you would like to have and maybe I will implement it in the next update.
     
  18. Daniel_M

    Daniel_M

    Joined:
    Mar 24, 2011
    Posts:
    1
    Hi! I've been using your library (great work!) and I found a leak problem with the SplineMesh component when I was profiling a game.
    I guess it has something to do with the "bentMesh" field which it's created at runtime (you know "new Mesh();") but it isn't freed for some reason.
    Have you forgotten to destroy it? (using the "OnDestroy()" method)

    Thanks in advance.


    PS: Sorry for my bad english
    PS2: Wow! my first post
     
  19. pixelshaded

    pixelshaded

    Joined:
    Oct 23, 2010
    Posts:
    40
    if I use a 4 pnt bezier curve and GetClosestPoint is the end point, I get an IndexOutOfRangeException. The normalizedIndex on line 333 in Spline.cs is being set to -1. There are 3 segments, so perhaps this needs to be -3 instead of -4.
     
  20. NococoDiVrenti

    NococoDiVrenti

    Joined:
    Sep 18, 2011
    Posts:
    16
    Thank you for reporting these bugs! I'll have a closer look at the plugin's code as soon as I can.

    By the way, there has been an update some days ago.

    New and important features are:
    1. Option to generate seperate meshes per spline segment
    2. Quick-Infos that can be acessed via keyboard shortcuts and that show basic information about the selected spline

    A detailed changelog can be found here!

    Moreover I've uploaded a short video that shows how to create a road and animate some gameObjects using SuperSplines.

    Cheers!
     
  21. SOIL

    SOIL

    Joined:
    Sep 2, 2011
    Posts:
    143
    Hi, does SuperSplines support custom UV mapping? cause i am working with texture atlases, where each object uses only a part of a big texture atlas.
     
    Last edited: Apr 3, 2012
  22. DreamEnder

    DreamEnder

    Joined:
    Apr 12, 2011
    Posts:
    190
    Just bought Super Splines and am really enjoying using it.

    How can I add Spline Nodes at runtime?
     
  23. JayG81

    JayG81

    Joined:
    Sep 4, 2012
    Posts:
    71
    Is there any way to change how the mesh is centered on the spline? I'm trying to create a track with two meshes using the same spline (one for the road and one for the railing). The railing always goes up 0.2 units even though the railing is created from the same 3D model as the road.
     
  24. no

    no

    Joined:
    Sep 14, 2012
    Posts:
    3
    I came from iTween, HOTween and others looking for a solution that allows me to move the splines in real time, but still be able to draw it on the screen initially. As in, the central empty gameObject which holds supersplines together is perfect for this project. This would seem to be the solution so I purchased this... however, there are some features greatly lacking in the animator script that I would like to address in comparison with the free solution. If you get iTween and the Visual Editor script you might easily see some of the features that I am talking about.

    I particularly require for my project something like the onstart(), onfinish() functions. I didn't notice anything in the documentation that would trigger another method to happen when it began or completed. Having such a thing accessible from the spline animation script would be splendid. Also another requirement is being able to assign an animation to an instanced prefab, but I was unable to figure out how, if there is a way. I could only get the splines to work with objects already in the scene. If I can instance the spline paths as well, that would be even better! I would instance them as a pair. However, it seems they come as a 'clone' and thus I cannot set it to that instance. I cannot set a prefab spline into the animator either.

    Thanks to anyone who can assist me. I aim for the attention of the developer most of all, however.
     
    Last edited: Oct 25, 2012
  25. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Great package, exactly what I was looking for!

    I do have a question though, there is a gravity demo which looks interesting, however it doesn't work and has some missing scripts on the path nodes in the scene. What script is supposed to be attached to it?
     
  26. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    299
    Just bought this, and I'm noticing some odd behaviour. I created a B-Spline in my scene. I moved the control nodes around, then moved the base point around, then went back to move a node again and the spline disappeared. Selecting the spline and/or the nodes in the scene hierarchy does nothing. The gameobjects are still there, but no spline.

    I tried reloading the scene, restarting Unity, but the spline has just gone, leaving the gameobjects (with scripts) behind.

    I'd also like to know if the memory leak reported earlier in the thread (by DanielM) has been fixed.
     
    Last edited: Nov 14, 2012
  27. RogueLink

    RogueLink

    Joined:
    Nov 20, 2012
    Posts:
    2
    Right now I am using the splines for a racing game. While running next to the player it appears that the characters on the splines are stuttering, but when I attach a camera to one of those characters the character does not appear to shake or stutter.

    Could it be a conflict in update speeds between the camera and the spline? Do you have any suggestions for what it could be or how to fix it?
     
  28. RogueLink

    RogueLink

    Joined:
    Nov 20, 2012
    Posts:
    2
    I encountered a similar problem. While you cannot adjust the position of the nodes through the spline, you can adjust the position of the nodes themselves by using a reference to the nodes as children of spline.
     
  29. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    715
    hi,

    good work, can its work with play-maker ?. and how? help me.............. ^_^



    play_edu
     
  30. Antigollos

    Antigollos

    Joined:
    Nov 29, 2009
    Posts:
    117
    Hi!
    Is there somewhere a change-log? Cause i'd like to know what have changed from 1.2 to the 2.1 version? Also i ask myself, like SOIL did above, does it provide custom uv mapping? Can be to the middle parts also cap start and end parts added?
     
  31. SOIL

    SOIL

    Joined:
    Sep 2, 2011
    Posts:
    143
    Hello! I bought SuperSplines Pro today and it's a very great spline generator!! Keep up the work!
     
    Last edited: Mar 30, 2013
  32. SOIL

    SOIL

    Joined:
    Sep 2, 2011
    Posts:
    143
    For all others out there - yes it does support my so called "custom UV mapping" :) btw the right term of it is "DonInterpolate" - Didn't know that before xD
     
  33. Stud44

    Stud44

    Joined:
    Mar 8, 2013
    Posts:
    3
    I may need some help:
    here is what I want to do,
    1. have the car follow the spline from a starting node to an end node
    2. once reach the end node, I want the car to keep the same angle, rotation and speed
    3.the splines and the car have to be independent from one another as soon as the car reaches the end node.
    It is a crash crazy simulator game I want to create. Just not sure where to start in the scripting part.

    thanks for the help
     
  34. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Notice that super spline 3.0 is already out on your website. You guys should update the corresponding info on this thread....so that you can attract more potential customers...to try this awesome handy plugin
     
  35. SOIL

    SOIL

    Joined:
    Sep 2, 2011
    Posts:
    143
    .... and sending newsletters to all buyers too! ;)
    I agree - it's really a great plugin! :)
     
  36. Enginhk

    Enginhk

    Joined:
    Jun 14, 2013
    Posts:
    2
  37. ElementalSpark

    ElementalSpark

    Joined:
    Jul 20, 2013
    Posts:
    9
    Is the SplineAnimatedCamera script missing?? I can get the animation to follow the mesh, but it needs to be offset above it... it never places the camera above the road.. how can I fix this please?
     
  38. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    194
    hey,

    thanks for this great asset,

    I do have a question tough that i can't figure out just yet.


    Is there a way to access the first node of a spline.
    I need this to spawn objects at the start of the spline.

    Thanks for your time

    EDIT: i think i just found it:
    splines[0].GetPositionOnSpline(0); // returns the vector3 possition of the spline 'splines[0]'
     
    Last edited: Oct 18, 2013
  39. knocker65

    knocker65

    Joined:
    May 8, 2012
    Posts:
    2
    Hey all
    Maybe someone can help me here
    I picked up Supersplines and I want to instantiate a single game object on one of 4 splines using a Random.Range.
    like this...
    The game object would instantiate.
    pick one of 4 splines in an array.
    Attach itself to that spline.
    be on its merry way until it reaches the end or something destroys it.

    I tried to create an array in the SplineAnimator script but it wont let me, any help would be awesome :)

    Thanks
     
  40. directx

    directx

    Joined:
    Dec 11, 2014
    Posts:
    47
    Untitled.jpg Untitled.jpg i am making bike game and i want to move bike in curved path with physics
    this is how my bike moved forward

    can any one help me to do this
    bike able to do jumps ,flips and etc ...
     
  41. mml

    mml

    Joined:
    Mar 29, 2015
    Posts:
    11
    Hi Evolua Team,
    I'm currently using SuperSplines 3.0 in a Unity 4.6 project. It works great! When I update to Unity 5 I get a few errors from your scripts. Are you planning to upgrade SuperSplines to be useable in Unity 5?

    Cheers,
    Felix
     
  42. ashking

    ashking

    Joined:
    Jun 21, 2013
    Posts:
    39
    Hi there. I was curious if SuperSplines would be appropriate for creating a map with smoother coastlines like this:



    My goal is to have a landmass with a spline-based natural coastline, but with a texture inside the shape for more natural-looking grass. (Mainly ignoring the mountains and trees for now.)
     
  43. kaffiene

    kaffiene

    Joined:
    May 26, 2013
    Posts:
    21
    Given a branching spline, how can I find which junctions are coming up ahead of an object travelling along the spline? The JunctionController code in the demo code handles when you have passed a junction but I need to know which junctions are ahead.
     
  44. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    Hi,
    could anybody help?

    im trying to create a script telling my animated gameobjects to appear & loop around the spline randomly. So if i select 10 units, 10 units will appear randomly on the spline & loop around the spline thanks
     
  45. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Is this package still supported? I haven't seen an update since 3.5 and no posts since 2015. Does it work with Unity 5?
     
  46. SOIL

    SOIL

    Joined:
    Sep 2, 2011
    Posts:
    143
    I can confirm that it doesn't run on 2017 anymore! Will to try now Unity 5.