Search Unity

RageSpline - 2D Vector Graphics for Unity - v1.1 RELEASED

Discussion in 'Assets and Asset Store' started by keely, Jun 30, 2011.

  1. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    All XML parsing errors fixed along the weekend, phew! Now back to adding features, today I'm taking a break on SVG code and working a bit on the sexy text generation component of RageTools - unsurprisingly called "RageText" :)

    Keely, I've sent you a PM. No good news though, I'm having serious trouble with RageSpline 1.1 performance.. sample file linked in PM.
     
  2. Raphael Dias

    Raphael Dias

    Joined:
    Jan 18, 2011
    Posts:
    61
    Any thoughts on how much RageTools will cost?
     
  3. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    If you were having performance problems in editor with new v1.1, then I got good news.

    MaDDoX reported bad performance with high vertex counts, so I ended up making some optimizations for the mesh refreshing code in editor.

    The run-time performance was always good so this doesn't affect it.

    Optimized 1.1.3 will be available from Asset Store very soon.
     
  4. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Great news Keely :) Playmaker had similar editor performance problems, once Alex added error-checking toggle options to the code they were gone.

    Any estimate I could make would probably be changed by Kaitlyn's (asset store manager) recommendation. In any case, I surely don't expect it to cost more than what Ragespline costed initially.

    * Update: Today I've added "center pivot" to RageTools. It's very handy for, after importing your vector art, being able to get the pivot center in the ragespline's bounding box center instead of "somewhere out there" ruining your scaling and rotation, or requiring you to parent your object to another one to fix it.
     
    Last edited: Jul 5, 2011
  5. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Hmm sounds interesting. Is there some kind of url where this is discussed in more detail?
     
  6. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Just noticed David Helgason mentioned RageSpline on an interview for Edge.
     
    Last edited: Jul 5, 2011
  7. djinni69

    djinni69

    Joined:
    May 10, 2010
    Posts:
    174
    That's fantastic! Must be extremely gratifying, Keely!
     
  8. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924

    Congrats Keely!!! You rock as a dev and great support.
     
  9. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    Hey Keely I am working with your TopDown template and uScript. I made a projectile to launch from the ship but I am getting that tensor message after adding a rigidbody and applying a force the object. Is there option in RageSpline to effect that one vertice offset?

    iByte
     
  10. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I think the tensor error message pops up when you are adding MeshCollider to an object that has rigidbody + MeshFilter that has no depth. You get same error if youre adding meshcollider to a plane primitive.

    RageSpline shoud now always have depth with that one vertice. There is no option to adjust it, but I doubt that you get rid of the tensor problem if you adjust that one vertex any further. I think it's something else now.

    If I were you, I wouldn't use the MeshCollider for your projectile anyways. Always use something more primitive like single BoxCollider or SphereCollider. MeshColliders only make sense if you need accuracy for some complex shape. I don't think you need that kind of accuracy for projectile and you get a lot better performance too.

    Maybe the object doesn't yet have mesh when you adding the collider or something? Maybe the order of things are wrong. You are doing this run-time right? Also always good alternative to instantiating run-time is to have n number of projectiles instantiated at preload. Just keep them somewhere outside of camera and move them in-game when you shoot.
     
  11. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I have this idea that I can't do right now, because I have concentrate on getting all the docs and videos out there, but which I'm juggling in my head for future.

    I got the idea from a link I stumbled onto at reddit.com, where bunch of guys were streaming their 24h gamejam from their screen at justin.tv. People would come and go to the stream and chat. The developing guy would ask them advice and spectators would give pointers etc. Seemed like lot of good fun.

    Because I consider RageSpline very very fast for prototyping games out of thin air in matter of hours, I thought that maybe if I could do something similar:

    Cast my desktop as a stream while I develop the game or prototype, people could come in and suggest what would they want to see in the game and I could try to do it. I could also try to build working versions to web constantly. Sourcecode could also be exported as package so that RageSpline owners could examine the project+code more closely if they want to. Or maybe people could even submit stuff to the project as we go!

    I think I wouldn't do 24h, but maybe something shorter. We'll see.

    Main benefits:
    1. Great live tutorial
    2. Promotional value
    3. Fun

    What do you guys think?
     
  12. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    sounds like a really cool idea!
     
  13. iisjreg

    iisjreg

    Joined:
    Mar 25, 2011
    Posts:
    101
    +1 Sounds good
     
  14. djinni69

    djinni69

    Joined:
    May 10, 2010
    Posts:
    174
    I posted this in the Conversation Engine thread, but thought you would want to see it too Keely.

    REPOST -
    I wanted to share an arcade game that I prototyped using the Conversation Engine and RageSpline. This was a spoof on a project that we're tackling at my full time job (migration to a virtual data center, from physical hardware), and the game was meant as a stress reliever for all my peers. I hope you guys enjoy it!!

    http://www.7moosegames.com/VDCMadness
     
  15. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I can appreciate the VM and cloud references. :)
     
    Last edited: Jul 7, 2011
  16. djinni69

    djinni69

    Joined:
    May 10, 2010
    Posts:
    174
    Nice! We're fighting issues with VMWare and SAN storage. UGH ... it'll be really nice once IO speeds hit expected rates. Until then, it's an exercise is frustration
     
    Last edited: Jul 7, 2011
  17. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Unfortunately this was dealt with in a recent and unpublished beta release - which I'm part of. As you can see I'm highly engaged with high-end and kick-ass Unity tech like yours and Alex's :) There were some on-and-off public discussions about it in the PlayMaker forums.

    In time: We've accomplished a HUGE milestone with RageTools yesterday, I'm extremely excited about it! No more hype though, expect a proper video sometime this weekend ^_^
     
    Last edited: Jul 7, 2011
  18. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    New version 1.1.4 is live on Asset Store.
    - Improved editor performance
    - Automatically flips counter-clockwise shapes to clockwise
     
  19. Raphael Dias

    Raphael Dias

    Joined:
    Jan 18, 2011
    Posts:
    61
    Keely, what are the plans for RageSpline now that 1.1 is out?! Any ideas?
    Great work btw, I bought it just before the last version update and i am looking forward to look carefully into it.
     
  20. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I'm going to write a second .plan post for v1.2 and what kind of ideas I have for it.

    Here is the .plan I had for v1.1 update and seems like I got a lot of the wishlist covered if you count MaDDoX's RageTools in too.

    Some of those features didn't make it because I just wanted to ship the update and some of them because at the end of the day they didn't make sense or weren't possible for one reason or another. I'm going to go through that too in the next .plan file.

    But let's just say v1.2 is going to be awesome.

    edit: But let's say add that I have to focus on getting documentation up to par before I can do any new development.
     
    Last edited: Jul 8, 2011
  21. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Hey Keely :) I didn't reply you "all is good?" question 'coz I didn't get the chance to investigate the problem in depth to know if it was in my end or yours. Now I'm sure, it's in RageSpline :D No worries, though, I did a thorough explanation with nice pictures to showcase what generates the problem, should make it much easier for you to fix it. I'll also send the test spline letter file link to you through PM. Sorry everyone if what goes below is a boring bunch of pictures, I can't attach images to a PM so I decided to just put them here.

    Keely (or should I say Juha? I never know..), remember when I mentioned early in RageTools development that the over-lapping of start and end points was making the shapes "ripped up"? I've circumvented that in RageTools SVG importer by simply copying the out tangent from the last point to the in tangent of the start point, then removing the former end point. Unfortunately, when generating hollow shapes the way I'm doing it, using Illustrator to slice a line connecting the outer and inner shape, that workaround doesn't work. And to be honest that bug can be recreated inside RageSpline itself easily, especially now that you've added a grid and numeric positional point settings. Overlapping points from different segments of the spline simply make RageSpline's polygon generation algo to go haywire.

    Pics bellow:










    I can work around it "by hand" for custom-generated fonts, but it'll keep generating invalid shapes from regular SVG-parsing whenever points overlap. What do you think, fixable?
     
  22. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    It seems that it has nothing to do with density either. It's just an overall thing with the ear-clipping algorithm that you can't have vertices inside the shape itself. You get same ripping with no overlapping vertices, when you have overlapping triangles instead. Maybe there are other algorithms that do not suffer this, but I really don't wan't to go there.

    I think the right approach now is to be a "little naughty" and hack it. I think we shouldn't move the spline control points, but just "move" them a little bit under the hood only when triangulating. This way we can let the user use the grid. I hope this hack doesn't bite us later.

    I need to experiment a little a see if it's viable solution.
     
  23. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Btw. I just took my head out of my arse and negotiated with my current employer that I downgrade my full-time job to part-time starting next month. More time for RageSpline!
     
  24. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Onwards and upwards
     
  25. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377
    Nice, I just bought RageSpline, too... good to hear!
     
  26. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Really? I've never noticed in any other case than this that I'm describing.


    Doesn't sound bad to me. During import, I could do a similar thing by back-checking each added point against a pool of existing points in the shape, but since that issue affects any regular shapes built in RageSpline it makes sense to be fixed (or hacked :)) in the lowest common denominator. So what you're proposing is that the user-input point coordinates, after triangulation/tesselation, will be offset by some ridiculous number (say, 0.00001 in X) when it hits an existing vertex coordinate? Won't that be too expensive to check in "real-time"?
     
  27. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Most likely going to do it per control point and not per actual vertex. Since 100+ control point shapes are unlikely and we are talking about very fast float == float check.

    I'm going to check this somewhere inside the RefreshMesh(), shift the bad guys, do the mesh and then shift back. I'm hoping this doesn't break anything since I'd assume Unity Editor is a multi-threaded application, but I highly doubt it.

    This way user won't (hopefully) notice anything in the grid or the coordinates etc.
     
  28. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Just in case any geeks out there are having a heart attack: I'm not using == with floats, but Mathf.Approximately() ;)
     
    Last edited: Jul 9, 2011
  29. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Finally two new videos for the RageSpline 101 series. This series is really basic stuff, but obviously we need to start with beginner videos.

    ragespline.com/videos
     
  30. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377
    OK, I feel like a moron, but there has to be something very obvious I'm missing here.

    I set up a circle. I set its colliders, mass, etc. and it collides with my terrain fine. So, I copy the circle and paste it into the scene, just above the other circle. They are both positioned properly on the Z-axis, have their constraints locked as needed (X/Y rotation, Z-axis position/transform), and will fall with the gravity. Now, the problem I'm having is that they won't interact with eachother, at all. They just fall through eachother, and along the terrain as though nothing's wrong.

    What might be causing the issue where my copied gameobjects won't interact with eachother's rigidbodies? I have attached a picture to illustrate and show my inspector properties.
     

    Attached Files:

  31. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    In order for MeshCollider to collide with other MeshColliders, they need to be selected as convex. Just check the convex-checkbox in the RageSpline inspector.

    It's explained in the Unity docs here

    edit: Noticed that this is not mentioned in the RageSpline docs. I need to fix that.
     
    Last edited: Jul 11, 2011
  32. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    This weekend I've finally added Auto-AA to RageTools. It dynamically bulk-adjusts the AA level of a RageGroup (Container with one or multiple ragesplines) depending on its size (if ortho camera) or size and distance to the camera, if currently active camera is in perspective mode. I've done some tests and it works great, it "snapshots" whatever anti-alias is set in the editor as a reference and takes over from there. All that's left to do in it is making it compare the current screen/window size to the editor-set size, so it also scales AA up and down relative to the current screen size.

    In practice the idea is to as faithfully as possible replicate the behavior of Flash, keeping sharp AA for your vector graphics and fonts in whatever output size, with ZERO user intervention! With the added bonus that, if you want to have a more blurry or softer AA, you just set that in the editor, and the same "anti-alias aspect" will be kept no matter what the output device!

    Unfortunately it took longer than I expected and it delayed the demo video, but it was critical so I just had to go for it. Hopefully I get some more free time during the week, this is getting better and better :)
     
  33. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    Hey MaDDoX,

    sounds like your making some great progress. Looking forward to seeing your system in action.

    iByte :)
     
  34. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    The sheer amount of methods in RageSpline API doesn't seem to help with the motivation for writing the docs. One by one I guess.
     
  35. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Thanks iByte :) I have to publicly thank to Keely for all the amazing support, RageTools wouldn't have got where it is without him. It's being a great two-way road so far, I give him suggestions and help him find the deepest / higher-end bugs in his code and he helps me pull off my code's magic whenever I hit a stumbling block in his code. You're the man Keely! ;D

    Maybe you could group multiple API methods in a single description? I've notice much of it is stuff like get/set for each property, as long as you already have a description for what each property does you could just link stuff around. Also, have you checked that practive of using XML comments (///) instead of the regular comments entry (//)? Supposedly it helps with auto-documentation generation and prevents that comments be dettached from their original logic block when you refactor stuff. BTW, that problem (I think it's reSharper stuff) is the #1 reason why the lead coder in the studio hates comments and turns class and function names into "comments", a practice that I personally dislike much since it makes calling those functions and classes too verbose. What do you think, are those XML comments useful or not?
     
  36. LeshaVH

    LeshaVH

    Joined:
    Mar 22, 2010
    Posts:
    84
    Hi, Keely!

    1) Can I generate spline meshes for each letter from TTF files?
    2) What about bones for skinning animation? :) And animation plugin? Maybe morphing animation? :)
    3) Can be number of Draw Calls reduces a little bit? Or now its highly optimized?
    What I mean - if I am not using any textures - can be theoretically Draw Calls Reduced to 1?

    Hi, MaDDox!
    When release? that's is the question! :D

    Thanks!
     
    Last edited: Jul 12, 2011
  37. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Standard RageSpline doesn't have any importing features. MaDDoX is doing them in is 3rd party extension, but not sure if TTF is part of the plan.

    I have to admit that animation is something I have almost zero experience. RageSpline mesh is an ordinary mesh, so if there are tools for modifying arbitrary meshes real-time, then those should work. MaDDoX is also doing something on the animation front, but again you have to ask him. My API has all the tools needed for morphing, but you need to build it on top.

    I'm planning to do some kind of morphing and real-time modifying examples later on, but I'm still stuck with doing basic documentation.

    Yes without textures (or using atlas) you can theoretically go with 1 DC, but in reality most of the shapes with anti-aliasing need over 300 verts and won't be batched. If you can live with jagged sharp polylook, then you get away with less verts. Since I'm not a Pro version user, I'm not sure how the static batching works, but maybe you can get 1 DC forced with that.

    HOWEVER the time of the "draw call religion" is really in the past in my very humble opinion. You don't want to fire hundreds of them, but you can easily do 50 with Unity 3.x in any platform (atleast with RageSpline) and it doesn't even break sweat. I mean 60fps on iPhones and god knows how much on desktop.
     
    Last edited: Jul 12, 2011
  38. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I'm just glad someone uses the friggin API :). I hope others will follow the lead.

    Yeah surely most of those are just get/set stubs, mut it was still demoralizing to style them by hand in CSS. I know there are tools and all that, but I got a feeling that those would be even more pain.

    I'm actually in the school of no commenting and verbose code. I think nicely formed and verbose code is self-documentating. This is one of those things that there isn't just one clear answer. It's more like feel-based and you just get used to certain style without hard evidence of it being better than others. I haven't tried xml stuff at all. I'm aware there are stuff like that, but I'm just maybe too lazy and too used of working alone with my code to get deep into more "organisational" features. Maybe I should :)

    I hate when I can't tell what function does by it's name. :)

    edit: sent you PM again incase you miss it
     
    Last edited: Jul 12, 2011
  39. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Regarding an API reference, I recommend using inline XML comments, and then use something like Doxygen to build your API reference. It works really great and will save you a ton of time, and the results will be far better than if you did it all by hand (thanks to it tracking inheritance, having click-throughs for type definitions, etc). Plus, it's almost one-click easy.

    I've even found that in a lot of situations, the comment auto-complete in Monodevelop can even describe what the method does pretty close to what you would write yourself anyway, so you only have to add a word or two sometimes, saving you tons of time. All you need is to do a "///" on the line above your method, and it will do the rest.
     
  40. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    @Brady Thanks for the tips. I should look into those. If not for this project specifically, but for future reference. I'm going to try to make the current docs the manual way first and get a gauge on how nerve-breaking it is that way.

    I have like zero inheritance in my API. It's just in/out functions with basic types like ints, floats, Colors and Vector3. Only couple of my own simple enums, which should be pretty self-explanatory.

    I'm planning to weight the API documentation heavily on good code examples, because that is the way I prefer to learn myself. Not sure how much help inline commenting would do in that respect.
     
  41. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I really shouldn't show this because it's still pretty awful. Last night I had like two hours free time and I had the option of writing some docs or have some fun with RageSpline. I went with the latter.

    ragespline.com/dodger

    I'm going to improve the game later on. I think it has weird "rage potential".
     
    Last edited: Jul 13, 2011
  42. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Recent support e-mail made me realize Unity has something called subMeshes. Somehow I have missed this altogether. This is very good news for multi-texturing in RageSpline.

    If I understand the concept correctly, this means that I can do multi-texturing for outline and fill vertices separately. You get two drawcalls instead of one, but who cares. I'm going to leave the old way intact if someone wants to get optimal performance and doesn't mind the limitations.
     
  43. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Yeah, that's one of the beauties of using your API code, everything is so clear that I've never needed a single comment to know what something does tbh. I'm a very old school coder so I tend to save up factoring (break long code chunks in functions/classes/whatever) for last, when it's already screaming "duplicate code, you moron!" at me. I especially dodge multi-file inheritance as much as possible, it highly reduces readability and I honestly don't understand how browsing across multiple files is any better than scrolling up and down with a mouse scroll wheel.

    Function/Method overload (multiple ways to call the same function) is very cool though and extension methods are the best thing since sliced bread! It allows me to create new methods (eg.: setVertexDensity) to Keely classes without ever having to actually edit his files - which would be overwritten in a new release and force me to re-add my custom method.

    I know the OO-purists hate me when I say that, but I'd only use inheritance in a very complex scenario where similar object types would share lots of methods or you can really benefit from being able to copy values between these types. Yet in most cases simply referencing a common external function does the trick much more clearly, that's why I don't understand why some coders jump straight to inheritance. The fact is that as soon as you add the "virtual" word to any function you're automatically assuring that a large portion of the coders out there (incluing people without Visual Studio-like assistance) won't understand your code and won't be able to help you find bugs and/or enhance it. What's the advantage?

    Two *entire* hours?? OMG how I envy your free time :( This week has been mayhem for me.. seriously looking forward to the weekend :D
     
  44. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Not directly from a TTF but it's quite simple to type the characters in your vector drawing software (illustrator, inkscape) and then import it to RageSpline using RageTools. That's how I build RageFonts in fact.
    The problem with such an approach is that bones affect the polygons, using weights, and that would only be done after ragespline had rendered the vectors to polygons. That's why I imagine the performance would be really poor using bones if you're changing the vertex density on the fly like RageTools does. What RageTools does is affecting the RageSpline control points instead, using area deformers called "magnets" with a radius and user-defined fall off. Easier to use than to explain, in practice it works like if you're sculpting something like zBrush or Mudbox, but being able to keyframe animate your moves.

    Wish I could work the whole day on RageTools instead of keep cranking out character animations non-stop :) I'm still aiming for a late July closed beta and early August release though.

    Thanks![/QUOTE]
     
  45. backer

    backer

    Joined:
    Mar 7, 2011
    Posts:
    20
    Great tool for creating stuff. Bought it a couple of days ago and working with it into a new game. Just having one problem with the performance for iPhone/Andriod.

    For each object that I create it adds another draw call, after a couple of object that will be in the view that's a lot of draw calls. Would be great to see some feature to implement it with for e.g. Sprite Manager 2 so that SP2 took care of atlas textures and making it down to a single draw call with e.g.. SpriteManager.

    Keep up the good work
    Thanks
     
  46. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    I'm trying to help and not be offensive, but have you actually builded for iPhone/Android or are you just staring at the draw call count :) ?

    People have reported smooth fps with Ragespline + alot of draw calls. What kind of stats are you getting on device?
     
  47. Skyrise

    Skyrise

    Joined:
    Nov 3, 2005
    Posts:
    158
    I think it's an heritage about older devices and older versions of Unity. :)
    With 3GS+ devices and Unity 3 drawcalls are not a problem imho. Batching is always a priority, but now you can have 40-50 drawcall with 60fps on iOS with no problem.
    I don't have Unity Pro, but I'm curious to know if static batching works on Ragespline objects... :)
     
  48. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    That's something I should test. Well, weekend finally here, ragetools sleeves up! ;)
     
  49. Ryuuguu

    Ryuuguu

    Joined:
    Apr 14, 2007
    Posts:
    391
    Great tool :)

    I am having a problem with SetFillColor1 () Specficaly I have

    Code (csharp):
    1. GetComponent<RageSpline>().SetFillColor1 (new Color(1.0f, 1.0f, 0.0f, 0.50f));
    it only works if I have a style set for the RageSpline. If I set style to none the fill color does not change. I want to change each objects fill color separately at run time so I don't want to use the same style for multiple objects.

    [Edit added tried work around]
    tried a work around using SetSyle

    Code (csharp):
    1. rs.SetStyle(activeStyle);
    I can see the style gets changed in the editor but it does not change appearance in game. If I pause and switch to scene and back sometimes it changes in game window. In build on iPad it does change look.
     
    Last edited: Jul 18, 2011
  50. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    HI keely, is there a way to override style attributes on a specific ragespline object without having that affect the original stye or the rest of the objects using that style.?

    iByte