SFML community forums

General => SFML projects => Topic started by: NateS on February 16, 2013, 02:03:30 pm

Title: Spine: 2D skeletal animation for games
Post by: NateS on February 16, 2013, 02:03:30 pm
Hey guys, just wanted to drop in to spread the good word about a game development tool I've been writing with my good friend, Søren. I'm the programmer and he's the artist. The tool is called Spine and is used to build 2D skeletal animations specifically for games. We are doing a Kickstarter and passed our intial goal in just 3.5 days! We now have ~7 days left and we've posted stretch goals, which include our plan for how to get Spine runtime support for almost all game toolkits. We've already reached the goal for a generic C++ runtime, so SFML support won't be hard at all. :)

You can see the Kickstarter here, and also a download link to try it now:
http://www.kickstart...csoftware/spine (http://www.kickstarter.com/projects/esotericsoftware/spine)

Hopefully you like our tool and can take advantage of the ~50% off you get by obtaining a license before the Kickstarter is over. :)

(http://esotericsoftware.com/spine/files/dragon-screenshot700.jpg) (http://esotericsoftware.com/spine/files/dragon-screenshot.jpg)

The dragon project was provided by ODI EntertaintmenT (http://"http://www.odientertainment.com/").
Title: Re: Spine: 2D skeletal animation for games
Post by: eXpl0it3r on February 16, 2013, 03:25:45 pm
Spine looks and feels really great and I'm quite tempted to back it/purchase it. :)

Personally I'm a bit sad, that you sell it for $ 55 (which makes effectively ~45% off on the Kickstarter and not 50%), but maybe I'm just too spoiled by free software...

What I really dislike is, that you don't give a correct definition of a license. The only text one gets to see before getting redirected to PayPal is:
Quote from: Esoteric Software (http://esotericsoftware.com/spine-purchase/)
Purchase Spine now to enable exporting animations for use in your games! Export as individual or sequences of images, AVI or QuickTime video, or as binary or JSON for use with a game toolkit runtime.

Which doesn't say anything about what the buyer is entitled to do with the software. I'm not a lawyer or anything, but I don't think that you'd win any trial, if big companies would buy one license and use it on every PC and do whatever they want, because the only "agreement" they got, was that the license will allow them to export stuff.
Such vague descriptions are 'okay' for open source and free products, but as soon as it comes to dealing with money, you'll have to get more technical and get more into legal stuff, for your own and your customers protection.

Looking around the forum I found some more information on what the license stands for, but do you seriously expect from people to search the forum to find more information about what they're actually buying?
Quote from: Forum Thread (http://www.esotericsoftware.com/forum/viewtopic.php?f=3&t=48&sid=4fd18cf0661c9679019ae1688c9c52e2)
If you purchase Spine now, you will get all future updates for free. You will also get access to all the runtimes when they are released.
...
One license equates one person or as some people call it "one seat". You won't find any problems switching PC's with it.

I'm sorry if I came a bit rouge across, but I feel like those are important factors that are missing at the moment and felt like pointing them out, as well as giving any other reader the opportunity to see what they  actually might buy or back. I didn't want to offend you, your product or your company in anyway. ;)

But I'm still not sure if I will back it... ;D

PS: Again I'm not a lawyer, but in most countries you're forced to provide an imprint, meaning name + address, at least for commercial websites.
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 16, 2013, 07:07:48 pm
You're right that we should provide proper license terms. This isn't a very fun task of course and we've been super busy focusing on other things, but it is important so I went ahead and put up a license. It is described briefly and the full text is linked here:
http://esotericsoftware.com/spine-purchase/
Title: Re: Spine: 2D skeletal animation for games
Post by: eXpl0it3r on February 16, 2013, 07:47:48 pm
I went ahead and put up a license. It is described briefly and the full text is linked here:
http://esotericsoftware.com/spine-purchase/
This looks good!

Now I know at least what I'm backing. :)
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 16, 2013, 08:45:55 pm
Awesome, thanks for backing us! :) We won't let you down!
Title: Re: Spine: 2D skeletal animation for games
Post by: Halsys on February 17, 2013, 12:42:07 am
I actually saw this the other day(One of my dev partners wanted to throw this in the game we are making)
I would really love to have this for my game... but I'm not sure how I would link this with something like Box2D.

One other thing too... your web site said it will include libgdx and corona but how easy is it to make it link up with something like SFML? Ya you also mentioned you could export it to Pngs or Gifs but that simply wont work with what I'm doing and maybe some other people. So do we also get the code for the Libgdx and corona runtime toolkits? so we could port it to SFML and C++? Or are we kinda left in the dark with Json and Binary code? Really want to know.
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 17, 2013, 12:59:39 am
To integrate with Box2D you could have a few modes: 1) Each frame a Spine skeleton is posed with an animation, then the Box2D parts are positioned to match the bones. Physics don't control the body parts. 2) The Box2D parts are not posed with the animation and physics takes over, giving a ragdoll effect. 3) A mixture of this, eg animate everything but an arm that is injured.

You can export GIF, JPG, and PNG images and QuickTime and AVI videos, but you are right that this is not nearly as useful as using the animation data in your game with a skeleton system.

We want to help as much as possible to get Spine working on many game toolkits. Just throwing a JSON or binary spec at you and hoping for the best would not provide a very good experience. The libgdx and Corona code is available in the full version and can be used as a base or reference to build more runtimes. We are also working on generic runtimes for C++, AS3, Lua, JavaScript, C#, and Java.

We have been working on the generic C++ runtime (almost done!). This handles loading the data, provides a nice object model to manipulate the data (bone world positions, create animations programmatically, etc), can apply animations to a skeleton, and also blend animations. It does basically everything except rendering. So, for SFML support all that needs to be done is implement the rendering.
Title: Re: Spine: 2D skeletal animation for games
Post by: Halsys on February 17, 2013, 01:25:59 am
Quote
To integrate with Box2D you could have a few modes: 1) Each frame a Spine skeleton is posed with an animation, then the Box2D parts are positioned to match the bones. Physics don't control the body parts. 2) The Box2D parts are not posed with the animation and physics takes over, giving a ragdoll effect. 3) A mixture of this, eg animate everything but an arm that is injured.
Suppose that cant hurt.... All the things you suggested are pretty much what I'm going to have to do then.

Quote
We have been working on the generic C++ runtime (almost done!). This handles loading the data, provides a nice object model to manipulate the data (bone world positions, create animations programmatically, etc), can apply animations to a skeleton, and also blend animations. It does basically everything except rendering. So, for SFML support all that needs to be done is implement the rendering.
Well in that case, I will talk to my dev partner and get it.... But after your done with the C++ that is... Going to have to sit here code something else on my game then. :D Thank you.
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 17, 2013, 03:06:38 am
I just asked for some SFML help here (http://en.sfml-dev.org/forums/index.php?topic=10628.0). I've completed the generic C++ runtime but it's hard to tell if it is correct since there is no rendering. :) If SFML rendering isn't too hard, I'll just add support for that so I can easily test on the desktop.
Title: Re: Spine: 2D skeletal animation for games
Post by: moonfirefly on February 18, 2013, 05:45:52 am
Very nice and polished software :) exactly what I need. Also backed ;)
Title: Re: Spine: 2D skeletal animation for games
Post by: panithadrum on February 18, 2013, 08:48:20 pm
It looks very good! Runs perfectly fine...

May I know which software did you use to create the interface? Thank you.
Title: Re: Spine: 2D skeletal animation for games
Post by: masskiller on February 19, 2013, 12:46:36 am
Awesome software, it will prove useful once I resume my project. Sadly I can't buy it yet, but I will.
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 19, 2013, 11:46:43 pm
Thanks for the support guys! :) We've hit tons of stretch goals, Spine is going to be super awesome!

SFML runtime is almost done. Have all the pieces, just need to get them to play nice. :)

May I know which software did you use to create the interface? Thank you.
Sure, it uses libgdx, which has a 2D scene graph called scene2d. On top of that is scene2d.ui, which adds layout and GUI widgets to scene2d. Also used is TableLayout, which does table based layout for UIs.
https://code.google.com/p/libgdx/wiki/scene2d
https://code.google.com/p/libgdx/wiki/scene2dui
http://code.google.com/p/table-layout/
For full disclosure, I'm co-author of libgdx and sole author of TableLayout. :)
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 20, 2013, 08:43:46 pm
How are texture atlases handled in SFML? I don't see any in the SFML API, but maybe I missed it. Do I need to write my own, or maybe is there something (simple) out there that can read a standard atlas format?
Title: Re: Spine: 2D skeletal animation for games
Post by: eXpl0it3r on February 20, 2013, 08:48:53 pm
There isn't a specific class for texture atlases. You can however define the texture coordinates for each vertex and thus define, what part of a texture is being shown. So yes you'll have to implement something similar on your own.
Title: Re: Spine: 2D skeletal animation for games
Post by: Laurent on February 20, 2013, 08:55:15 pm
A texture atlas is just a big texture that contains multiple images. It doesn't require a class to handle it, it's just a matter of using texture coordinates other than 0 and 1 ;)
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 20, 2013, 09:05:44 pm
Ok, thanks. Wanted to be sure before I wander off into the weeds. :)

@Laurent, yes, it's the loading of the atlas data I wanted to avoid writing myself, if something already exists.
Title: Re: Spine: 2D skeletal animation for games
Post by: Laurent on February 20, 2013, 10:33:58 pm
Do you mean that you're using a specific file format that describes the contents of the texture atlas? What format is it?
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 20, 2013, 10:38:46 pm
There are a number of atlas formats, seen on the screenshot here (if you squint hard enough):
http://www.codeandweb.com/texturepacker
I like to use my own (free, OSS, no GUI (that is a feature!), configuration by convention) tool for texture packing:
http://code.google.com/p/libgdx/wiki/TexturePacker
Its format is line-based, though I think I will change it to JSON soon (now might be a good time before I write a C++ parser...). If SFML supported any standard format, that'd be nice since using an atlas is such a common task.
Edit: libgdx texture atlas format example:
https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-android/assets/data/uiskin.atlas
Edit2: libgdx texture atlas format parsing code:
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/TextureAtlas.java#L97
Title: Re: Spine: 2D skeletal animation for games
Post by: Laurent on February 20, 2013, 11:05:36 pm
I see.

SFML doesn't and won't support this kind of format, it's just a multimedia API, not a game framework ;)
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on February 23, 2013, 03:00:22 am
Got a Spine runtime for SFML working:
http://www.kickstarter.com/projects/esotericsoftware/spine/posts/411140
It still needs some work, to be broken out into its own project, etc but it works!

Only 18 hours left on the Kickstarter. :)
Title: Re: Spine: 2D skeletal animation for games
Post by: Halsys on March 01, 2013, 08:32:11 pm
Bought Spine, and it already feels like a good investment... Looking forward to see how well this program/library matures!
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on March 30, 2013, 06:13:51 pm
Just an update since it's been a while, the SFML runtime for Spine has been done for quite some time. I'm getting rid of the C++ Spine runtime in favor of using the new C runtime, so SFML support has been updated to be based on that:
https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-sfml
Title: Re: Spine: 2D skeletal animation for games
Post by: rorlick on June 09, 2013, 02:09:43 am
Hey I'm just starting to include spine in my project, and I'm having what seems to be a pretty basic issue.  This is my first time using git so it could be chalked up to that.  I cloned the repositories from git, but the spine-sfml.cpp calls this include:

#include <spine/extension.h>

which isn't under the sfml runtime folder.  Should I use the includes under spine-c instead?  I tried doing this and it gave me a bunch of errors, although that could have been something with Xcode.

Edit: Ok, so I did get it to run at the least(by adding the .c and .h files from spine-c). Now however, I get this error:

Thread 1: EXC_BAD_ACCESS(code=1, address 0x38)

On this line:

Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* animationName) {
   int i;
   for (i = 0; i < self->animationCount; ++i)
      if (strcmp(self->animations->name, animationName) == 0) return self->animations;

   return 0;
}

I believe this is something to do with the pointer getting released before it is called, is that correct?
Title: Re: Spine: 2D skeletal animation for games
Post by: NateS on June 10, 2013, 10:17:53 am
Replied over here:
http://www.esotericsoftware.com/forum/viewtopic.php?f=3&t=801

:)