I’ve always had an interest in making video games. I remember making a puzzle-based game with Microsoft Power Point way back in the day that occupied a full box of floppy discs. While the current state of the video game industry seems contrived to prevent new players from entering the scene, I’ve often toyed with the idea of trying to get involved by way of participation in a smaller project.
I’ve worked on numerous ‘bastard’ games over the years, so called because they’ve often been written in VB or Java, and usually had horrible physics or jerk rules that made them impossible to play. These have always been fun, but I recently decided that I’d like to do something a little more serious, and started looking into the MS XNA framework for Windows and XBOX 360.
I grabbed a text book on the subject, and started at it, intending to create an old-school top-down RPG similar to early Zelda titles or Pokemon a la GameBoy. So there I was trying to write a game in an unfamiliar language (having never used C# before), and with a new mindset on how games should be created. The majority of basic classes were ported over from an old VB project that I had lying around, allowing me to get a sprite and tiling system up in short order.
In order to properly test the tiling system, I decided to leave the engine for a short period and build a map editor app back in trusty old VB. I set it up so that the editor saves two files – a PNG pallete of all tiles used in the map, and an XML file that describes which image from the pallete to put on each square of the map grid. For those interested, the source code can be had here.
So now that basic maps can be created and saved, the task of loading maps into the engine is at hand. And this is where I got seriously mucked up. XNA introduced me to the idea of a Content Pipeline – essentially, my engine cannot load files from arbitrary directories on the system drive at run time. All necessary files must be dropped into the project at design time, to be compiled into a binary file that the engine will read from at run time.
Ok so not a big deal for image files – just drop them into the content folder, load them into a Texture2D object, and draw them to the screen. But how on earth do you do likewise for an XML file? In order for my engine to use the fancy map editor that I spent hours working on (and am pretty proud of), it has to process an XML file for the level, load the necessary pallete of tiles, and construct the background grid based on that information.
Sure, hardcoding the levels -would- work, but that’s ugly and stupid and horrible. I like my XML levels, and want to process them (with the content pipeline if I must) with ease. The missing link is figuring out how to open an XML file for reading that is hanging out in the content pipeline.
Anyway, that’s about as far as I’ve gotten, but I’ll keep updates coming as I get farther into my adventures with writing an RPG.
Cheers,
Jon
Trackbacks /
Pingbacks