
I seem to be at one of those stages where I keep on meaning to write things in here but other things (like work!) have got in the way. What I did in most of my spare time last week was polishing the Crystal Towers 2 demo for Clickteam's disc next month - after releasing the first test of the demo to testers, I've made some slight changes such as ripping out and replacing the entire sound and online communication objects and changing the way that the whole save system works. Briefly, then - the sound change was from ModFusion to Onu, something that I'd tried before but abandoned when I found that Onu couldn't play music over separate frames. But it had been updated a lot since then, and with ModFusion's reputation for crashing a lot on computers that weren't mine, it was worth a try replacing it. That process went fairly quickly and gave me the chance to neaten up how music is loaded as well, with all the incidental music put on to separate tracks when the game is started up, rather than loaded on demand - now only the level music has to be loaded when one is entered. Curiously I found that like ModFusion, Onu can't change MOD orders correctly, but it just ignores the action and does nothing rather than crashing, which is a vast improvement as you can imagine. There was a brief panic when I realized that it wasn't looping music correctly, but it turned out that you just needed to turn MOD looping on specifically when you start playing one. The online object is now the Get object instead of the Live Receiver - it's a sign that I've been taking too long that the earlier object has gone through its entire birth and death during the course of the development of the game, and I'd previously used it to replace the Moosock object that I used in Special Agent. I hadn't noticed any instability with the Live Receiver, but the author said that the Get object was a lot less prone to crashes, and it brings the file size down an insignificant amount, as well. I've also succumbed to the will of Microsoft and changed the save system so that all of the game data that needs to be changed is now stored in the Application Data folder. It's ironic - for many years we tried to beat the idea into independent game makers that you should never touch the Windows directories and everything should be provided as a self-contained folder for ease of installation and deletion, but now we're all having to do the opposite and treat the user's Application Data folder as a sort of giant memory card. This has to be done because under certain circumstances, Vista and above won't let applications write to folders in Program Files, so players might be stuffed if they usually put games in there - this is the reason why you see some games putting a "My Games" folder into your My Documents, too.
Because I was just about feeling my way as I went, there were a number of problems with the way I did all this at first - one of the biggest was that accounts were identified by name. I did this deliberately at first because I didn't want two players to have the same name, but it made things more inconvenient than anything else, needing a whole extra process to check for existing names and then informing the player that someone was already called that, then providing a chance to change it. The other was the separation between creating and updating an account - if somehow something went wrong (like me fiddling with the database, which I frequently did during testing) then trying to update a player record that didn't exist would produce a cryptic error. Once you'd taken a name, you were stuck with it, too - you couldn't delete your save and start again with the same name, because that name would already be taken.
What also happens now, when an account is updated, is that the differences between that account and the last time it was updated are also recorded in a separate "events" table - a new row is added for every update. Having a record of the differences recorded recently in these little 64-byte rows means that the site can parse those lists of numbers into something resembling English (which is more difficult than you'd might think) and display a news feed of what players have been doing recently in the game. It really is quite fantastic staying on the page and watching updates go past when people are playing it. I think all the best online features are written because of people's love for spying on others. 2009-11-20 21:03:00 9 comments |