Spriter API for C++

If I ever have a wish for making video games, it’s to do it faster and better. That’s why I spend a lot of time on tools. I don’t really like doing tool work, but it is important to developing an efficient workflow. This time, that tool is a C++ API for loading and using the Spriter character animation format, SCML.

Spriter is an animation creation application.  You drop images into the editor which will be put together to make your character.  Then you can set keyframes as you move the images around.  With this style of animation, the movement of the character is interpolated from these keyframes to give a smooth, continuous animation at any playback speed.  The animations are saved in a special XML format, named SCML.  Spriter had a very successful Kickstarter campaign this year, so it is in active development.  However, that is specifically for the editor itself and the data format.  The “plugins” that allow you to use the animations in various game engines and programming languages are community-driven.

My new project, SCMLpp, is one such plugin.  I was pretty surprised that after 6 months, there are plenty of plugins, but none for C++.  C++…  such a major language of modern game development.  Sure, there is one for SFML, but it’s of extremely limited use if you don’t use SFML.  Also, many of the plugins were created during the Kickstarter rush, and hence do not support the latest version of the SCML data format.  So, SCMLpp is my effort toward a generic C++ API that can be made to target any rendering API (SDL, Allegro, SFML, OpenGL of various sorts, etc.).

SCMLpp is actually ready to use!  I spent a few days on it this week to pull the whole SCML format into C++ objects and then draw some stuff with SDL_gpu as the renderer.  It looks great and I’m very pleased to have this form of animation available to my games.  Also, it never hurts to do something productive for the game dev community.  Anyone who uses C++ can write up the interface to a new renderer by referring to the SDL_gpu example.  The structure may change as I implement more features and make its interface more comprehensive, but the important stuff is there.

You can get the SCMLpp source code from Google Code: http://code.google.com/p/scml-pp/

Leave a Reply

Your email address will not be published. Required fields are marked *