Official Spine runtime extension - BETA testing

We have now added GUI support for the new official Spine runtime, and it’s time to invite our community to test the beta version of the extension.
Our goal is to have it released in Defold 1.2.193.

Breaking changes :warning:

After the version is released, we will have removed any Spine functionality from the core engine/editor, in favor of the new extension. This also means that we won’t support our older version of the spine extension.

This is also why it’s necessary for us to know of any missing features/misbehavior of the extension as soon as possible, with the help from our community.

Requirements

  • You currently need to run the alpha version of the Defold editor.
    You can find the latest version of the alpha channel here.

  • You also need to use the correct branch from the extension, as your dependency.

Migration guide

The required steps for updating your content to support this extension is listed here

Example project

The example project shows the animated spine boy, using multiple animations on different tracks.
Press left mouse button (or touch) to shoot. Move the mouse cursor to aim using IK target.

For the api documentation, see the .script_api file.

Regards,
/The Defold Team

18 Likes

Excited to see the official spine runtime. Will there be support for vertex animation with meshes, or will you still require a bone to be attached?

I’m in the middle of trying this, so a few notes:

I changed the json file extensions outside of the editor, loaded the project in the new alpha editor, updated the extension, fetched libraries, and then saw this (expected) output


Working through the spine scenes one by one, updating the reference, saving and closing the tab mostly worked but sometimes this error would show in a popup:

clojure.lang.ExceptionInfo: handler ‘:hide-selected’ in context ‘:workbench’ failed at ‘:enabled?’ with message ‘null’
java.lang.reflect.InvocationTargetException: Unknown
java.lang.Error: Invalid memory access
Dismissing that dialog, closing the unsaved spinescene tab (showing an asterisk) and double clicking the spinescene in the console again, I saw this:
image

Then, after adding required spine scenes to the GUI objects, it was possible to run, which led to this error when calling gui.get_node(“ticket_1_pet_spine”):
ERROR:SCRIPT: /main/ui/world_gui/world.gui_script:51: No such node: ticket_1_pet_spine/Head
stack traceback:
[C]: -1: in function get_node
/main/ui/world_gui/world.gui_script:51: in function initialise_quest_sidebar_nodes
/main/ui/world_gui/world.gui_script:671: in function </main/ui/world_gui/world.gui_script:579>

ERROR:GAMESYS: Error when initializing gui component: -2.
ERROR:SPINEEXT: No animation '' found
ERROR:GAMESYS: Couldn't find gui node type: 0

and then a crash (dump attached):

Callstack

ERROR:CRASH: CALL STACK:
ERROR:CRASH: 0 0x7FF72CD39F70 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:142
ERROR:CRASH: 1 0x7FF72D0A5064 raise /tmp/job6821776269374264736/minkernel/crts/ucrt/src/appcrt/misc/signal.cpp:547
ERROR:CRASH: 2 0x7FF72D095DC4 abort /tmp/job6821776269374264736/minkernel/crts/ucrt/src/appcrt/startup/abort.cpp:71
ERROR:CRASH: 3 0x7FF72D094CD8 common_assert_to_stderr<wchar_t> /tmp/job6821776269374264736/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:186
ERROR:CRASH: 4 0x7FF72D0947FC _wassert /tmp/job6821776269374264736/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:443
ERROR:CRASH: 5 0x7FF72CD1AA60 dmGameSystem::RenderCustomNodes D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_gui.cpp:1105
ERROR:CRASH: 6 0x7FF72CD1DBA0 dmGameSystem::RenderNodes D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_gui.cpp:1814
ERROR:CRASH: 7 0x7FF72CD921D0 dmGui::RenderScene D:\a\defold\defold\engine\gui\src\gui.cpp:1459
ERROR:CRASH: 8 0x7FF72CD1E970 dmGameSystem::CompGuiRender D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_gui.cpp:2124
ERROR:CRASH: 9 0x7FF72CD795E0 dmGameObject::Render D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:2527
ERROR:CRASH: 10 0x7FF72CE4F9E0 dmGameSystem::CompCollectionProxyRender D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_collection_proxy.cpp:318
ERROR:CRASH: 11 0x7FF72CD795E0 dmGameObject::Render D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:2527
ERROR:CRASH: 12 0x7FF72CDE3C90 dmEngine::Step D:\a\defold\defold\engine\engine\src\engine.cpp:1637
ERROR:CRASH: 13 0x7FF72CDE0A70 dmEngineUpdate D:\a\defold\defold\engine\engine\src\engine.cpp:2077
ERROR:CRASH: 14 0x7FF72CDE6400 dmEngine::RunLoop D:\a\defold\defold\engine\engine\src\engine_loop.cpp:69
ERROR:CRASH: 15 0x7FF72CD20720 engine_main D:\a\defold\defold\engine\engine\src\engine_main.cpp:146
ERROR:CRASH: 16 0x7FF72D053F64 __scrt_common_main_seh d:\agent_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
ERROR:CRASH: 17 0x7FFDF1F47020 BaseThreadInitThunk :0
ERROR:CRASH: 18 0x7FFDF2922630 RtlUserThreadStart :0

The migration guide has a note - is it relevant? I’m not sure what it’s asking me to do.

Currently the play anim requires a callback (i.e. the default handler is currently disabled)

_crash.zip (1.6 KB)

2 Likes

Forgot to mention that some of the files wouldn’t load and needed to be re-exported from Spine, targeting a later version. The migration guide does mention “Update the spine source files to latest version” but I thought that was optional (e.g. if you needed the new features) - I hadn’t realised that the runtime wasn’t actually backwards compatible.

3 Likes

If it’s part of the C++ Spine runtime, I expect it to “just work”.
As far as I know, there is no different from the user perspective to playing vertex and bone animations?

2 Likes

Sounds great! We will be doing some testing on our game soon. There is no difference in perspective from them at all (bone vs vertex) but we outsource some art and animation, it seems artist are tend to lean more into the vertex side for things such as narrative characters. It would save us iteration if we could just use their vertex animations.

2 Likes

Is the error due to this functionality not yet being implemented? (at the bottom of https://github.com/defold/extension-spine/blob/spine-runtime/README.md)

MVP2

GUI

  • Create bone nodes
  • Script: Get bone node
1 Like

IF that node is a spine bone, then yes, that is why.
I’ll work on that today or tomorrow.

3 Likes

We’ve updated the Spine extension (the ´spine-runtime` branch) with a bunch of stability fixes, and we’ve also added Gui nodes for the spine skeleton.

7 Likes

With the latest editor alpha (5645efa) and spine-runtime branch (30cbae8), GUI nodes now appear to be working, except for one screen which renders a grid of spine objects. The gui has a template, which includes a spine node, and the template is cloned with gui.clone_tree() as many times as necessary. The first call to that crashes with the attached callstack.

_crash.zip (2.0 KB)

Summary

INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\Richard\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:
ERROR:CRASH: 0 0x7FF671E6A9A0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:142
ERROR:CRASH: 1 0x7FF67220541C _seh_filter_exe /tmp/job9792754189708964382/minkernel/crts/ucrt/src/appcrt/misc/exception_filter.cpp:219
ERROR:CRASH: 2 0x7FF672256D5C __scrt_common_main_seh'::1’::filt$0 d:\agent_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:304
ERROR:CRASH: 3 0x7FF6721C9510 __C_specific_handler d:\agent_work\4\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp:290
ERROR:CRASH: 4 0x7FF86FC31FB0 __chkstk :0
ERROR:CRASH: 5 0x7FF86FBE1020 RtlRaiseException :0
ERROR:CRASH: 6 0x7FF86FC30BD0 KiUserExceptionDispatcher :0
ERROR:CRASH: 7 0x7FF6722310A8 strnlen /tmp/job9792754189708964382/minkernel/crts/ucrt/src/appcrt/string/strnlen.cpp:201
ERROR:CRASH:

INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\Richard\AppData\Roaming\Defold/_crash

ERROR:CRASH: CALL STACK:
ERROR:CRASH: 0 0x7FF6722310A8 strnlen /tmp/job9792754189708964382/minkernel/crts/ucrt/src/appcrt/string/strnlen.cpp:201
ERROR:CRASH: 1 0x7FF6721E237C __crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter > >::type_case_s /tmp/job9792754189708964382/minkernel/crts/ucrt/inc/corecrt_internal_stdio_output.h:2282
ERROR:CRASH: 2 0x7FF6721E1FDC __crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter > >::state_case_type /tmp/job9792754189708964382/minkernel/crts/ucrt/inc/corecrt_internal_stdio_output.h:2023
ERROR:CRASH: 3 0x7FF6721E197C __crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter > >::process /tmp/job9792754189708964382/minkernel/crts/ucrt/inc/corecrt_internal_stdio_output.h:1668
ERROR:CRASH: 4 0x7FF6721D9528 common_vsprintf<__crt_stdio_output::format_validation_base,char> /tmp/job9792754189708964382/minkernel/crts/ucrt/src/appcrt/stdio/output.cpp:167
ERROR:CRASH: 5 0x7FF6721CC79C __stdio_common_vsnprintf_s /tmp/job9792754189708964382/minkernel/crts/ucrt/src/appcrt/stdio/output.cpp:391
ERROR:CRASH: 6 0x7FF671E97950 dmSnPrintf D:\a\defold\defold\engine\dlib\src\dlib\dstrings.cpp:31
ERROR:CRASH: 7 0x7FF671D17E40 dmSpine::CreateBones /tmp/job9792754189708964382/upload/defold-spine/src/gui_node_spine.cpp:462
ERROR:CRASH: 8 0x7FF671D17230 dmSpine::SetupNode /tmp/job9792754189708964382/upload/defold-spine/src/gui_node_spine.cpp:574
ERROR:CRASH: 9 0x7FF671D18270 dmSpine::GuiClone /tmp/job9792754189708964382/upload/defold-spine/src/gui_node_spine.cpp:592
ERROR:CRASH: 10 0x7FF671E47A10 dmGameSystem::CloneCustomNodeCallback D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_gui.cpp:1987
ERROR:CRASH: 11 0x7FF671EC7EB0 dmGui::CloneNode D:\a\defold\defold\engine\gui\src\gui.cpp:4005
ERROR:CRASH: 12 0x7FF671F09440 dmGui::CloneNodeToTable D:\a\defold\defold\engine\gui\src\gui_script.cpp:3181
ERROR:CRASH: 13 0x7FF671F09340 dmGui::CloneNodeListToTable D:\a\defold\defold\engine\gui\src\gui_script.cpp:3199
ERROR:CRASH: 14 0x7FF671F09440 dmGui::CloneNodeToTable D:\a\defold\defold\engine\gui\src\gui_script.cpp:3188
ERROR:CRASH: 15 0x7FF671F05620 dmGui::LuaCloneTree D:\a\defold\defold\engine\gui\src\gui_script.cpp:3238
ERROR:CRASH: 16 0x7FF671DE074E lj_BC_FUNCC :0
ERROR:CRASH: 17 0x7FF671E61E40 lua_pcall :0
ERROR:CRASH: 18 0x7FF671E81DD0 dmScript::PCallInternal D:\a\defold\defold\engine\script\src\script.cpp:1366
ERROR:CRASH: 19 0x7FF671ED0250 dmGui::RunScript D:\a\defold\defold\engine\gui\src\gui.cpp:1940
ERROR:CRASH: 20 0x7FF671EC4540 dmGui::UpdateScene D:\a\defold\defold\engine\gui\src\gui.cpp:2028
ERROR:CRASH: 21 0x7FF671E4F130 dmGameSystem::CompGuiUpdate D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_gui.cpp:2045
ERROR:CRASH: 22 0x7FF671EB5110 dmGameObject::Update D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:2481
ERROR:CRASH: 23 0x7FF671F8B830 dmGameSystem::CompCollectionProxyUpdate D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_collection_proxy.cpp:281
ERROR:CRASH: 24 0x7FF671EB5110 dmGameObject::Update D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:2481
ERROR:CRASH: 25 0x7FF671F8B830 dmGameSystem::CompCollectionProxyUpdate D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_collection_proxy.cpp:281
ERROR:CRASH: 26 0x7FF671EB5110 dmGameObject::Update D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:2481
ERROR:CRASH: 27 0x7FF671F146D0 dmEngine::Step D:\a\defold\defold\engine\engine\src\engine.cpp:1617
ERROR:CRASH: 28 0x7FF671F114B0 dmEngineUpdate D:\a\defold\defold\engine\engine\src\engine.cpp:2077
ERROR:CRASH: 29 0x7FF671F16E40 dmEngine::RunLoop D:\a\defold\defold\engine\engine\src\engine_loop.cpp:69
ERROR:CRASH: 30 0x7FF671E51150 engine_main D:\a\defold\defold\engine\engine\src\engine_main.cpp:146
ERROR:CRASH: 31 0x7FF6721C90C4 __scrt_common_main_seh d:\agent_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
ERROR:CRASH: 32 0x7FF86DCC7020 BaseThreadInitThunk :0
ERROR:CRASH: 33 0x7FF86FBE2630 RtlUserThreadStart :0

ERROR:CRASH:

INFO:CRASH: Successfully wrote MiniDump to file: C:\Users\Richard\AppData\Roaming\Defold/_crash.dmp

1 Like

There is also (I think) a regression since the previous alpha version. We reparent GOs containing sprites to different bones in the skeleton. The spine component has a Y offset specified in its position, and it looks like that position isn’t respected for the child sprites. If I remove the offset, the relative positions of everything are correct.

1 Like

I’ve updated the extension with a fix for the cloning issue.
I’ll look into the transform issue now.

EDIT: I cannot reproduce this issue, @AarrrBee . Please provide a small repro case for me to study if possible.

2 Likes

We exhaust some kind of buffer partway through cloning the instances - is there a new limit that we need to increase?

ERROR:GUI: Could not create the node since the buffer is full (1024).
ERROR:SCRIPT: main/ui/item_render/pet_gui.lua:7: Not enough resources to clone the node tree

I’ll try putting something together this afternoon.

1 Like

There’s not a new limit, it’s the same (Max Nodes in the .gui scene), but it seems something has changed in terms of when the nodes are created.

Note that deleted nodes also count towards the count since theire deletion is deferred.

Repro:
Based on the extension-spine sample, in each case there is a spinemodel with a non-zero position, and a sibling gameobject containing a sprite, which is reparented in script to the guntip bone in the spine model:
image

In Defold 1.2.189 with extension-spine, the sprite is attached to the gun tip
image

But in 1.2.193 and the new runtime, it is offset:
image

spine-offset-test.zip (592.5 KB)

spine-offset-test-new-runtime.zip (797.2 KB)

2 Likes

Perhaps related to the above, I modified the gui part of the spine sample to clone the animated character and add sprites to each bone.
It’s fine in 1.2.189 / extension-spine 1.1.0
image
but in 1.2.193 / spine-runtime branch the sprites don’t follow the animation. The code is the same in each, except for bone names:
image

Projects:
spine-offset-test.zip (601.3 KB)
spine-offset-test-new-runtime.zip (800.2 KB)

2 Likes

I’ve pushed a fix for the missing spine component transform when using bones.

6 Likes

I’m currently looking into a fix for this, which also I think is the cause for the issue you saw with the increased number of gui nodes.

6 Likes

I have fixes coming for the bones of a cloned gui spine node as well.
I’m just waiting for my PR’s to be approved (both engine and extension)

7 Likes

I made the spine data using Skin.
But the skin sprite didn’t show up in Defold.
What’s wrong with this?
Thanks for any help!



spinedata.zip (337.6 KB)

2 Likes