Unity and MonoGame

There are plans to port my games to other platforms.  Windows is easy because my games already run on Windows.  XNA works great, you just have to remove the Xbox-specific stuff (related to the Guide and Gamer Services) and you’re good to go.  Unfortunately there’s no turnkey solution for the other platforms, so the porting process is going to be… more of a real port.

Today I investigated two options for this task.  First was MonoGame, basically a substitute for the XNA libraries that supposedly runs on Linux, OSX and iOS.  Sounds too good to be true, and unfortunately at this stage, it just doesn’t look ready.  To get a game to compile with it, I had to remove tons of code due to compatibility errors and missing API calls.  Even once I got through the compile errors and runtime errors, the game never managed to draw anything (though it could clear the screen to a specific color).  Plus the startup time for the application was about 5x compared to native XNA… so maybe there are workarounds, but so far it just doesn’t seem viable.

Unity is the other option.  Now a port from XNA to Unity is a major undertaking.  I got some serious protips from Brad who helped me through all those tiny things that trip up newcomers, and probably saved me a day’s worth of Googling.  The good news is I have a friend who knows Unity whom I can harass with my questions.  The bad news is that there will be some serious translation work to get my code from XNA to Unity.  I was hoping to put everything (my whole game) in one game object and let it draw itself, since I don’t need any of the high level features of Unity.  Just give me a surface to draw to.  Unfortunately it’s not so simple… exactly what this will take is something I’ll be discovering over the next few days.

Staging Code Tasks on Notepad

I’ve tried dozens of organization apps and software, and Notepad is still my favorite.  Its biggest drawback used to be accessibility–having to keep the text files with you if you work on more than one computer.  DropBox fixed that.

I tend to keep a text file of tasks so I know where to pick up tomorrow.  It’s vital that one of those tasks is immediately accessible and not too abstract.

  • OK: “Fix overlapping blocks collision bug.”  
  • Better: “Reproduce overlapping blocks bug by building a test room.”

Today was one of those coding days where every fix reveals yet another fix that’s needed.  My initial task list was about 15 items but I probably checked in over 40 changes today.  It’s frustrating to have done so much more work than I thought was needed, and still not be where I thought I would be today.  But, I’m still generally on track, and things had moved forward a lot.  It could be worse, I could have attempted a major refactoring and broken things so badly that I had no choice but to revert to the last update in source control.  It’s happened, but not today.  Today was just a steady unraveling of long-dormant bugs and tiny features that insisted on their existence at the last minute.

Notepad kept me sane.  Minor bugs kept cropping up, and I would just jot them into the text file.  As I fixed them, I would cut them out and paste them into the source control check-in log.  I’m down to about 3 right now, nothing major, and if I weren’t superstitious about this sort of thing I would say I’ve totally got it handled tomorrow.

 

Source Control Chaos Handled

Today I finally got my act together with version control.  This is something I had put off for way too long, and with my venture into PC ports, I think it was finally time to learn what branching and tagging are.

In a nutshell, branches and tags are like copies of the project that don’t take up extra space like they would in a normal file system.  They’re useful for storing release versions and for testing new features.  They’re like the save games of the world of coding–you want to create a new one before a boss fight.

For those of you who don’t use version control, get Subversion and learn the best practices.  Need a host?  Code Spaces has done me well.

With that handled, I got to put in a bit more time on porting Soulcaster II to PC.  I uninstalled Visual Studio and XNA Game Studio on one of my desktop computers so it could act as a testbed for end user machines.  Still have to work out some bugs but things are set up well for it now.