loodakrawa Posted August 25, 2015 Report Posted August 25, 2015 SpriterDotNet A simple, fast and efficient Spriter implementation in pure C#. Feature complete. About The goal of SpriterDotNet is to be as fast as possible while keeping the code clean and readable. Being a pure C# implementation, SpriterDotNet doesn't depend on any external libraries / frameworks. It focuses on simple and efficient calculations of all transforms at a given point in time. This allows using it with any framework just by mapping calculated transforms to concrete objects. Supported Features Basic animations Bone animations All curve types (Instant, Linear, Quadratic, Cubic, Quartic, Quintic, Bezier) Points Collision Rectangles SubEntities Events Sounds Variables Tags Character maps Animation blending Plugins / Examples Unity MonoGame Source Code GitHub Repository JohnnyType and overcrafted 1 1 Quote
loodakrawa Posted August 25, 2015 Author Report Posted August 25, 2015 Hi guys, I attempted a rather different approach and made a pure C# implementation of Spriter that can be used with basically any .Net based framework. I'm going to release it as an open source project in the next couple of weeks. Also, I'm going to provide examples in several frameworks (Unity, MonoGame and SDL.Net). And to provide that, I need actual .scml files. Are these the most up-to-date official .scml files? If not, where can I find the most recent ones? Also, how are they licensed? Or in other words, can I distribute them as examples in my library? Quote
Mike at BrashMonkey Posted August 25, 2015 Report Posted August 25, 2015 Yes, there's also greyguy: http://www.brashmonkey.com/temp/GreyGuy.zip Sounds like an awesome project, loodakrawa. Please be sure to contact lucid@brashmonkey.com if you have any specific questions regarding the data format etc. cheers Quote
loodakrawa Posted August 25, 2015 Author Report Posted August 25, 2015 But what about redistribution? Can I use GreyGuy in an open source project on GitHub? Quote
Mike at BrashMonkey Posted August 25, 2015 Report Posted August 25, 2015 Yes. Absolutely. Cheers. Quote
loodakrawa Posted August 25, 2015 Author Report Posted August 25, 2015 Awesome, thanks!I'll keep you guys posted about the status. The actual implementation is stable - I'll publish it as soon as I have a decent example. Quote
Wompus Posted August 28, 2015 Report Posted August 28, 2015 I am so hyped for this. :shock: I'd love to see your implementation. Quote
DSE Posted August 28, 2015 Report Posted August 28, 2015 Brilliant, cant wait to give it a try !!! Quote
DSE Posted August 28, 2015 Report Posted August 28, 2015 As a follow up - if you need someone to give it a test, I am willing :cool: :-P Quote
loodakrawa Posted August 29, 2015 Author Report Posted August 29, 2015 I'm glad you guys are interested! :)The implementation is working fine with the exception of advanced curve types (Quadratic and Cubic) - I contacted lucid about it and currently waiting for clarification. In the meantime I'm polishing the MonoGame example. I'll give it a day or two, and if I don't get an answer / don't manage to solve the curves issue, I'll publish it with just the linear curves and update it later. Quote
DSE Posted August 29, 2015 Report Posted August 29, 2015 Good stuff. Looking forward to trying it with my OpenGL stuff ... keep it up. Quote
loodakrawa Posted August 31, 2015 Author Report Posted August 31, 2015 Good news! While waiting for Lucid to answer my questions I found enlightenment and I managed to make Quadratic, Cubic, Quartic and Quintic curves to work. Also, I polished the MonoGame example and added another SCML to test various scenarios. I pushed the code on GitHub and hopefully it's going to work on other people's machines. I'd like to hear any feedback/suggestions you guys have. Cheers Quote
DSE Posted September 1, 2015 Report Posted September 1, 2015 I will give this a go tonight. Are there any known limitations on this implementation ? Quote
loodakrawa Posted September 1, 2015 Author Report Posted September 1, 2015 I will give this a go tonight. Are there any known limitations on this implementation ? Not really. The only thing is that this is just a C# implementation and it needs a little bit of work to use with any framework. It's not strictly plug n' play. But from my point of view, that's a plus because it keeps a clean separation of concerns. Let me know how your testing goes. In other news, I added the Unity example as well. Had a bit of trouble with Unity and source control but I think I got it under control now. Quote
DSE Posted September 5, 2015 Report Posted September 5, 2015 Ok I have it working and everything was going fine until I tried the wonky skeleton asset from Spriter. Its walk loop animation works up to the point of the loop (end of anim) the skeleton appears to head butt the floor, then it resets to the correct places and continues fine. Any ideas ? Do you need a video or asset to test with ? Cheers and great work !! Quote
loodakrawa Posted September 5, 2015 Author Report Posted September 5, 2015 Thanks for the feedback - I'll test it out and try to fix it ASAP. Quote
loodakrawa Posted September 7, 2015 Author Report Posted September 7, 2015 Ok I have it working and everything was going fine until I tried the wonky skeleton asset from Spriter. Its walk loop animation works up to the point of the loop (end of anim) the skeleton appears to head butt the floor, then it resets to the correct places and continues fine. Any ideas ? Do you need a video or asset to test with ? Cheers and great work !! I managed to get the WonkySkeleton walk animation working. However, I noticed that the Crumble animation also behaves in a strange way so I'm investigating that at the moment. Did you encounter any other animations that behave in a strange way? I'm trying to find more examples since the skeleton is rather complex and that makes it harder to pinpoint the actual cause. I'll update the lib when I fix the second problem as well. Quote
Mike at BrashMonkey Posted September 7, 2015 Report Posted September 7, 2015 The Crumble animation is tricky because it puts use to a little known or understood feature in Spriter that allows for each key-frame to have a completely different hierarchy as needed... at any key-frame in an animation, Spriter lets you completely change which bones or sprites are children of which other bones, or even completely add or delete sprites or bones on the fly. cheers. Quote
loodakrawa Posted September 7, 2015 Author Report Posted September 7, 2015 Oh, that explains a lot. I was crunching through a lot of data and going through raw XML never bothering to actually look in Spriter :)As always, thanks Mike for the quick support. I updated the GitHub source and now the Walking animation should work fine. Also, I added the issue of animations with changing hierarchy as an enhancement for the future (when this feature gets documented) Quote
lucid Posted September 8, 2015 Report Posted September 8, 2015 Known Issues Animations with changing hierarchy (waiting for official documentation) I can probably help you get this working without having to wait for the documentation. Basically, if you're already working with the mainline keys and using the bone_refs and object_refs to get the keyframes you need, it should be mostly automatic. for instance. If you have something like: <bone_ref id="3" parent="2" timeline="16" key="1"/> you would go to timelines[16], and the key[1]. You always tween with the very next key ( [2] in this case). Always do the tweens with the next key as if there is no changing hierarchy, using the hierarchy of that current key (in this example, the parent="2", tween normally without checking if there is a hierarchy change on the next key). The refs will automatically point you to the correct keys, and you don't actually have to do anything else to support it aside from the usual reading of the hierarchy from the mainline key. If you're not using the refs and are instead looping through the each object's timeline to get the current key, the only additional thing you have to do is that if the time manages to land at the exact time of a timeline's keyframe (currentTime=timelineKey.time), you still need to check if the very next key also has that exact time. If so, use that one instead. All the rest should work automatically as above. Please let me know if this helps, and feel free to pm or email me (lucid@brashmonkey.com) if you need additional info. Quote
loodakrawa Posted September 9, 2015 Author Report Posted September 9, 2015 Fixed! Thanks to Lucid for great support. lucid 1 Quote
DSE Posted September 9, 2015 Report Posted September 9, 2015 Hello, I have tried the latest version and the walk is now working :) great stuff ! I have the walk + idle working 100%. The crumble + attack anims work but dont loop. The other anims dont start/loop. Let me know if you need any more info/video. Thanks, Dave. Quote
loodakrawa Posted September 9, 2015 Author Report Posted September 9, 2015 Hello, I have tried the latest version and the walk is now working :) great stuff ! I have the walk + idle working 100%. The crumble + attack anims work but dont loop. The other anims dont start/loop. Let me know if you need any more info/video. Thanks, Dave. I changed the default behaviour from forcing the loop to respecting the data from the scml. Based on this, Walk and Idle are looping and Get_hit_0, Get_hit_1, Attack, Crumble, Regenerate and Gonna_Regenerate don't. Crumbled also technically loops but it only has one keyframe so it looks static. I added the X key to reset the animation for testing animations that don't loop. IMO, it's easier to see what's going on if you loop these animations on demand. If you want all the animations to loop you can either override the AnimationFinished method (or Step if you need more constrol) in MonogameSpriterAnimator or your derived class. Let me know if you have any other issues. Cheers Quote
DSE Posted September 11, 2015 Report Posted September 11, 2015 That makes sense. All seems to work now inside my framework :cool: I had one issue with the bat animations where the 'a' attribute can be "nan". I added this to SpriterSpatialInfo to fix it for me - [XmlAttribute("a")] public string a { set { if (!(value == "nan" || value == "")) Alpha = float.Parse(value); } } Thanks for all your work on this. Its brilliant ! Cheers, Dave. Quote
loodakrawa Posted September 12, 2015 Author Report Posted September 12, 2015 That makes sense. All seems to work now inside my framework :cool: I had one issue with the bat animations where the 'a' attribute can be "nan". I added this to SpriterSpatialInfo to fix it for me - [XmlAttribute("a")] public string a { set { if (!(value == "nan" || value == "")) Alpha = float.Parse(value); } } Thanks for all your work on this. Its brilliant ! Cheers, Dave. Good catch! Everything alpha related should be fixed now. Out of interest - which framework do you use? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.