Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

[RELEASED] Curvy 2 - the ultimate spline solution

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

  1. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Hi. I noticed that after the latest update all my CurvySplines and SplineControllers are marked in my GameObjects as missing scripts. If I place the new CurvySpline script on top of the old one, It no longer recognizes the old CP's. Is this intentional?
     
  2. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    505
    hello, i got this error while trying to export for windows universal PC, any idea? it was from a clean install with the latest version of curvy

    Assets\Packages\DevTools\Extensions\Extensions.cs(1052,43): error CS1061: 'Type' does not contain a definition for 'IsGenericType' and no extension method 'IsGenericType' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)
     
  3. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    @Jake-L

    Hi. I noticed that after the latest update (from 2.1.2 to 2.1.3) all my CurvySplines and SplineControllers are marked in my GameObjects as missing scripts.

    There are a lot of changes that are not documented in the ReadMe.txt. There are some new handles for spline CP's for instance. Somehow the custom editor scripts are no longer hooking up to their script counterparts. I have not been able to track the error myself. Have you actually tested the update before publishing it, or am I doing something wrong on my end? I don't think I am, since I literally just downloaded the new version of Curvy, nothing more.
     
  4. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    I just double checked by taking an old project with 2.1.2 and importing 2.1.3 from the Assetstore over it (using Unity 5.6.1f1), using both lazy import (just clicking import to replace changed files) and full replacement (deleting packages, then import). All custom scenes are still working.
     
  5. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Thanks, fixed!
     
  6. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    I'm using 5.6.1p4 since there is a bug that is preventing me to build in previous versions. Very strange.
     
  7. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    I have a really silly question. How do you reference a CurvySpline type in javscript? I know C# inside and out but i'm forcing myself to use this terrible language.
     
  8. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    No idea, I never used Unityscript, but being Monobehaviours after all this should be possible.
     
  9. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    386
    Hello, I have bought Curvy, and really love it, and like it very much, and is surely the best spline I have seen, and have seen many others.

    I know you have given a lot of documentation and information with tutorials, and I have tried to find what I need before putting this here, but I am sorry that I could not find it, and would be great if you can help

    Please, I want to have 2 or 3 splines in the same scene, but do not know how to do it. I tried to duplicate controller and it gives an error, so I think that maybe I should assign the different splines to just one controller. please tell me where is this featured in the documentation or video tutorial

    thanks very much

    wish you all the best for you and for your awesome Curvy asset
     
  10. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Controllers just control single objects on a spline. To have multiple splines, either duplicate a CurvySpline GameObject or create additional splines with the toolbar (there's an Add button).
     
  11. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Hello Jake,

    I have started to play a bit with Curvy. I made a spline... and I made my Camera move on that spline using the Spline Controller. Great!

    Now I'm trying to do something a little bit more complicated.

    I'm using your 12_Train scene to try out some things. I got rid of your train but I duplicated the Train Body for testing purposed. Just to have a mesh there.

    1. How can I move something in ... reverse? The speed value is only positive. I have my train that I made it move forward... however I also want to move backwards. Is there a way to do this?

    2. I manually placed the train a bit lower like this:


    However when I click play, it moved a bit up like this:


    I'm just curious what is causing this exactly.

    3. For testing purposes I'm doing something like this:

    Basically when I press Kayped 2 I'm setting the railtrack to be PathB. This works fine... train works, but when it arrives at the start position of PathA, it jumps imedieatly at the start of PathB and it does not continue in PathA.

    I'm mostly trying to imagine a map where I have multiple splines. Like a spline network. When I start the game I want maybe the option to start on a particular spline on a particular location. I want to be sure that my train will not jump around so... what should I look for?

    4. Now for something that it's really complicated in my eyes and it's not really urgent.

    How do I turn this:

    Into something like this:


    I'm talking about the place where the lines intersect. I know this is pretty complicated... like you need to find the angle of the spline so you replace it with another mesh or something... anyway. Would this be possible to do in curvy?


    Sorry for the big post.
     
  12. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    742
    Intersections can happen anywhere. And not only after a junction if two rail intersecting.

    The only way to realize this for a junction is to use scripting that build up a procedural mesh and place all intersections planes based on the spline direction, size of rails, size of the groove, etc.

    The method to find any intersection by any spline has any curve takes very long to calculate. Why?.... I will tell you.
    Do : Step +3 inches on the first spline, and compare the rest of all splines (stepped by 3 inches each) if they intersecting with. Repeat on the second rail : Loop

    I tried several methods, predefined quad trees, rail colliders and also shader based solutions eg draw pixels in different colors for rails and add them to get new colors for intersection parts. But anyway.. If you have a solution, please get back to me. I'm interesting in. :)
     
  13. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Yea... that's a bit to complicated for me :D And a bit boring to do. Like I like and know some logics of programming, but then we get to those things that get way to specific and it get's to boring for me. :(
     
  14. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    742
    Yeah.. developing nice stuff is more than hard work :)
    Btw, the half transparent colored splines on white background are the fastest way currently to find intersections for me. But building an animated mesh junction by script with all variable parameters and UVs is a real pain!!
     
    Last edited: Jul 26, 2017
  15. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,643
    upload_2017-8-7_23-30-1.png

    I have a problem (first time user, long time payer lol)

    I want to try placing objects along the spline, but the spline input don't want to onnect to the path in volume spot, I don't understand why and I read the manual up and down and all around.
     
  16. Joonsoo-Kim

    Joonsoo-Kim

    Joined:
    Oct 18, 2016
    Posts:
    3
    Same for me! Is there are any solutions ??
     
  17. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Yes, it's because the Volume Spots module needs a rasterized path. Either use "Rasterize Path" or "Extrude" module, both outputs a rasterized path. See the picture below, taken straight from the 22_CGClonePrefabs example:

    graph.jpg

    Note that "Spline Path" has a green title and the output is colored green while "Volume Spots" takes a white Path only. Green means non-rasterized (i.e. undetermined resolution). Reason is that some setups require a certain sample/raster point resolution. So the general rule is: green = undetermined until requested by one or more modules telling them how they want the path rasterized.

    I hope that makes sense,

    Jake
     
    neoshaman likes this.
  18. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    Is it possible to make an object and/or a camera follow a path that is generated procedurally ? I mean, I have prefabs that represent a portion of a path, in each portion I'd like a spline and be able to procedurally build my "road" and having my "target" follows the path or "each portion" of my road.

    Thanks
     
  19. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    786
    @Jake-L Hey Jake, long time no see!

    I was wondering if you could refresh my memory on some parts of Curvy. Specifically, I having a hard time remembering if there was a way to work with spline data in complete isolation from any GameObjects and Components. We heavily use splines in our project to analyze and animate projectile trajectories, unit movement paths, deterministic debris and so on, but all those cases have zero need for spline visualization or serialization or editing of spline data through the component system. Is there a way to work with raw spline data, not classes inheriting from MonoBehaviour in Curvy?

    Upd: Nevermind, the limited feature set I needed (data-only Bezier splines with cached points and constant sampling) turned out to be rather straightforward to implement. Keep up the good work! :)
     
    Last edited: Sep 18, 2017
  20. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    You'll have several options:
    * add connections between the prefab splines
    * create a "master" spline that combines/copies the prefab splines (should be the best option if your tiles are static)
    * handle spline switching manually with events. May cause issues with smooth transistions, though. If you have Bezier with fixed orientation, you're fine. For CR-Splines with dynamic orientation I'd stick to one of the other ideas.
     
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,671
    I've upgraded my Curvy to the latest and now it no longer recognizes the FollowSpline class. What has this changed to?

    [EDIT]
    I found it. It's SplineController. I just have to figure out how to make it work now because the interface is a bit different.
     
    Last edited: Oct 12, 2017
  22. Astx

    Astx

    Joined:
    Apr 23, 2015
    Posts:
    9
    Hello!
    I need to build very long 2D spline with about 500 nodes. How i can import them?
    Thank You!
     
  23. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    397
    Hi,

    it's been 2013 when I released the first version of Curvy, a tool I primarily wrote for my personal needs. Seeing more and more people loving it as much as I do was overwhelming, so I kept on working on it, and kept on and on. Mesh extrusion - added with the 1.5 release just for demonstration purpose - turned out to be the number one feature everyone wants. So, after plenty of months of work I was able to release 2.0 in 2015, featuring a complete UI overhaul and the Curvy Generator. Developed to solve all possible future needs for modular curve processing, it was a huge success. Thank you all for this! Curvy was the biggest personal project I ever did and it was fun to work on it (well, most of time!). Thanks again to all of you! It was a pleasure to see the games and tools you developed with the help of Curvy.

    Five years later now and my life isn't the same as it was when I started this journey. Much happened since then (well, having two small kids makes you rethink priorities), and I came to the point when I had to realize that I can't go on like this. Developing Curvy never was my day job (except for a few months) and I can't spend whole free time to work on Curvy anymore.

    Dropping everything and putting it on GitHub wasn't a real option, because you deserve a product with ongoing development. So I'm very happy that I've found a versatile coder to continue the work!

    Let's switch over to him now...

    THANKS A LOT
    Jake
     
    overthere and toto2003 like this.
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,671
    Happy to see the asset isn't being abandoned. I love curvy and it's an integral part of my current game project.
     
  25. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Hi,
    I am Aka, and am I will be working from now on on Curvy.
    My first contact with Curvy was as a user, 4 years ago. Every now and then, when I came up with some bug fix or optimization, I would write to Jake to share it with him, and that's how we knew each other.
    Right now, I am working on switching Curvy from FluffyUnderware to ToolBuddy, the name under which I publish in the AssetStore, which involves changing the website, forum, and whatnot. Then, in the next few weeks (depending on the Unity asset publishing process) the first post-FluffyUnderware update of Curvy should be released. It will mainly contain bug fixes and optimizations.
    Feel free to write to me if you have any question ask, I will try to answer the best I can.
     
    Last edited: Jan 4, 2018
    Malveka, overthere, toto2003 and 2 others like this.
  26. Malveka

    Malveka

    Joined:
    Nov 6, 2009
    Posts:
    174
    Hi Aka,

    Thank you for taking over the Curvy asset! I wish you the best of success with it.

    And now for a problem. :p

    I'm using Curvy 2.1.3. I recently upgraded my project from 5.6.4p4 to 2017.3.0f3. I now see some nasty runtime exceptions in Curvy. A bit of research uncovered that these same exceptions occur in the Curvy example scene 51_InfiniteTrack. Here's a sample of the one of the exceptions with the full stack trace from the editor:

    NullReferenceException: Object reference not set to an instance of an object
    FluffyUnderware.DevTools.ComponentPool.set_Settings (FluffyUnderware.DevTools.PoolSettings value) (at Assets/Packages/DevTools/Components/ComponentPool.cs:36)
    FluffyUnderware.DevTools.ComponentPool.OnValidate () (at Assets/Packages/DevTools/Components/ComponentPool.cs:97)
    UnityEngine.GameObject:AddComponent()
    FluffyUnderware.DevTools.PoolManager:CreateComponentPool(PoolSettings) (at Assets/Packages/DevTools/Components/PoolManager.cs:177)
    FluffyUnderware.DevTools.PoolManager:GetComponentPool() (at Assets/Packages/DevTools/Components/PoolManager.cs:137)
    FluffyUnderware.Curvy.Generator.CGMeshResourceLoader:Create(CGModule, String) (at Assets/Packages/Curvy/Base/CG/CGResource.cs:165)
    FluffyUnderware.Curvy.Generator.CGResourceHandler:CreateResource(CGModule, String, String) (at Assets/Packages/Curvy/Base/CG/CGResource.cs:48)
    FluffyUnderware.Curvy.Generator.CGModule:AddManagedResource(String, String, Int32) (at Assets/Packages/Curvy/Base/CG/CGModule.cs:576)
    FluffyUnderware.Curvy.Generator.Modules.CreateMesh:getNewMesh() (at Assets/Packages/Curvy/Base/CG Modules/CreateMesh.cs:671)
    FluffyUnderware.Curvy.Generator.Modules.CreateMesh:writeVMeshToMesh(CGVMesh&) (at Assets/Packages/Curvy/Base/CG Modules/CreateMesh.cs:606)
    FluffyUnderware.Curvy.Generator.Modules.CreateMesh:createMeshes(List`1&, Boolean) (at Assets/Packages/Curvy/Base/CG Modules/CreateMesh.cs:518)
    FluffyUnderware.Curvy.Generator.Modules.CreateMesh:Refresh() (at Assets/Packages/Curvy/Base/CG Modules/CreateMesh.cs:417)
    FluffyUnderware.Curvy.Generator.CGModule:doRefresh() (at Assets/Packages/Curvy/Base/CG/CGModule.cs:792)
    FluffyUnderware.Curvy.Generator.CurvyGenerator:Refresh(Boolean) (at Assets/Packages/Curvy/Base/CG/CurvyGenerator.cs:542)
    FluffyUnderware.Curvy.Generator.CurvyGenerator:Initialize(Boolean) (at Assets/Packages/Curvy/Base/CG/CurvyGenerator.cs:507)
    FluffyUnderware.Curvy.Generator.CurvyGenerator:Update() (at Assets/Packages/Curvy/Base/CG/CurvyGenerator.cs:250)

    Any insights?

    Best,
    James
     
  27. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Hi James
    I will take a look at that bug in the next few days. Will let you know when fixed. And thank you for reporting the bug.
     

    Attached Files:

    Malveka likes this.
  28. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Also, for all Curvy users, know that bugs coming through the in-editor bug reporting tool come in a way that makes them easier to handle, so please prefer using that tool instead of this forum.

    Here is where you can find the tool
    View attachment 261504

    Thanks and have a nice day.
     
    Malveka likes this.
  29. Malveka

    Malveka

    Joined:
    Nov 6, 2009
    Posts:
    174
    Didn't realize there was a built-in bug reporter. I'll use that in the future, should it be needed. 8^)
     
  30. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    This issue was fixed, and the fix will be available in Curvy 2.2.0, which I am right now uploading to Unity servers. Unity should validate this version before it becomes available to you. This validation can take anything between few days to few weeks.

    In the meantime, here is how to fix it in Curvy 2.1.3:
    In Assets/Packages/DevTools/Components/ComponentPool.cs
    look for
    m_Settings.OnValidate();
    and replace it with
    if (m_Settings != null) m_Settings.OnValidate();

    Same thing to do in Assets/Packages/DevTools/Components/PrefabPool.cs

    Have a nice day
     
  31. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Curvy 2.2.0 is available
     
    Malveka and red2blue like this.
  32. Malveka

    Malveka

    Joined:
    Nov 6, 2009
    Posts:
    174
    I can confirm that 2.2.0 fixes the runtime exception I mentioned above. Thanks for the prompt response!
     
  33. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    blitzvb and red2blue like this.
  34. Malveka

    Malveka

    Joined:
    Nov 6, 2009
    Posts:
    174
    Excellent! Thanks for making those properties public, amongst the numerous other fixes. 8^)
     
  35. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Hey,

    Congrats for this asset, it seems really great.

    - Is curvy compatible with RAM for runtime spline creation? In term of UV?
    - with procedural spline for road for example, do you provide example for intersection and for the road itself?
    - do you combine the final “road” into one mesh?
    - I was thinking of using archimatix for procedural creation of intersection and object around the road. Do you think it could work?

    Thanks in advance
     
    Last edited: Jan 25, 2018
  36. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Thanks
    Sorry, I am not sure to understand your question. What do you mean by RAM, are you talking about this asset?
    The are examples for roads and rail-tracks. Intersections are only in the rail-track examples. You could easily transfer the same logic to any other kind of extruded meshes, roads included.
    Curvy can combine different extruded meshs into a single one, as explained here
    If you want to create objects around the roads, Curvy already does that, as you can see in the third video trailer, available here.
    If you still need to use Archimatix, you will probably have to write some script that converts the Curvy splines to Archimatix ones, or vice-versa. It should not be difficult. I never used Archimatix, so I can't give you a precise picture of how it should work.
     
    blitzvb likes this.
  37. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Yep. Sorry I should have been more precise.
     
  38. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    No worries.

    I never used R.A.M, but from looking at their videos, especially this one, I don't see anything that would make creating Curvy splines from R.A.M splines impossible: both have positions and orientations, if necessary the river's width can be stored in Curvy segment's meta data, and the UV can be scaled in Curvy too.

    To be sure to give you the best answer, could you explain to me how you want to use R.A.M with Curvy? Do you want to use Curvy to generate mesh that will use R.A.M's materials? or do you want to generate Curvy splines from R.A.M ones? or something else?
     
    blitzvb likes this.
  39. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    yep I plan to procedurally generate a river mesh with curvy and apply the RAM material on it. Ideally along the river, small rocks could be added and the terrain/mesh bellow need to be carved (not with curvy unless you have something like that :)).
     
  40. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    - "procedurally generate a river mesh" : generating a mesh strip, and making it wider in specific places is something Curvy can do.
    - "small rocks could be added" : Curvy can do that. You have multiple examples of it in the last tutorial, here. Jumping right into that advanced tutorial, without having seen the previous ones, can be overwhelming. I am giving you the link just to show you that it is feasible. If you want to know how to do it, I suggest that you start with the first tutorials first. Also, watching all tutorials and looking at the documentation will give you an idea of the fundamental usages of Curvy.
    - "mesh bellow need to be carved": Curvy doesn't offer that out of the box. You will need to code that using Curvy's API.
     
    blitzvb likes this.
  41. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    23
    I have an issue where my Curvyspline returns -1 if I call GetNearestPointTF in a player build, but not if I call it in the editor. Have any of you seen that problem?
     
  42. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    23
    In fact, it's returning a .Count of 0 in the build but not in the editor. The spline definitely has a bunch of points.
     
  43. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Hi,
    It's sleep time where I live. I will take a look at your issue tomorrow. Meanwhile, and if your "Max Cache PPU" value, set in the Curvy preferences, is different from the default value (8 off the top of my head), can you try this solution?
     
  44. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Also, I would like to know the used Curvy version, Unity version and platform of the editor and the build
     
  45. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    23
    I quit Unity and restarted and it went away from new builds -_-. Sorry! I will write to Unity and ask them for the last six hours of my life back.
     
    blitzvb likes this.
  46. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    red2blue likes this.
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,671
    I'm spawning spline paths using PoolBoss and I am seeing really huge CPU spikes when they spawn. The culprit is the RefreshImmediately function. Is there any way I can fix this so that the refresh occurs when the path is instantiated in PoolBoss instead of when the path is activated? With PoolBoss, it instantiates a specified number of clones of each pooled object and they are deactivated in the scene. So, I would have thought any refreshing would have already been done, but I constantly see a huge CPU spike for RefreshImmediately whenever a spline is activated for use.
     
    blitzvb likes this.
  48. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Before answering, and just to be sure that we speak about the same things, did you meant :
    • PoolManager when you said PoolBoss
    • refreshCurveINTERNAL when you said RefreshImmediately
    In the following answer, I assume that it was the case:

    Indeed, when a spline goes from not active to active, a refreshing of it's internal data happens, which can take some time if the spline is very big. There are some optimizations that I am planning to do that should reduce that amount of time.
    Depending on your use case, you can:
    • Set AutoEnableDisable setting in the PoolSettings to true, to avoid deactivating and then reactivating the pooled spline
    • Set UseThreading to true in the spline settings
    Also, if you send me a scene where your issue is visible I will use it to guide my next optimizations work.
    And last thing, which Curvy version do you use?
     
  49. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    132
    Hi, guys
    I added a WebGL demo showcasing Curvy, at this address https://curvyeditor.com/demo
    It's the same scenes than the examples in the package. But since I often receive messages from potential buyers asking if Curvy can do this or that , I thought that making these scenes available to everyone could be a good think.
     
    blitzvb likes this.
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,671
    No, I mean PoolBoss by Dark Tonic. And the function I see called is RefreshImmediately. I don't know what the refreshCurveINTERNAL is.

    Unfortunately, it's only version 1.61. I considered upgrading, but once I tried that and things broke too much.