9. Making a Player-Customizable GameOver the past few days I designed a WAD file-like scheme to manage the assets in the game. The motivation to go this route comes from not wanting to load all the animation states for the heroine into Stencyl manually.
Figure 1: 8 animation frames for one state (walking) in one of 8 directions
I use MakeHuman to render the figures, then draw clothes on by hand. It's kinda tedious, but doable. The big news on this front is that MakeHuman 1.1 was released, and I might be able to use Blender to render some better motions. I might even be able to make 3D clothes. I'm not sure which would be more time consuming--learning a new skill, or doing it the (long) way I know how.
In any case, I'll have a lot of images. I recently discovered
Fast for xml parsing in Haxe, which the Stencyl engine itself uses. Now that I can parse xml, I can make config files. Here's an example.
<asset type="structure" template= "Generic Pillar" name="brick1-pillar">
<number behavior="Wall" attribute="XOffset">64</number>
<number behavior="Wall" attribute="YOffset">128</number>
<number behavior="Wall" attribute="XOrigin">32</number>
<number behavior="Wall" attribute="YOrigin">32</number>
<number behavior="Wall" attribute="DrawStackOffset">0</number>
<number behavior="Wall" attribute="MaxZBound">32</number>
<text behavior="Wall" attribute="ImageFile">brick1/pillar-diffuse.png</text>
<text behavior="Wall Lighting" attribute="LeftAmbientFile">brick1/pillar-ambient-left.png</text>
<text behavior="Wall Lighting" attribute="RightAmbientFile">brick1/pillar-ambient-right.png</text>
<text behavior="Wall Lighting" attribute="LeftShadowFile">dark/xz-full.png</text>
<text behavior="Wall Lighting" attribute="RightShadowFile">dark/yz-full.png</text>
</asset>
It's probably not clear what this does, but it's pretty simple. When the file is read, it changes the contents of the attributes in an actor's behaviors. These are the same parameters that define the brick pillars in the earlier screenshots. I can now set up template actors, then load their "real" values in-game. The structure I set up allows for assets and 'libraries', which are collections of assets and can function like PWADs in Doom. Each asset is given a name, and could potentially be overwritten by a player that wishes to load a patch. No access to the .stencyl project file is needed to customize the game from the user's end.
Working with the raw xml files is pretty easy, but theoretically, someone could write an editor if they wished to.
Anyway-- Fast is a great little tool, and appropriately named.