Search Unity

[RELEASED] Curvy 2 - the ultimate spline solution

Discussion in 'Assets and Asset Store' started by Jake-L, Sep 29, 2015.

  1. aspartamed

    aspartamed

    Joined:
    Mar 23, 2016
    Posts:
    7
    I am working on trying to use Chronos and Curvy right now. The Spline Controller does some unique things with time instead of using delta time and calculating its own delta times. I am "working on" getting them to work together for my own limited uses cases. Was curious if you ever got them to work? Thanks!
     
  2. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Was that you who asked in our support forum as well? I replied there ;)
     
  3. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    CurvyController uses Time.deltaTime when playing (by utilizing DTTime.deltaTime which returns a working delta in the editor as well). I don't know Chronos, but how does it work to manipulate the actual time (and as a follow up question, what does it need to be compatible)?
     
  4. aspartamed

    aspartamed

    Joined:
    Mar 23, 2016
    Posts:
    7
    I just started using it. I was able, without much work to get the CurvyController to use chronos time. Though I only made it work for the branch of code I happen to be using, skipping a lot of the "inEditor" stuff. I still have a "scale" problem where the object moves faster along the spline then before but that's easy enough to fudge for now. The SplineController uses time to handle passing between splines.

    Here is the chronos migration guide.
    http://ludiq.io/chronos/migration
     
  5. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Yeah, you'll need to make CurvyController use Timeline.deltaTime instead of Time.deltaTime. If you examine the source, you'll find the usage of DTTime.deltaTime. Either replace that or change the property in the DTTime class (inside DTUtility.cs).I recommend the latter because DTTime won't be updated as much as CurvyController.cs will.
     
  6. sonjak3

    sonjak3

    Joined:
    Apr 10, 2016
    Posts:
    2
    Pre-purchase question: Just checking that Win Universal support isn't planned to be released in the next few days. I would really love to use this for a course project but I have an aggressive timeline.
     
  7. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Core Curvy (i.e. splines and controllers) is already working with WinUniversal, but Curvy Generator is giving me hard times. Also I'm struggling with some weird errors with texture resources from the editor that forces one to restart Unity after each successful compile. But it's definitely on the way...
     
  8. sonjak3

    sonjak3

    Joined:
    Apr 10, 2016
    Posts:
    2
    Ok, good to know, thanks! Curvy Generator is a feature we wanted to use so we'll probably go with an alternative, but best of luck getting it to work.
     
  9. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey Jake,

    Quick question, we are trying to create a standalone build for windows x64 but we are having some weird issues with the build that I believe are due to something happening during the build process. After the standalone player builds I get approx. 8 of the following errors :

    NullReferenceException: Object reference not set to an instance of an object
    FluffyUnderware.Curvy.CurvyConnection.OnDestroy () (at Assets/Packages/Curvy/Base/CurvyConnection.cs:101)
    UnityEditor.HostView:OnGUI()

    The problems with the build have nothing to do with Curvy (In the built version of the game I get null references where there are none in the editor (clearly there are references in the inspector) and if I rebuild without changing anything I don't get the same error but I will get a different one in another scene that was previously fine....) but the errors are the only thing I can see from the editor console.

    Cheers,
    Colton
     
  10. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    That's in fact weird, I will run some tests to see if I can reproduce it. Btw, what Unity version you're using?
     
  11. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Unity version 5.3.3p1. I also noticed that I get 8 of these errors and I have 8 scenes that have splines in them.

    EDIT : Still getting the errors in the console after building.. I was able to solve the issue with the built version though. Looks like I had some kind of race condition or something because my GetComponent<T>() wasn't working but manually assigning the reference worked fine.
     
    Last edited: Apr 25, 2016
  12. BirdieL

    BirdieL

    Joined:
    Oct 3, 2015
    Posts:
    7
    Hi Jake,

    Do we have solutions to render a RANDOM piece of a spline? Say, how can render position [30, 100] with a colour and [130, 230] with another colour? Thank you.
     
  13. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    You can limit the range of an extrusion in the ExtrudeVolume module (or alternatively in the InputSplinePath module). To extrude multiple pieces, use multiple Extrude modules. You can, but not need to, combine them into a single CreateMesh module then.
     
  14. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    I'd like to point all Curvy users familiar with major 3D packages (or working in a team with 3D programmers/artists) to this post. Thanks!
     
  15. Ogien

    Ogien

    Joined:
    Nov 21, 2012
    Posts:
    165
    Its very disappointing that Curvy 2 does not work on the Windows Store platform. I am currently stuck with 56 Errors that I cannot fix, all related to System.Reflection GetType

    As it stands I cannot port my newest game to the Windows Store, and I cannot port my old games to Curvy 2 because it does not work in Windows Store.

    Please fix this, you don't even have to make it all work, (I don't need to make splines in Windows), the spline just has to run. Hide any editor code behind ifdefs. That should cut down the workload.
     
  16. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Curvy 2.1 adds Windows Store compatible (UWP 8.1/10). It's already submitted for review and will arrive shortly in an AssetStore next to you!
     
  17. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    Is there a way to add a new control point in the middle of an existing curve?
     
  18. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Sure. Just use CurvySpline.InsertAfter() with the previous CP in question as parameter. You could use CurvySplineSegment.Interpolate() from the same CP to get the position for the new CP.
     
  19. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    @Jake L.

    Thanks, Got it.
    This should be part of the Curvy UI though.
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    It is.
     
  21. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    That's right: Either select a range of CP's and use the Subdivide command from the "CP Tools" toolbar button or select a CP and CTRL-Click anywhere while in Spline Draw Mode (Hotkey "Space") to insert Control Points.
     
  22. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Curvy 2.1.0 Released
    • [NEW] More options for the Mesh Triangulation wizard
    • [NEW] Improved Spline2Mesh and SplinePolyLine classes for better triangulator support
    • [NEW] BuildVolumeCaps performance heavily improved
    • [NEW] Added preference option to hide _CurvyGlobal_ GameObject
    • [NEW] Import/Export API & wizard for JSON serialization of Splines and Control Points (Catmull-Rom & Bezier) - Experimental
    • [NEW] Added 22_CGClonePrefabs example scene
    • [NEW] Windows Store compatiblity (Universal 8.1, Universal 10)
    • [FIX] BuildVolumeMesh.KeepAspect not working properly
    • [FIX] CreateMesh.SaveToScene() not working properly
    • [FIX] NRE when using CreateMesh module's Mesh export option
    • [FIX] Spline layer always resets to default spline layer
    • [FIX] CurvySpline.TFToSegmentIndex returning wrong values
    • [FIX] SceneSwitcher helper script raise errors at some occasions
    • [CHANGE] Setting CurvyController.Speed will only change movement direction if it had a value of 0 before
    • [CHANGE] Dropped poly2tri in favor of LibTessDotNet for triangulation tasks
    • [CHANGE] Removed all legacy components from Curvy 1.X
    • [CHANGE] New Control Points now use the spline's layer
     
  23. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hi,
    I'm researching possibilities to use Curvy for my project:
    http://steamcommunity.com/sharedfiles/filedetails/?id=604035651

    I would like to use it for runtime generation. That's is possible as I read.
    I'm curious if these use cases are supported in content generator too:
    Adjust terrain heightmap by generator?
    Generate river/stream mesh based on spline. Simply I want to generate "nearly" horizontal mesh based on spline and use water shader for it. Maybe shape mesh based on intersections with terrain?

    Thanks
    Peter
     
  24. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Hi Peter,

    comfort to ground is currently only supported for paths, not extruded volumes. The latter as well as terrain shaping and dynamic shape side extensions are planned features, but I can't give a timeframe for that.

    Jake
     
  25. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Does anyone know how I could export a Spline from Blender so that Curvy can import it? Blender doesn't really have a dedicated JSON serializer.
     
  26. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    For what it's worth: I remember wanting to do just this a couple of years ago, and I did manage.. It was something something handheld with empty's in Blender, exported as FBX, listing alphanumeric in unity, pasting Spline data onto them.. something something.. it worked ;)
     
  27. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    There is a experimental blender exporter in work, but it's not fully polished yet...
     
  28. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Don't forget to visit the AssetStore - it's Madness Sale time!
     
  29. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    16
    I am getting this error after importing Curvy: Assets/Packages/Curvy/Base/CG Modules/Editor/NoteEditor.cs(16,31): error CS0309: The type `Note' must be convertible to `FluffyUnderware.Curvy.Generator.CGModule' in order to use it as parameter `T' in the generic type or method `FluffyUnderware.CurvyEditor.Generator.CGModuleEditor<T>'

    Anyone have idea what is going on?
     
  30. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    I'd guess one of the involved classes is already present in the project ('Note' or 'NoteEditor' most likely). Either that or the package wasn't imported completely. I just imported Curvy into a fresh project (Unity 5.4) and it compiles fine.

    By the way, the 'OnLevelWasLoaded' warning introduced with Unity 5.4 can be ignored, but it will be fixed soon!
     
  31. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
  32. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    The errors looks like not everything was imported, so please reimport the package. Perhaps delete the Curvy, CurvyExamples and DevTools folders under /Packages before importing again - just in case.
     
  33. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    Well, i tried redownloading and doing that though it didn't fix it. Its worth noting that i don't have unity pro. I noticed there seems to be a lot of pro only shaders that curvy includes.
     
  34. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    I'm sure we'll get this sorted. Curvy doesn't use any Pro-Only features, so it must be something else.
     
  35. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Hi there,

    i don't know if this is the right Asset for me, so here is the question. I want to build in the feature that the player has the possibility to build power poles, train tracks or pipelines in the game (like SimCity). Would Curvy 2 make it possible to build this within the game (at runtime)?

    Hope you know what I mean.

    Thanks a lot!
     
  36. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I have a bezier spline with a spline controller. I need to know when the controller has reached the end of the spline, I tried using .position but it reaches 1.0 on the first control point on the spline not at the end of the entire spline.
    So my question is how do I get a value of 0 to 1 for the entire spline not just the spline segments?
     
  37. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    If you watch the trailer, there's a scene showing track editing in the railroad scene. The same can be achieved at runtime, but you'll need to add Control Point interaction by yourself (i.e. grabbing and dragging of CP's, everything that is done in SceneView in the editor). Allthough, it will be some work to make it feel & behave like road drawing in SimCity. So it's possible, but there is no "Draw Tracks" easy mode included.

    @arkon
    "Position" depends on the movement mode ("Relative" or "Absolute"). You might want to use "RelativePosition" that goes from 0..1 or bind the OnEndReached event.
     
    red2blue likes this.
  38. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    I wonder why in the asset store description there is no link to this forum or to custom support on the official website, it would even more trust about the very good and helpful support

    I have already bought other spline assets, but when I found this one, this is the best one I have seen that gives lots of different features, is easy to use and gives very good results.

    It can be used for many different things and is much more than just splines.

    It also includes 22 example scenes to show all the possible things it can be done, so you can see for yourself how it is done and you can learn faster and see how it works

    love it!!
     
  39. qkjosh

    qkjosh

    Joined:
    Nov 29, 2015
    Posts:
    33
    Hi, just started using this asset. I'd like to ease the movement along a spline, so I'm using the Animate curve as previously suggested. However, when using this it seems that the OnControlPointReached event no longer works. It would be nice to have more robust easing features! Am I just missing something in regards to Animate?
     
  40. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,051
    How do you disable the scene ui menu? I can disable it the menu in preferences, but the import/export but hangs around?
     
    SunnySunshine likes this.
  41. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    It'll be fixed with the next release next week, until that we provide a manual fix for this bug.

    @qkjosh:
    I'll look into this issue and provide a fix next week (currently on vacation).

    @SpaceRay:
    We had links to the forum some time ago but dropped it in favor of a direct link to Curvy's website where forum and other resources are linked. But you're right, adding it again might be a good idea.
     
    SpaceRay and SunnySunshine like this.
  42. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Hello Jake,

    I am using your awesome, excellent and well done Curvy with an flying helicopter and some weapons, and they look very good. Surely for me your spline manager is the best one available.

    The problem is that you are using a PoolManager.cs script, and I with the weapons comes another PoolManager.cs script and as you know well, you can not have two scripts with the same namespace in the same project.

    I modified the scripts of the Curvy asset renaming the PoolManager name to PoolManagerCU on the filename and all through the scripts content, but the problem is that there is one script that does not allow to change the names as they keep being red when modifying, so this script still is giving errors and I can not hit play as I can not remove the errors

    SUGGESTION OF NEW NAMESPACE

    The real reason of this post is to suggest that you could change the Poolmanager namespace to another one like for example PoolManagerCU or PoolManagerCurvy, so this way you avoid any possible conflict and problems with any other possible asset that may also have a Poolmanager script, and so there would not be any problem using your own awesome asset combined with any other asset with pleasure and without any problem.
     
  43. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Hi SpaceRay,

    the PoolManager Curvy uses is already namespaced (FluffyUnderware.DevTools), so either your other Poolmanager isn't namespaced or you're using both in the same script. In that case you should set an alias for at least one of them, e.g.

    Code (CSharp):
    1. using PoolManagerCU = DevTools.PoolManager;
    Renaming the script isn't recommended, you'll get in trouble on next update.
     
  44. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    This might've been asked before but it seems you've done lots of updates. Does curvy support some kind of procedural object placement, spline adjustment etc at runtime, i.e. can you generate an entirely procedural tunnel/tube/roads and have objects placed on them randomly etc? Or does everything have to be build in the editor?
     
    TerraUnity likes this.
  45. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,251
    +1 for all above questions. However, the developer stated multiple times that all editor operations exist in the API and can be used in runtime but a workable scene demo with all these capabilities would be awesome. This asset is great :)
     
  46. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    You can do all of these things. You can access and alter the nodes of the spline and refresh it. You can access any one point on the spline. The API is easy to use. Check out the documentation here:

    http://www.fluffyunderware.com/curvy/documentation/splines/start
     
  47. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Yes to all questions except the last: There's not much difference between editor and runtime. Also, there's an example scene that creates both spline and Generator (procedural content) dynamically by script from scratch.
     
  48. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Ok sounds good. Although what I presume is, if I want to proceduralize I need to go into scripting, ie there isn't any settings or user interface at editor-time, in the in editor, that would let me set up and configure 'what' would be randomized at runtime or how? ie can I make it procedural without coding?
     
  49. amasinton

    amasinton

    Joined:
    Aug 12, 2006
    Posts:
    138
    Great asset!

    I have a (hopefully) dumb question, easy to answer: How do I create - using the API at runtime - a smooth, semicircular arc with a bezier spline consisting of a start point, an end point, and a mid point? All three are at the correct coordinates to draw a 3-point circle, I just need a hint on how I'd set the handles of the mid point so that the spline interpolation is a semicircular arc between the start and end points.

    Does this make sense?

    Thanks!
     
  50. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    You can work with Curvy Generator at editor time and modules that rely on randomness (object placing etc.) will generate different results on each run (toggleable option). But of course you'll have much more options with a bit of scripting.