Inkscape as a Level Editor

Ubisoft recently released Rayman Legends and I was quite impressed by the UBIart Framework demos:

They developed a free form level editor, with what looks like procedural texture generation to fit graphics to collision data. It looks very powerful, but for now it is only available for Ubisoft projects. I am sure we will see some open source clones at some point, and there are already some interesting developments for Unity3D.

Many of the level editors accessible to independent developers so far focus on grid and tile based level layouts, but I wanted to investigate what editors are available for a more free form level layout.

To start I had a look at Inkscape, which is an open source vector graphics editor available on many platforms, that reads and writes SVG files. SVG is a standard format, so you can import and export it from many applications, and you can even preview it in many web browsers. You can add custom data that can be picked up by a game engine to control collisions or gameplay elements. To test this out I took a test level from Pingus and imported it into Inkscape, similar to the way that is described in this blog post.

Pingus in Inkscape

Pingus in Inkscape

Pingus has a built in level editor and uses a simple text based level format based on LISP. It’s easy to read with a simple Python script and to write out as a SVG scene graph.

Inkscape performance on OSX is not very good, which I assume is a combination of the SVG rendering code in combination with using GTK+ through X11. Though the performance isn’t very good on Windows either. I am sure one of the key reasons for that is the complexity (and power) of SVG rendering, which makes it important to post process a SVG scene into more hardware-friendly data. You will have to decide which subset of features can be used to build levels or you may have to spend a lot of time implementing SVG features.

Inkscape doesn’t seem to have a built in mechanism to organise clip art or object libraries. A workaround for that is to put templates for your game objects onto a different layer outside the level and to clone them onto your level.