• Runtimes
  • MOAI custom runtime

I'm implementing a custom runtime for MOAI SDK. Generic lua runtime performs all the math in lua, which is obviously a bit heavy, so I've decided to make a specialized MOAI version - it is also written in lua.
Another option could be integrating generic C runtime into Moai core as is, but it won't fit into Moai architecture nicely.

MOAI itself have pretty good feature set for animating things: there are already animation curves with different easing types (but no bezier, so I've just create 10 more keys with linear interpolation between them), action tree and dependency graph.

So, my runtime just creates a skeleton, where Bones are MOAITransform objects that are properly parented. Slots are MOAIProps (sprites), they are bound to corresponding bones. Texture info and rect is stored in Attachment which is just a lua table. Animation object is subclassed from MOAIAnim, all curves and keys gets created at load time.

Currently it is implemented as flower-extension (single file): https://github.com/Vavius/Hanappe/blob/ ... /spine.lua

It's a rough prototype, a lot of work to be done - skins, animation blending, some samples.
Performance increased dramatically. On my iPhone5 generic lua runtime can show 8 dragons at 60 fps and 12 dragons cause drops to 30-50 fps. Custom runtime renders 40 dragons at 60 fps.

Related Discussions
...

Sounds great! Interesting to see the Lua overhead for doing the bone and image vertex transforms. I'll add a link to the runtimes page. Thanks for sharing!

4 天 后

That's very interesting indeed !

I'd love to see more, especially Atlas support that should give another extra kick to the mix.

Kudos,

Nicolas.

New update is ready:

  • Atlas support. Multipage, rotation, whitespace stripping and texture filters are all impemented. Currently there is no support for WrapX/Y (I may add this if somebody needs it)

  • Skins support

  • Many small bug fixes and some API change

Roadmap:

  • Animation blending system. This one requires some Moai SDK core modification.

  • Animation management, maybe something like AnimState in official runtime. Or something more complex like behavior trees or blend trees from UDK. I'm not currently making a game with this runtime, so it's hard to say what approach would fit the best.

  • Physics (box2d) integration. This will come with bounding boxes in editor

15 天 后

Hi Vavius,

I've just gave a try to the latest update (merged back with Hanappe/Flower 2.1.2) and it's absolutely brilliant.
Flower does seem to have issues with Moai 1.4p0 build though but not related to your implementation.

Thanks a lot for sharing !

Best,
Nicolas.