Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

RageSpline - Create smooth 2D graphics inside Unity Editor - RELEASED

Discussion in 'Assets and Asset Store' started by keely, Apr 23, 2011.

  1. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I knew I forgot something. I think it needs some refactoring so better I do it.
     
  2. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    You're the man ;) BTW, got the "circle" svg command working. It was anything but trivial, making me wonder why the apparently tiniest things always take the most work.. -_- . "group" commands are also working now, next is making nested groups inherit styles. Alas this week I'm flooded with pay-the-bill work so progress will be slow, but I'll get to it. I'm really determined to make this SVG parser work as well as possible with RageSpline.
     
  3. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Nice. btw. I send you private message earlier. Nothing too important, but maybe you didn't notice.
     
  4. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Dayjob started again: 873 points in the Uphill Rage

    Btw. much smoother gameplay with the new 3.4 betaplayer, which you'll get here
     
  5. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Oh man, I had 5 messages there, all about ragetools :( Sorry for taking so long to reply guys, I utterly fail at noticing that tiny notificiations indicator at the top of the page :(
     
  6. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    any chance to add extrude parameters for your shapes?
    I wanna create 2.5D platformer - and your tool + extrude function should do nice job.
     
  7. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    +1 for an extrude funktion also because of a 2.5D look
     
  8. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    There was discussion on the extrusion earlier. I'm kind of against it since it would get a little complicated since you would need all kinds of new control over something that is 3D. Like textures and stuff like that. But I'm still thinking about it.
     
  9. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967


    Must. Buy. RageSpline.
     
  10. Micha-Stettler

    Micha-Stettler

    Joined:
    Jun 11, 2009
    Posts:
    167
    Can't wait for 1.1 :D
    Especially the new landscape feature looks sweet.

    When will this piece of gold be released?
     
    Last edited: Jun 29, 2011
  11. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Any day now. The actual coding is done, but there's all sorts of stuff to do before I'm submitting.
     
  12. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    444
    Can you paint 2D terrain at runtime? Then it would probably be compatible with our package "EZ Replay Manager" to record painting in-game. I have been asked that, maybe a short answer from you can clearify this mystery :)
     
  13. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Not sure if I understand what you mean by painting, but currently you can't do anything that I would consider painting with RageSpline.

    However I'm considering some kind of painting features for the next update v1.2, but that is far in the future.
     
  14. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    444
    Thanks for your quick answer and sorry for the expression. Let's stick with "creating graphics" instead of painting :D Question is, is it possible at runtime?
     
  15. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Yes it's possible to create and modify RageSpline objects in terms of shape, color, style etc. at run-time too. I'm not sure how Replay Manager works under the hood so it's hard for me to say if you can support these run-time changes with your own product.
     
  16. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    444
    Well, at this stage it wouldn't probably work without some own coding, but I would offer support on that at our own thread for anyone who would be interested to make this work. Your tool being able to be used at runtime makes it definitly possible. Anyway, thank you for your help!
     
  17. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Keely, today I think I've found the reason why sometimes the anti-aliasing doesn't work with imported SVG shapes. Apparently when the points were created in a counter-clockwise fashion inside the external vector editor, RageSpline "bevels" the polygons it uses to fake anti-aliasing to the wrong direction - ie. towards the inside instead of the outside.

    Maybe you're using the point order to define the beveling direction? If that's the case there might be another way to do it. "Hackiest" way I can think about fixing this would be a "flip outline direction" button on the ragespline interface, 'coz to be honest I can't think of any practical way of working that out in the SVG importing side. Thoughts?

    PS.: I can send you some sample files if you want to check them out yourself, after all I can't rule out the possibility that I'm 100% off in my guess :)
     
  18. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
  19. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Adding yet another option might be confusing. I think the clockwise direction can be checked with going through the points and do some magic with cross product. Maybe you could check that while import?

    I think points ABCDEF... you cross product A->B x B->C, take the Z value and then B->C x C->D and add Z value to previous. Loop the points like this and see if Z is negative or positive. Something like that. Sorry I'm math disabled person :)

    Not sure if I want to complicate stuff with some automatic fix for the ragespline, because 99.9% times ppl end up building shapes the right way because they use the prefabs.
     
  20. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    I agree another option for an exception case would be confusing. I can't do that exactly during import since I build the ragespline in "real-time" as the points are parsed. What I can try to do is add a clean-up pass after the shape is created, but just like you, I'm a deep-math disabled person :) I assume I'd need to first find out *if* the points are created in counter-clockwise order, which would require some volume checking - it's not as simple as comparing the first and second points position.

    Not an easy thing to do, at least for me. Initially I'm considering to extend rangespline to add a new interface button to ragetools to do the anti-alias edge flip on a per-ragespline basis. Do you think that would be hard to do considering the way you coded it?
     
  21. spentak

    spentak

    Joined:
    Feb 11, 2010
    Posts:
    246
    I've been reading through all these posts and am very interested in RageSpline. One thing that I have not been convinced of yet (since no one has really posted any great examples yet) is of using tileable textures on the spline "objects". I want to use this program only for the purpose of using the spline curves and physics (I don't want to use the autofill coloring, etc.). So lets say I have a curvy ground that a ball rolls on. I might use a tileable texture for the top curvy "layer", then underneath it I would use a tileable rock texture. This would be similar to the ground you see on angry birds (except with nice curves). So if this can be done, is this the best tool for what I want to accomplish?
     
  22. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Do you mean that you wan't two textures? One that follows the curves (like grass) and other that's more static (like ground rock). You can do this, but multi-texturing is currently bit confusing with RageSpline so I would wait for the next minor update which is currently on beta testing. This kind of "layering the grass" however only works for the landscape mode. You can do it for arbitrary shape too, but then you'll get grass on bottom too. It's kind of hard to tell whether something is supported or not. I would need some pictures.
     
  23. spentak

    spentak

    Joined:
    Feb 11, 2010
    Posts:
    246
    Here is an image of what i'm talking about. With the multi-textures
     
  24. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    This can be achieved. However it's less complicated and more documented after the next update.
     
  25. jackshiels

    jackshiels

    Joined:
    Feb 29, 2008
    Posts:
    357
    I'm sorry if this has been asked before (probably has), but how many draw calls does this generate and can you select the resolution of the splines?

    Thanks
     
  26. Ryuuguu

    Ryuuguu

    Joined:
    Apr 14, 2007
    Posts:
    391
    Is anyone working on an in game editor for RageSpline? Something that could be used as a base 2D map editor.
     
  27. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Yes you can select the resolution and adjust the vertex count this way.

    In Unity Basic with dynamic batching it generates one DC for each object over 300 verts and batches normally if you go under. Complicated shapes always need over 300, but simpler can go below.

    In Unity Pro and static batching you have more options and should get lower DC.

    However I have to once again remind that you can have way over 50 drawcalls with RageSpline on 3G iPhone and get 60fps easily. RageSpline is very good in having no overdraw and those mobile phones seem to be fillrate bound, not drawcall bound.
     
  28. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
  29. Drakon

    Drakon

    Joined:
    Jul 21, 2011
    Posts:
    2
    Acess Control Points/Handles [xyz] to Animate them in [xyz] creating live 3D spline?

    Hi Guys, well done for the great work on RageSpline and RageTools.

    I'm looking to purchase these tools, and need a clarification on the 3Dness of the Splineness :)
    I really need to push the 'beak' back or forward in depth for leaves, curved surfaces and such. Is this possible?

    Also I'd like to animate the control vertices procedurally during the game. I'm using playMaker and would love to assign a slider to some of the control points on the fly to create morphing shapes. Is that possible somehow?

    Are we heading toward Nurbs surfaces? :)

    Thank you very much!
    Great work!

    Drakon
     
    Last edited: Jul 25, 2011
  30. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Not 100% sure what you mean. It might be language barrier thing. RageSpline is currently for 2D graphics only. Only thing going on in the Z-axis (depth) are the physics colliders.

    I'm not ruling out the possibility of some kind of 3D stuff later on, but for now it's not part of the plan.

    Animating the control points is currently provided via the API calls like SetPoint(position) and then calling RefreshMesh() function after you are done. MaDDoX's RageTools has some visual tools for animation too, when he releases eventually.

    I don't have playMaker myself, but I saw some discussion on relating RageSpline vs. playMaker and I think they are compatible in some way, but I can't really comment on that. I'm sure MaDDoX knows more about this, since he is somehow connected to playMaker also. Try using the forum search or google and maybe you get lucky.

    btw: lets try to keep the conversation in the new v1.1 thread:

    http://forum.unity3d.com/threads/949...-v1.1-RELEASED
     
    Last edited: Jul 25, 2011
  31. Kid Germ

    Kid Germ

    Joined:
    Jul 30, 2011
    Posts:
    6
    When will this update be released?
     
  32. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    The subject that was discussed (about multi-texturing) is already released.
     
  33. Kniazeff

    Kniazeff

    Joined:
    Sep 23, 2011
    Posts:
    1
    Whether it is possible to compile the project created with EZSprite on other unity where there is no this plug-in?
    Forgive me my bad English
     
  34. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    Has anyone used Ragespline to make UI ?
    It seems that the compact data format of spline is ideal for mobile and web game :)
     
  35. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    603
    Big fan of Ragespline! Really nice code, and really nice UI.

    Couple of requests:

    - Could the UV coordinates be exposed for manual entry? It's tricky to precisely adjust the UVs once they've been adjusted in the editor. UV handle snap-to-grid would be good too.

    - Would it be possible to to expand a shape outwards rather than inwards? Whilst it is possible to make a hollow shape like a room, you must add extra points for the outside and you end up with wasted polys for the outline. It would be handy to be able to make a hole in a shape, rather than the shape itself. Does that make sense? :)
     
  36. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Do you mean that you want to input values for the texturing gizmo, or that you want to input the actual UV values for each vertex on a mesh. Or maybe something totally different?

    Holes unfortunately make the triangulation algorithm much trickier to handle all the situations. I've been giving it some though, but so far it is not happening. Would also possibly be hard to support n holes. Maybe just one hole per RS would ease it up, but still would be a major change to the codebase in terms of how the outline and embossing works too.
     
    Last edited: Oct 9, 2011
  37. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Exactly, with some resolution-independence scripts to help. We're using it on our game, Pet Pong, and it's extremely practical, 10x easier than using EZGui in many cases - no atlases to worry about :) . Check our Ragespline extension pack, it's just about to kick in the Asset Store:

    http://forum.unity3d.com/threads/106840-RageTools-Flash-like-2D-Vectors-and-GUI-for-Unity
     
  38. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    603
    With regards to holes, the way I imagined it is that your ragespline outline IS the hole, and your spline extrudes outwards from there. I considered it as a landscape that can go around all sides, perhaps.

    I meant the coordinates for the gizmo. I ended up making an Editor script to reset the gizmo, and I may end up creating a more complex editor script to achieve this functionality. I'd much prefer it as part of the editor though, of course! :)

    Code (csharp):
    1. using UnityEngine;
    2.  
    3. using UnityEditor;
    4.  
    5. using System.Collections;
    6.  
    7.  
    8.  
    9. public class ResetRageSplineUV : ScriptableObject
    10.  
    11. {
    12.  
    13.     [MenuItem ("RageSpline/Reset UV %#r")]
    14.  
    15.     static void MenuResetRageSplineUV()
    16.     {
    17.         Transform[] transforms = Selection.GetTransforms(SelectionMode.TopLevel | SelectionMode.OnlyUserModifiable);
    18.  
    19.         foreach (Transform transform in transforms)
    20.  
    21.         {
    22.         RageSpline spline;
    23.         spline = transform.gameObject.GetComponent<RageSpline>();
    24.    
    25.         if (spline != null)
    26.         {
    27.             spline.SetTextureAngleDeg(0.0f);
    28.             spline.SetTextureAngle2Deg(0.0f);
    29.             spline.SetTextureOffset(Vector2.zero);
    30.             spline.SetTextureOffset2(Vector2.zero);
    31.             spline.SetTextureScaleInv(0.50f);
    32.             spline.SetTextureScale2Inv(0.50f);
    33.             spline.RefreshMesh();
    34.         }
    35.         }
    36.     }
    37.  
    38. }
     
  39. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Hey, just a quick note. Could you be so kind and ask an admin close the older thread of ragespline ?
    This seems a bit annoying that I have to check 2 (3 now) threads about this product, when obviously the newest thread should the only option for people to post in. Hate to hop around here and there to gather ALL important information.

    Just a thought :)
     
  40. vargonian

    vargonian

    Joined:
    Sep 3, 2011
    Posts:
    12
    Hi,

    I'm trying to see how I might approach my problem with RageSpline.

    I'm making a game in which the levels consist of a long, winding, randomly-generated corridor. Essentially the player flies through this corridor in a space ship:



    Because the level is generated randomly and can wind in any direction, I'm trying to determine the best way to use RageSpline to generate the "pieces" of the level, wall-by-wall, that get stitched together at runtime. Of course, I might be over-thinking this, but this is the best I've come up with so far:



    (Obviously I wouldn't want to see any seams between the pieces, but they're just shown for demonstration purposes.)

    So, using the "landscape" mode of a Line prefab seems promising, except that I may need to get fancy with the extrusion angle to make sure that it doesn't leave any holes at the seams. I was kinda hoping that the corridors could just be one big spline that I modify at runtime but I'm not sure how I would approach that or the performance implications of this.

    Am I missing any obvious solutions?
     
  41. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    If you want to go in any direction with your tunnel, I don't see any obvious easy solutions, rather many possible complicated solutions to pick from.

    If you narrow down your direction below 180-degrees, your might get away with just stacking those landscapes like in your picture. You might get some nasty artifacts if you go near 90-degrees either way so I would narrow it even more. I don't think it really makes the gameplay any worse, but that's just my opinion.

    One undocumented trick that might help you with outlines is the inverseTriangleDrawOrder variable. It's not in the IRageSpline API (yet), but it's a public var you can access in RageSpline-class. Setting it inverseTriangleDrawOrder=true, will make the outlines go under the fill mesh and you can combine outlined meshes more easily. Embossing doesn't work when inverseTriangleDrawOrder=true.
     
  42. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Feature Request: Capsule collider option.

    What is the feasability of adding capsules as a collider option. This would be very similar to the box colliders but could potentially make for a smoother collision surface.

    The current box colliders seem to leave gaps along the surface.

    It seems like capsule colliders, if overlapped at the end caps would provide a much more seamless surface.

    Plus, according to:

    http://forum.unity3d.com/threads/34254-Capsule-vs-Box-Colliders

    Capsules are slightly more performant than boxes.

    Thoughts?

    -Jeff
     
  43. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I think adding capsules is feasible technically, but won't the end of the collider make some "bumps" or "dips" no matter have you stack'em along a convex curve? What I mean is that boxes overlap each other nicely, but capsules "leak" outside the smooth curve.

    I'd use MeshColliders over Boxes if you want smoothness anyways, but maybe you have a scenario where it's not possible.
     
  44. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Well, what I want to be able to do is draw some curvy lines using your Line prefab and then somehow get a smooth (as smooth as possible) collision surface over the top of the line.

    Think of a skier skiing on top of the lines and you'll get a pretty good idea of what I'm after. :)

    The problem with the box collider is it seems to leave cracks and crevices along the surface due to the rotation of the boxes. My skier "trips" over these gaps.

    The problem with mesh collider is I'm not using Filled shapes, just the outline that makes up the line.

    My thought with using capsules, is you could get rid of all the cracks and crevis if you linked them all together kind of like a bicycle chain.(but where the chain links have straight edges).

    With this technique, you couldn't have any extremely sharp angles due to the circles (thinking in 2d) that make up the capsule endpoints but you also would not have gaps.

    I'll describe this another way just incase I'm not making sense. Imagine you have a bunch of vertices that make up a line. Draw a circle around each vertices. These circles are the end-caps on your capsules. Now draw straight lines between the circles to represent the capsule edges and you have the thick line with no cracks that I'm talking about. (Note that capsule end-caps would overlap at the vertices.)

    Now all this is currently just in my head, so maybe it wouldn't be a useful as I'm imagining but it seems like it would be.

    -Jeff
     
  45. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    What if the MeshCollider would be created just to follow the outline mesh when the outline is in free mode?
     
  46. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    That would be great. Pretty sure that would solve my problem.
     
  47. robin_notts

    robin_notts

    Joined:
    Apr 7, 2010
    Posts:
    86
    I'd like to see capsule colliders as well. And, talking of this sort of thing: I was thinking only today that RageSpline could do with line caps (rounded etc) for free mode. This would probably help out for SVG imports in RageTools as well.
     
  48. rickgude

    rickgude

    Joined:
    Mar 29, 2011
    Posts:
    3
    Hi Keely. I'm trying to achieve this look with the overlapping outline. I read your documantation, but still, I can't get it done. How did you do this?

    -Rick
     
  49. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    There is an example prefab with the package. It's called MultitextureLandscape or similar.
     
  50. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    If you got it working, could you point me out how I could improve/fix the documentation on this?