Skip to main content

Saving game data

So I recently ventured into the world of saving progress on the DS. And, like sound, it opened up a whole can of worms. (To be fair, I knew this can of worms was coming, but I kept putting it off).

So, the background, for all you people that don't do DS development:

In the olden days, cartridge-based games used battery-backed ram to save data. Which was still the case in certain GBA games. But in some GBA games, and as far as I know, all commercial DS games, save data is stored using EEPROM. The homebrew DS cards, though, from everything I've read, don't properly support EEPROM (at least accessing it via homebrew methods), but instead, we have a file system to work with, for reading and writing data. But it's not quite as simple as that.

All the homebrew cards are slightly different, but most of them adapt between a micro SD card and the DS. BUT the underlying way to read/write the filesystem on the SD card differs between the different homebrew cards. Enter some smart guy called Chishm and his awesome libfat/DLDI. This guy wrote a file access library (libfat) and a fancy system of patching compiled games with drivers for the different cards. So you write your game using libfat, and if somebody wants to play it on card XYZ, they run the patcher with the XYZ driver.

There's all sorts of other crazy and cool ways of dealing with it all, like people have written other utilities that stuff a whole file system into data appended in your executable file, so the whole DS game and save data and whatnot can be shoved into one file.

OK, enough of the 10-second crash course on libfat and DLDI. So I read up on this stuff, got libfat set up, and it all seems to be working. I toyed with using EFS, which does an appended file system like I mentioned above, but eventually decided against it, as I want it to be easy for people to update the main game file (like when I release bug fixes) without losing their save data. The other annoyance is that using basic libfat stuff, it crashes my emulator. It works fine on the actual hardware, so it's not a huge deal, and the emulators always have the ability to save state, so they don't really need a save file, but I need to go in and make sure it at least doesn't crash.

Other than that, and a couple minor bugs (I'm not rebuilding the initial level screen correctly after loading a saved game), saving and loading is working (at least on the M3 that I'm testing on...Electrobee also gave me an Edge card, so I need to make sure the saving/loading works correctly on it as well).

Once I get this done, the only things left are small cosmetic changes: getting the end-of-game splash screens and credits looking all nice, making sure all the transitions between splash screens, game over screens, menus, etc are all good, finding better intro music, fixing the flavor text on enemy portraits, and testing testing testing. Oh, and I've noticed I have a bunch of warnings in my code about improper pointer conversions. I need to go through and fix all those...I'm one of those people that doesn't want to see a single warning in my code when I compile....

Comments

Popular posts from this blog

Retrospex 32 Review

RetrospexInternational recently sent me a couple units of their new handheld device, the Retrospex 32, a new dedicated GameboyAdvance emulator handheld.  To make the unit playable out of the box, they pre-loaded a handful of homebrew games, including Anguna, which is why they were kind enough to send me 2 of the units to play with.  I was pretty excited to get my hands on the device and try it (I loved my old GBA micro with a good flash cart!), and see Anguna running on it. So here's my thoughts after playing with it.



Their website lists the Retrospex 32 for £59.99, which is around $100 USD. It seems like it's marketed toward people into retro-gaming (which makes sense for a dedicated GBA emulator device). At that price, with that target market, and such a limited set of functionality (why not make it a multi-machine emulator, and emulate all the old consoles?), it would hopefully do a really good job of it.

The short version of my review: it doesn't. It has one job (emula…

Making the game fun

The real trick for Spacey McRacey (as I'm calling it now) is going to be making it fun.  And that's what I'm rather unsure about at this point.

I have a game design that basically works. The technical issues are mostly sorted out, I just need to get a few more implemented before I can seriously play test it.

But fun? It's hard to know if it's actually going to be any fun to play.  With a 4-player party-style game, it's seems like it might be hard to hit that fine line where everyone is close and competing, where everything feels exciting and tense, as opposed to tedious and boring.  And despite envisioning my game as fun, it might just be boring to play.

Some of that comes down to tweaking it. Tweaking the speeds, difficulties, etc, will make a difference. (If it's too easy to shoot people from behind, then it will be nearly impossible to hold a lead for very long, which could ruin it and make it no fun. If it's too hard to kill the guy in front, it wil…

Killer Queen

So at PRGE, I played an arcade game that just left me amazed.  Killer Queen.

It's a 10-player game. You have 2 cabinets linked together, and 5 players huddled on each one. Each one is a team of 5 people, working together to play a simple one-screen 2d platformer.  But what made it work was the high quality game design.

First, the game is relatively simple, yet there is a lot going on at once.  One player plays the queen, the most important and powerful character on the team. The others start as workers, but can become warriors who can fly around and attack in a very joust-like flappy contest of height.  The real trick is that there are three completely different ways to win: either collect a bunch of berries and bring them back to your base, or ride a REALLY SLOW snail across the screen (while other people try to kill you, and you hope your team protects you), or kill the enemy queen 3 times.  There's some other things going on as well (using berries to upgrade, capturing upgr…