Game Development Community

Experiences with Spine?

by Eero Karvonen · in Torque 2D Beginner · 05/20/2014 (9:49 am) · 36 replies

Hi,

I searched the forums and couldn't find any more than one Spine-related topic...
So, what kind of experiences have you had with Spine assets in T2D so far?

Does the T2D runtime already include all the pro features that are presented with green lights on on Spine's website? For instance, mesh-deformation capability?

In other words: is now the right time to go and buy the pro license?

Is the T2D 3.0 Spine Toy the only TS-bindings documentation on it at the moment?
Page«First 1 2 Next»
#21
05/29/2014 (4:31 am)
It's crashing on line 101 in spAnimationState_setAnimation. Can you run from Xcode and see if there are null variables or a bad pointer?
#22
05/29/2014 (6:48 am)
@Eero : Are you using T2D 3.0 in an unmodified state or did you try exporting the Spineboy example from the Spine Software?

If you've simply copied the contents of Spinetoy/1/assets/Spineboy/, I really don't get why it crashes. Just tested it with the stock development branch (albeit on Windows 7), works fine.
#23
05/29/2014 (9:25 am)
@Mich, whenever I try to build and run T2D 3.0 in Xcode, there are 156 syntax errors because in @property's attribute declaration (strong) is not understood for some reason. This is an example line,
@property (strong) OSXTorqueView* torqueView;
What should I do to it? Should it compile out of the box? (I have Xcode 3.2.6. installed)

@Simon, I'm using T2D 3.0 in an unmodified state. The Spine Software demo examples become screwed up for some reason; they don't render correctly. The Spine toy asset however does. Both produce the same error report when trying to change to "jump" animation.
#24
05/29/2014 (10:38 am)
According to the Wiki

Quote:
If you are working on Mac or wish to deploy your game to the iOS platform, you will need to obtain Xcode version 4.5.3 or higher, which you can obtain from...

Aside from that, I have no clue.
#25
05/29/2014 (10:40 am)
Simon is correct. You need to update to a new Xcode to get rid of those errors.
#26
05/29/2014 (10:46 am)
The Spine examples, when exported from the software, will create new atlas files and skeleton files. They will also pack the texture using default parameters, which might not work "out of the box" in T2D.

For instance, image files larger than 2048x2048 won't be loaded by T2D and rotated spine sprites will not be rotated properly either. You can modify these options in the Spine Software itself, in the Export Dialog.

I guess I should work on documenting the Spine Exporting parameters.
#27
05/29/2014 (12:15 pm)
Allright, thanks, now it's compiling without problems!

The debug executable results in
0   com.garagegames.Torque2D-DEBUG	0x0014384b spAnimationState_setAnimation + 107 (AnimationState.c:240)
1   com.garagegames.Torque2D-DEBUG	0x001437d8 spAnimationState_setAnimationByName + 88 (AnimationState.c:229)
2   com.garagegames.Torque2D-DEBUG	0x0017c66b SkeletonObject::generateComposition() + 379 (SkeletonObject.cc:361)
3   com.garagegames.Torque2D-DEBUG	0x0017c188 SkeletonObject::setAnimationName(char const*, bool) + 136 (SkeletonObject.cc:230)
4   com.garagegames.Torque2D-DEBUG	0x0017d1fe cSkeletonObjectsetAnimationName(SkeletonObject*, int, char const**) + 110 (SkeletonObject_ScriptBinding.h:56)
5   com.garagegames.Torque2D-DEBUG	0x00179bd3 cSkeletonObjectsetAnimationNamecaster(SimObject*, int, char const**) + 259 (SkeletonObject_ScriptBinding.h:51)
6   com.garagegames.Torque2D-DEBUG	0x001c82ae CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) + 19566 (compiledEval.cc:1637)
7   com.garagegames.Torque2D-DEBUG	0x001b27b8 Namespace::Entry::execute(int, char const**, ExprEvalState*) + 184 (consoleNamespace.cc:476)
8   com.garagegames.Torque2D-DEBUG	0x001d00b8 Con::execute(SimObject*, int, char const**, bool) + 536 (console.cc:1051)
9   com.garagegames.Torque2D-DEBUG	0x001d022e Con::executef(SimObject*, int, ...) + 222 (console.cc:1080)
10  com.garagegames.Torque2D-DEBUG	0x00336971 SceneObject::postIntegrate(float, float, DebugStats*) + 145 (SceneObject.cc:633)
11  com.garagegames.Torque2D-DEBUG	0x003bb428 Scene::processTick() + 1576 (Scene.cc:877)
12  com.garagegames.Torque2D-DEBUG	0x003bb4de non-virtual thunk to Scene::processTick() + 30 (Scene.cc:909)
13  com.garagegames.Torque2D-DEBUG	0x00140412 Tickable::advanceTime(unsigned int) + 322 (Tickable.cc:107)
14  com.garagegames.Torque2D-DEBUG	0x001e6d25 DefaultGame::processTimeEvent(TimeEvent*) + 309 (defaultGame.cc:652)
15  com.garagegames.Torque2D-DEBUG	0x001ea51f GameInterface::processEvent(Event*) + 383 (gameInterface.cc:96)
16  com.garagegames.Torque2D-DEBUG	0x001ea774 GameInterface::processEvents() + 228 (gameInterface.cc:166)
17  com.garagegames.Torque2D-DEBUG	0x001e69ad DefaultGame::mainLoop() + 93 (defaultGame.cc:500)
18  com.garagegames.Torque2D-DEBUG	0x004791a3 -[osxPlatState mainTorqueLoop:] + 83 (platformOSX.mm:286)
19  com.apple.Foundation          	0x94ed0974 __NSFireTimer + 117
20  com.apple.CoreFoundation      	0x92775406 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
21  com.apple.CoreFoundation      	0x92774da5 __CFRunLoopDoTimer + 709
22  com.apple.CoreFoundation      	0x92759bb2 __CFRunLoopRun + 1842
23  com.apple.CoreFoundation      	0x9275901a CFRunLoopRunSpecific + 378
24  com.apple.CoreFoundation      	0x92758e8b CFRunLoopRunInMode + 123
25  com.apple.HIToolbox           	0x98985f5a RunCurrentEventLoopInMode + 242
26  com.apple.HIToolbox           	0x98985cc9 ReceiveNextEventCommon + 374
27  com.apple.HIToolbox           	0x98985b44 BlockUntilNextEventMatchingListInMode + 88
28  com.apple.AppKit              	0x96b2293a _DPSNextEvent + 724
29  com.apple.AppKit              	0x96b2216c -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
30  com.apple.AppKit              	0x96b185cc -[NSApplication run] + 855
31  com.apple.AppKit              	0x96abb5f6 NSApplicationMain + 1053
32  com.garagegames.Torque2D-DEBUG	0x0047843b main + 43 (main.mm:25)
33  com.garagegames.Torque2D-DEBUG	0x000b6dc5 start + 53

AnimationState.c, lines 239 to 241 read,
239	entry->loop = loop;
240	entry->endTime = animation->duration;
241	_spAnimationState_setCurrent(self, trackIndex, entry);
I'm not skilled enough to draw any valuable conclusions from this information just yet.

@Simon, that explains about all of the weirdly rotated and clipped limbs from the Spine Software demo I tried to import.
#28
05/29/2014 (12:19 pm)
Throw a breakpoint on that line of code via Xcode, then evaluate the variables there. See if anything is null or contains wrong paths or whatever.
#29
05/29/2014 (1:31 pm)
Line 240,
entry->endTime = animation->duration;

Respective variables at line 240's breakpoint,
entry	spTrackEntry *	0x110900d90	0x0000000110900d90
->endTime	float	0	0

animation	spAnimation *	0x110912ca0	0x0000000110912ca0
->duration	float	1.06659997	1.06659997
...
I put another breakpoint at 241:
_spAnimationState_setCurrent(self, trackIndex, entry);

self	spAnimationState *	0x101a5c170	0x0000000101a5c170
->data	spAnimationStateData *const	0x101a59f70	0x0000000101a59f70
->timeScale	float	1	1
->listener	spAnimationStateListener	0x0	0x0000000000000000
->context	void *	NULL	0x0000000000000000
->trackCount	int	1	1
->tracks	spTrackEntry **	0x101a5ae00	0x0000000101a5ae00

trackIndex	int	0	0

entry	spTrackEntry *	0x101a5c3b0	0x0000000101a5c3b0
->next	spTrackEntry *	NULL	0x0000000000000000
->previous	spTrackEntry *	NULL	0x0000000000000000
->animation	spAnimation *	0x101a7f5d0	0x0000000101a7f5d0
->loop	int	1	1
->delay	float	0	0
->time	float	0	0
->lastTime	float	-1	-1
->endTime	float	1.06659997	1.06659997
->timeScale	float	1	1
->listener	spAnimationStateListener	0x0	0x0000000000000000
->mixTime	float	0	0
->mixDuration	float	0	0
So, next and previous spTrackEntries seem to be nulls.
#30
05/30/2014 (9:05 am)
@Simon, thanks for the reply and thats cool to hear. I just noticed something Spine has though: Spritesheet exporting. While some might consider this a bit of an oxymoron, it still means games can use every pro feature from Spine without ever needing the runtime libraries. Of course having such smooth animations is gonna take a ton of frames so it comes down to whether T2D (or any engine) can handle such larger animation spritesheets with little impact? But seeing this engine being said to render thousands of sprites with good FPS I wonder if it will apply to animations? Time and testing will tell, but any opinions are welcome :)

(Apologies for using your thread still Eero, but you might find the info useful too)

On an similar note I was wondering something. How do we go about crossfading / blending / smoothing between animations? I guess this applies not just to Spine but raster. What kind of engine features (or techniques) can we use to achieve smooth transitions? I haven't learn the entire framework but I can't recall a dedicated feature for it.
#31
05/30/2014 (9:29 am)
Yes, one option is to use Spine to create classic spritesheets.
And yes, it would take a ****ton of frames. However, this would still display one frame at a time, so it doesn't really affect performance in that sense. It would require more system memory and larger files, which is not ideal for mobile.

The main issue here would be that the spritesheets would need to be split across multiple files of a maximum size of 2048x2048 each. While it can be achieved, I don't know exactly how T2D can manage using animations which run across several separate files. Named sprite cells(new to 3.0) might help but I haven't played with that yet so I don't know.

For smoothing between Spine animations, use setMix() look here under Animation States.

For raster animations...there are very few functions to control these. I guess you could modify the frames of the animation at runtime but sprite animation is very digital, display a frame, display the next frame, display the next frame, etc. My guess is you would have to create transitional animations in addition to the standard animations.
#32
05/30/2014 (1:11 pm)
@John, until now, I have been doing just that. My project's animations have been created in a vector-based animation program (ToonBoom Animate 2 - similar to Spine in how you rig a character and animate it) and I've then used a custom script to create the respective spritesheet assets for T2D.

Even the animations for the main character in a game with modern graphics require such big sheets that this is big no no on the long run. That's why I'm looking forward to getting Spine working.
#33
05/30/2014 (2:22 pm)
I just finally bought Spine ESS and there seems to be problems here too, using Win7 64bit. To make it trivial, I did SpineToy.createSpineBoy() to create the boy and it animates just fine -with the Sandbox supplied Spine boy-, but when I re-xport the SpineBoy (named -old, but I removed the -old, in the files too) from Spine and replaced the current one in the Sandbox it is crashing on calling that function. So I don't know if the engine is out-of-date, or I'm exporting wrong from Spine? My T2D 3.0 is stock. To make it worse I can't seem to debug. I haven't done it before with T2D yet. Running in debug from VS2013 Express gives me this log:

http://pastebin.com/fXUcNrrs

No crash, just won't launch it from VS (though I've compiled and can run the .exe manually).

@Simon, how are you exporting / which settings?

Here's the newly exported spine boy:

http://www23.zippyshare.com/v/13604308/file.html
#34
05/30/2014 (3:30 pm)
New Spine version bug confirmed
I exported SpineBoy from the Spine software, using the latest version of Spine to do so. It also crashed upon building the atlas file.

I edited the Atlas file and removed the second line

size: 256,256

And it works fine. Like it or not, looks like we'll have to update the Spine implementation once more!

Another thing (maybe that's just in my Spineboy anyways) is that the jump animations actually animates the scale, which makes the character grow to gargantuan proportions. Edit in Spine (or a text editor) to remove all scale animations and you'll be fine.

Export Settings
Check Pretty Print, Create Atlas. Non-essential data just creates a pack.json file with various details, not taken into consideration in T2D atm.

In the create Atlas settings

CHECK

- Premultiply alpha
- Power of two

DO NOT CHECK

- Rotation

Set Max Height and width to 2048 and leave everything else as is.

Works for me!
#35
05/30/2014 (4:21 pm)
@Simon, much thanks, that fixed it! Mine was "size: 254,252", but still the same point. It may be obvious, but just for others: make sure there's no empty line between (i.e. when you move the "size: ..."):

spineboy.png
format: RGBA8888

That too will crash. Thanks again for pointing out a fix for the animation scaling; that happened for me too! Thanks for pointing out the setMix too! I thought this was simply to randomize things up when I read it before, didn't realise it was to cross-fade! Much thanks!

I think we need the docs up on the wiki. I see the doxygen stuff in the source so I'm surprised it's not there? It's a shame us less advanced users can't contribute the little things to the wiki without being on the team (meaning a very good coder...). Nevertheless, still grateful :)
#36
05/30/2014 (4:37 pm)
@John : My pleasure! Hope it helps others as well!

Next issue though, you'll have to post a new blog entry as we have hijacked Eero's thread long enough hehehe.
Page«First 1 2 Next»