Archive for August, 2008

Troubles with XNA

August 26th, 2008

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

iTunes to Zune Playlist Converter

August 20th, 2008

This handy application converts iTunes playlists to Zune jukebox playlists. I wrote it out of frustration with the Zune jukebox auto-playlist feature, and it has served me well so far. The project is still in development, so if you have any suggestions on how to improve it, please leave a comment.

Download the Program

The program is pretty simple to use. Just follow these handy steps:

  1. Download the zip file and unzip it to a directory of your choice
  2. Open iTunes and close the Zune jukebox software
  3. Right click on the playlist that you wish to export and select ‘Export Song List…’ from the context menu
  4. Choose where you’d like to save the playlist, and ensure that ‘Save as Type’ is set to *.xml
  5. Launch the ‘iTunes to Zune Playlist Converter.exe’ application from the unzip directory
  6. Use the browse button to load the saved *.xml file into the ‘iTunes Playlist File (XML)’ field
  7. Use the browse button to choose where you’d like to save the converted Zune Playlist file. Note that for the Zune player to recognize the new playlist, it must be saved to C:\Documents and Settings\User\My Documents\My Music\Zune\Playlists\ on Windows XP, or C:\Users\UserName\Music\Zune\Playlists on Windows Vista.
  8. Click the ‘Convert’ button, and wait for the success message box to pop up.
  9. Launch the Zune jukebox software and go into the ‘Playlists’ view. You should see your newly created playlist in the pane to the left. Note that it might take a second to recognize the playlist, and another minute or two after that until the list is playable, depending on the size of the list. This is because the Zune software has to sift through the playlist and link each referenced file to one in its current library before the list can be used.

It is important to remember that this only works if the iTunes library and the Zune library in question are drawing from the same media files. This means that you should have the Zune jukebox software set to monitor the iTunes music folder that you are drawing from, so that the same files are referenced in both programs’ libraries.

Cheers,

Jon

Originally posted at jakebillo.com