Development Progress Report, week 49

This week is all about refitting the narrative. I have the worst compiler in Compiler Town.

 

It isn’t a traditional compiler (though at some stage, perhaps it should be), because it largely started out as more of an archive-builder.

At the start of things, the engine read in and parsed the raw story-source, and a bunch of loose media files, and that was fine.

Then I rolled everything into an archive format, which I started using for the story and save-games. This allowed me to move a fair bit of parsing workload into the ‘compiler’, saving a lot of runtime cycles.

That’s expanded considerably now, with the compiler taking on more work, introducing higher-level constructs, and doing a lot more preliminary error-checking. But it isn’t a proper compiler model in the traditional sense.

It’s more of a 21-pass text-processor, though it handles a number of familiar preprocessor features like conditional blocks, macro-substitions, and even a pragma directive or two.

The story source for SNAFU is divided into sections. The narrative section itself is divided into chapters, which are divided into scenes. Each scene contains a series of actions, which are basically analogous to bytecode instructions.

The story source basically consists of a human-readable form of that bytecode, plus a few newer higher-level constructs that either translate directly into it, or make it easier to author (or, ideally, both).

The compiler’s been getting a lot of work in bits and pieces over the last few months, and this week has largely involved going over the narrative and rewriting it to start to take advantage of a lot of the new features.

Right now, it’s a bit of a syntactic muddle. Some of the SNAFU source is near a year old, and it shows.

Low level action constructs like:

text:2:{c}The walk back was pleasant, despite the gloom.

are mixed in with newer, higher-level declarations like:

move [bystander,target] to Forest_Trail_1 with BASIC_CROSSFADE

which translates into one or more underlying action statements.

Very little of SNAFU before scene 400 (AKA the start of chapter two) uses much in the way of modernised declarations and constructs, including the role-aliases which were introduced way back in week 34.

I also discovered one character missing a slab of narrative in several variations within scene 364.1. That needs attention.

So, this week has largely been about starting a long migration process of the story source from old syntax to new syntax (I’d have spotted that missing narrative much sooner in the new syntax – with the old syntax, I’d kind of lost track of who was who, at a glance), improving the overall erorr-checking and error-reporting in the story-compiler, polishing some of the narrative when I see rough spots, and trying not to lose too many Sanity Points while I’m about it.

None of this is exactly super-exciting, and every day I spend on it is going to be even less exciting, but it is a slog that must be done. Game development is not all candy, sacks of cash, and shoulder-massages.

Therefore, I cannot promise anything very exciting for next week’s update either… or can I? We’ll just have to see.