Hey Folks!
We're busy at work on our second game with Spine and love the framework.
One of the challenges we ran into with our first game was the runtime parse speed. That is, the cost of parsing and instantiating SkeletonData at runtime was cost prohibitive.
We made a few tweaks to the runtime and moved to instantiating the Skeleton data from prefabs - Mostly this just involved flagging a bunch of fields/classes as [Serializable]. This works reasonably well and got us a 3x speedup.
Our second title has fewer rigs but are significantly more complex and the prefab approach was starting to show some pretty significant slowdowns.
To solve this - we've moved to using protobufs to speed this up again and wanted to share the approach. We followed this awesome guide to getting setup. http://purdyjotut.blogspot.com/2013/10/using-protobuf-in-unity3d.html. Using this approach, we were able to see a roughly 10x improvement over JSON or Prefabs (which, for our second title, wound up being slower for some reason)
Our Spine data model is sufficiently divergent enough from the main supported line, so this isn't intended to be functional out of the box - but hope it maybe shines some light on how to implement this and hopefully maybe get it implemented in the base c# runtime.
Sample Skeleton - skel_iso_Male_character_150px.json. 40 Bones, 40 Slots, 21 animations (avg 30 frames, avg 120 timeline points)
Export Size
JSON - 838k
Prefab - 2.2MB
ProtoBuf - 475k
ProtoBuf.gz - 83k
Deserialization Speed
JSON - 293ms
Prefab - 337ms
Protobuf - 32ms
Cheers!
Jason McGuirk