Sunday, September 9, 2012

Rottengine

Disclaimer! I am not a properly trained programmer. All of the skills I've learned have been self-taught or picked up from being around 'programming gurus.' Aaron Hoffman, Kevin Harris, and Aaron Bahr are three of whom I've had the pleasure of gaining massive insights on programming in general. My jargon may be completely wrong, so you can laugh accordingly at my misuse of it.

So, you've likely heard me tweeting about this wonderful new tool that I've been developing for an older project that I had started last summer, Polar Expedition (working title).

Rottengine, as I'm now calling it, aims to make a simple library to extend the functionality of the Microsoft XNA framework.

Last weekend, I coded a rough Editor that allows me to add any number of 'Asset' types to an editor window and manipulate their properties. So things like Sprites, Textures, Conversations, Items, and Maps can be loaded and changed from a single window.

What's neat about this is that if I need to add more 'Asset' types, the amount of effort to do so is very minimal. Game development software like Game Maker and Unity really lack the ability to do this easily. In Game Maker, some sort of text parsing or object trickery would need to be employed, and in Unity, the serialization of generic objects becomes obscenely cumbersome from my experience (if someone is particularly clever in that regard, I'd like to meet you).

So what in XNA makes this easier? It's their Content Pipeline. This nifty thing can de/serialize developer created objects just the same as content like Textures and Models, provided the XML matches up with the object properly.

Couple that with the ability to create custom Windows Forms, and you have a really baddass method of making an Editor.

Do you remember the Visit3 World Editor? Good, you shouldn't; that piece of junk was a hard-coded, coupled mess. Visit3 had to be run with the editor attached to it, and caused a MAJOR problem when it was supposed to be ported to the console (which was the major hurdle in our old attempt to continuing my work on Visit3).

But with my discovery of using separate projects in a solution, I was able to safely add on both editor and library projects to 'Polar Expedition,' which could be built with or without the game. All that needs to be done is connecting the projects via a 'project reference.'


Polar Expedition's current Solution, using 2 XNA Windows Game projects, 2 Content projects, and 1 XNA Windows Library project (Rottengine).


The 'Resource Editor' in action. Creating a new 'TabPage' is the trick to editing an object; in this example, I expose things like sprite width, height, and frames so that the object settings can be serialized and then deserialized when 'Polar Expedition' needs to load the information during run-time.

This is all really conceptual stuff I'm going over, but I can elaborate on some of what I did if you'd like!

My hopes with this coding project is to both improve my 'library writing' skills as well as providing myself lots of reusable code to store away for future projects, making it faster and easier for me to start them.

No comments:

Post a Comment