Development Progress Report, week 65

If it’s Monday, it must be time for an update!

All sorts of sporadic work this-week, starting with moving the auto-advance feature from being an experimental feature to being a stable feature. Or so I hope.

Auto-advance (as with most visual novels) advances to the next text-passage after a short delay. It’s toggled on and off by clicking on the text-prompt, or pressing the “A” key, and now has a mention in the tutorial.

I’ve also added a little timer-bar to give visual feedback of how long it will be before the story advances. Tucked away in the game preferences is an option to adjust that delay-time.

The timer-bar widget is cool. It has been suggested that some choices in the story could be timed as well. It wouldn’t be too hard to do, and now I’ve got a versatile little widget to show the countdown. I’ll look at adding that as an option a little ways down the track.

Widget-rendering has been streamlined a little. It turned out that I was making an unfortunately large number of calls to get the current time in milliseconds. Time and intervals are more important than counters for rendering.

Rendering can be delayed for a zillion reasons, including hardware and other programs doing their thing. If you use counters, anything that should be progressively rendered can step unevenly.

Instead, it is better to find out what the time actually is, and render according to where things should be at, at that time. Even if the frame-rate gets lumpy, it feels smoother to the user.

So, I was getting the time way too often. Many non-static widgets had to ask for it in their render-functions. Now, I just grab the time once, at the start of the rendering cycle, and refer to that for all of the widgets. If the last widget is rendering a millisecond or so later than that time, it doesn’t actually hurt anything.

I’ve installed the latest release-candidate of Visual Studio 2017, and am currently building with that. I’m not sure whether it is the code-generation, optimiser, or runtime-libraries, but there’s significant measurable improvements in performance over Visual Studio 2015.

I’ve switched to that, going forward, and am hoping I’ve got the right set of DLLs distributed to make the application run on machines other than mine.

Game-controllers are better supported now. Previously, only one controller was supported, and it had to be plugged in when the application started up.

Now, hotplugging controllers is fine, and Argus supports as many game-controllers as you can plug in. It doesn’t matter which one you pick up, either. They’ll all work equally well.

The fast-forward icon has been redrawn. The original was hand-drawn, inked and scanned, and has a certain charm all of its own. I’m still not entirely happy with the new one, though. More work required.

The narrative-background-transparency option has returned. It was disabled in the new UI since it was hard-coded to adjust the transparency of a widget that is also disabled in the new UI. Now there’s script-integration allowing the story-file to override and adapt the meaning of that option so that the correct effect is obtained with the remaining, customised widget-set.

Tip: Loading images with SDL will yield surfaces/textures without alpha-channels, unless the original image had them. If a surface/texture doesn’t have an alpha-channel, you can’t use SetAlphaMod() on them. Opaque is opaque.

There are two solutions to that. Load your source image up in an image editor, whack in a transparent layer and reexport (obviously not for jpgs, which don’t support transparency), or convert on-the-fly.

That looks like this:

 if (sdlsurface->format->format != SDL_PIXELFORMAT_RGBA32)
 auto tmpsurface = SDL_ConvertSurfaceFormat(sdlsurface, SDL_PIXELFORMAT_RGBA32, 0);
 sdlsurface = tmpsurface;

Older versions of SDL won’t have SDL_PIXELFORMAT_RGBA32, but it is eitherĀ SDL_PIXELFORMAT_ABGR8888 orĀ SDL_PIXELFORMAT_RGBA8888, depending on the endianness of your platform.

After running a few tests, it turned out that I only had about three image assets that lacked the alpha-channel, but the fact is that I’d just been bitten by trying to figure out why I couldn’t fade one of them using SetAlphaMod() – so there you go.

Other than that, I’ve been plotting the way forward for a group of story-arcs, and maybe I’ll be able to have some spoiler-free discussions about that soon.

Thanks for tuning in!