Development Progress Report, week 61

First update of the new year. Spending New Year’s Eve coding is fundamentally on-brand for me, so that’s what I did.

This ultimately resulted in the largest update to the game in quite a while.

I finally got around to integrating Lua. I built it from source as a shared library and did some basic integration with the Argus engine. Right at this instant, it’s only used for customising the size and position of UI widgets, but that’s not a bad start.

On-screen widgets resize and rescale depending on the screen/window size of the moment (the minimum supported size is 1024×700, which is only barely large enough to cram everything in). That means that UI elements can’t be properly customised by the Story unless it has the ability to alter their size and position in response to changing layout parameters.

I’ve got other ideas for the use of scripting, but for now, that’s enough. I’ve got it in and basically integrated and working, and unlike my experiments with chaiScript, it worked like a champ.

The FileBlob code got a bunch of updates as well. Obfuscated FileBlobs got an extra bit of obfuscation (just enough to prevent casual inspection and modification); all FileBlobs got an extra 8-bit flags field jammed into the sub-file headers, which fundamentally broke everyone’s pre-0.69.1 save-games, sorry.

Really, I should have had something like that in from day one, but face it, it is highly unlikely that you will come up with a file-format or an interchange format that you won’t end up needing to extend.

In my case, I needed to flag sub-files as either text or binary, since I’ve added a simple command-line archive tool for dealing with the blobs. Previously, the only way to really see what was going on inside them (eg: the data for a saved game) was to load one up in the engine, while running the engine in a debugger.

Now, I can extract the sub-files – but to do it simply, I needed to know whether they were originally binary or non-binary files.

Now that I’ve got a flags field, I can probably add subfile-compression at some future time, without breaking anything else.

The way FileBlobs are accessed has also been extended. Previously, we had the option of mmap()ing or reading in the whole blob and holding it in memory. Now there’s a third option: indexing a blob, and reading only portions of it as necessary. Since the mmap() method didn’t work on obfuscated FileBlobs, this adds an alternative memory-saving access method for them.

Well, eventually it will be memory-saving. Right now, the story-file isn’t actually large enough for the new access method to noticeably save any system memory. Eventually, though, it will make a difference.

A consequence of last week’s changes for on-demand loading of performances meant that a supporting system turned out to be counter-productive. It had been designed to speed up access of certain data, when all of that data was in-memory all of the time anyway, which is no longer the case.

Now that it isn’t the case, I remembered to cut that out, and that led to a straight-up sixty-percent saving in memory usage!

PSA: When you revise your strategy, review your support systems.

There have been some user-interface improvements, mostly just around the main-menu screen, and some improvements in character-selection. I think it looks better, anyway.

A couple story runtime errors got cleared up along the way. They were in some very rare scenes, and involved the Story Compiler’s inability to spot mismatched square-brackets under some circumstances.

I’ve added a little more placeholder music in some places. We’ll see how that goes. There was a track I tried to get in (because I thought it would go well), but the results were actually pretty terrible. It was a wax-cylinder recording of a performance from 1920. The audio quality was (while a fraction tinny) quite acceptable on everything I played the resultant OGG file back on.

Until I got it into the engine – at which point, there was this terrible buzzing added in, at what sounded like about ten hertz. So far, I’ve not been able to figure out what makes this audio-file not work properly, while all of the others do. I’ve omitted it for now, and will revisit it again later, probably.

I hope that you all had a happy rotational milestone, and that the time until the next one is not fraught with peril or despair.