Tuesday 29 April 2008

BETA 4 News

Okay, BETA 4 is taking a little longer than I want it to but not for any particular technical reason, I'm just doing other things and chasing stuff that's not "visible" to users (e.g. I've been working on game saving for ages but none of the BETA's have yet had any code related to that in them). Mostly refactoring stuff so that the code is more readable and a bit more structured, debugging is simplified, and the menu drawing code isn't *quite* so horrible as it currently is.

When it *does* arrive, it'll have:

- Centered puzzles on the screen (finally - sorry it took so long)
- "Save Default Config" - pressing X on the pause screen saves that configuration (provided it is a valid one) into a human-reabable INI file, which is loaded each time the game is first run. Removing the INI file reverts to the game defaults. On unwritable systems (e.g. write-protected card or one where you don't want to save the config), the game just uses the current defaults but still lets you change them (obviously you can't save them in that case!)
- "Save Game" - You can save the current state of a game (not just the config) and resume it later. At the moment, it's more of a "quicksave" in that there's only one save slot that you can save/load. Handy, though, if the battery light starts to flicker, you can just hit the save option and resume it once you've changed the batteries.
- Tweaked the font sizes etc. a bit
- Mouse acceleration (primitive but it works)
- A couple of memory leaks plugged, a couple of minor bugs fixed, a bit of memory saved.
- Fixed a stupid bug where pressing Solve while you were paused buggered up the screen a bit.

There is one INI file per game, that gets created when you press Save if it doesn't already exist. If you don't press Save nothing is ever written to your SD card. As soon as the INI file is written, the cache is flushed so that the data hits the disk ASAP. Once you get a message to say it saved successfully, it should already be on the disk.

Everything will be saved into these INI files - Saved games (yes, you can save a game into an INI file), Settings, "Presets" (saved blocks of settings), help text, the lot.

The savefile format is plaintext (which gets "INI-ised" when it gets saved), so it's even "editable" from outside the game. Basically it consists of a complicated string to describe the starting point, options, size, game, etc. and then a list of moves that have already been made. The game "replays" the moves when it loads and you end up where you left it. I think I may have to disable access to mines, though, because it's still doing weird stuff and I don't want people to press Save while the game is in a weird state - the game may throw a wobbler when you try to write out a weird save state. Savegames are tiny - you can happily save dozens in each game without adding to the size of the folder noticeably.

Loading in a weird game state isn't a problem - the INI parser library just ignores any rubbish in the file and passes on what it can. The games then each check that the savegame / options are completely valid before they try to play them. This is to try to stop people loading corrupt save games, or those that have been "played with".

I'm trying to avoid playing with the menus at the moment because that code is getting a well-deserved shake-up but once it's done, I hope to introduce more save slots and a way to change between them, and a way to save configuration presets. That may or may not be in BETA 4 depending on how quickly the work progresses and how well I can squeeze them into the menus.

No comments: