Been a busy few days, but I can report all the title and game menus from the standalone game are now re-coded as LUA scripts. That’s the title, options, load game, loading, in-game menu, graphics menu, sounds menu, save game, win, lose and next level. All chains together as before, and tested with a single and multi-level standalone game. The only missing bit now is the save functionality and the subsequent reload step, which will take a little more thinking.
Initially I was tempted to do a LUA dump, but since found this was my imagination and completely not possible without a heck of a hack, so plan be was do it like before and create a custom file with everything the game needs to restore its progress, and then I had the benefit of writing save and load routines for the graphics and sound settings (which need to retain things like which graphic quality setting, music volume and sound volume).
In writing this, I discovered the wonderful world of LUA file commands. The current system actually saves its in-game settings in two files, and manages those files when the settings are changed, and uses them when a new game session is launched. It got me thinking the same commands could be used for the entire GameGuru game progress storage system. Naturally there is a LOT that is currently hidden from my current LUA system, and from bitter experience resurrecting a game ‘mid-play’ can be treacherous but I have a sneaky suspicion that using the LUA commands as an abstraction layer could produce some very clean code (and more commands for scripters).
Back in the day you just needed to store the players level, position, health and weapon, and you were done. This time, I need to consider things like enemy positions, dynamic entity locations, AI states, LUA globals and a large pot of additional player statistics you probably didn’t even know existed. I also need a few thoughts on whether I should save the exact body position of ragdolls, mid-animation frame values and transitionary elements. I know some AAA games don’t, and some even force you back to checkpoint style locations, but I don’t want to rule anything out at this stage. I was going to add a system which allowed the user to select a slot and give the save position a name, but I am now leaning towards taking a screenshot, and creating an autogenerated name such as ‘Game Save XXX : level ZZZ : Time YYY’ where ZZZ is the name given to the level when it was created and YYY is the internal game time. This way there are no prolonged typing mid-game and the feature can be coded quicker. I am thinking the screenshot (much like games like Thief and Assassins Creed) will reveal more about the game progress than any text might. This is the last bit of design work before I get stuck into mining the engine for all the game statistics worth storing.
As my evening is pretty packed, it’s now time to walk the dog, get something to eat, pack and set off for one of the last few meetings of the month which takes place Wednesday. I have moved my Twitch broadcast to Thursday 4PM GMT if you want to tune in and discover new depths about GameGuru.