Archive for the ‘coding’ Category

Serializing the game data

Saturday, July 24th, 2004

So I’m working on the level designer for my game, Runner (in stores near you in 2006 or so). Up until tonight, I’ve been envisioning the game data (the levels and scripts) being stored in an XML format on disk, so that someone could come along, grok my nice open format, come up with a better editor for the data than I could, and thereby enhance my game.

However, serializing into XML has no middle ground: it is either blissfully easy or incredibly, painfully, hard. Despite the help from such wonderful tools as Chris Sells’ XmlSerializer Pre-Compiler, which I first heard about from Christoph and his article about the XmlSerializer, and some exception digging and Googling, it seemed like it was no dice for my game data being easily saved into XML.

“Wait a minute,” I thought to myself. “I don’t want to futz around figuring out how to save the stuff, I want to get on with making cool game stuff!” So I relied on the good ol’ System.Runtime.Serialization.Formatters.Binary.BinaryFormatter which saved my data, with only two hitches, directly into a binary format. What were the two hitches? Seems that the BinaryFormatter has problems with System.Drawing.Pen (fine, no problem), and, more worryingly, it can’t deserialize a non-public delegate into an event. Makes sense (it is private, after all)... but it still kinda sucks. Lucky for me, I only had to change one delegate/event pair to workaround this. And what have I lost? Nothing, so far, as long as I abstract away from the BinaryFormatter stuff so that all anyone knows about is Save() and Load(). I think I’m set.

Very cool.

Resharper hits 1.0!

Thursday, July 22nd, 2004

Visual Studio is finally progressing beyond the Stone Age of source code editing, thanks to JetBrains, the makers of IntelliJ: Resharper has hit 1.0, and it’s only $99 per user.

I’m not a Java developer. I can program in Java, but there’s a distinction between being a programmer and being a developer. It doesn’t take a Java guru, however, to appreciate a beautiful goddamn piece of editing software: IntelliJ just plain makes me drool with geek lust. Live templates, smart replacement, refactoring built in… it’s got everything you need to increase your productivity by an order of magnitude while developing in Java.

Meanwhile, I’m stuck with Visual Studio .NET 2003… it doesn’t have refactoring, variable renaming, live templates, or any of that. Sure, it has IntelliSense (and thank God for that), but that’s a long way from what it could be. Enter the greatness that is JetBrains, the maker of IntelliJ. Taking pity on us poor C# fools, they’ve created an add-in for Visual Studio called Resharper, which lets us harness some of the power of a modern source editing tool. If you haven’t seen it before, go download it right this instant. You will discover what it means to have a pleasurable programming experience.

Not only that, but they have this great idea: the early access program. Ryan posted an article about what he calls an “open development process”, where the users may download betas of the program, test it out, offer feedback, and there is a direct line of communication between the developers and the people who intend to use the software. Not only do the customers get what they want out of the product, but, when it comes time to release, you have a loyal customer base ready to sing your praises. I couldn’t agree more; I, too, wanted to do this while we were at OpenStorm. Oh, well…

I can’t remember the last time I’ve used so many links in one post. Whee!

Nice article on SignedXML

Thursday, July 22nd, 2004

I found a nice article on SignedXML. Seems like the people at SevenObjects are making a quick buck of a licensing scheme that this guy just exposed.

Of course, I’m the guy who paid the $11 for the licensing component. At least I didn’t have to write it myself. ( =