An author's reference for Bisquixe, a tool for adding audiovisual content to Inform projects (up: final (?) comments on Cloak of Darkness)

This is a companion post to the Cloak of Bisquixe announcement thread, because I didn’t talk about any code or tech stuff over there.

The code uses a lot of to decide definitions to manage and prioritize links and nouns. I think it works well in practice, and an author would not have trouble implementing it (just edit a table), but it isn’t terribly readable. I don’t consider this a final method.

However, I’ve been working on Bisquixe for a month now and need a break. Rather than discuss the logic, let’s focus on the reason we’re all here: the Bisquixe content.

In terms of what Bisquixe is doing here, we have two color modes, light and dark. I chose the color schemes according to APCA recommendations using this tool. Font-sizes and weights were chosen specifically to work with these colors, and, while I had no specific font recommendations to work with, I chose two that I found especially legible.

I had to think about link colors presented in three ways: status window, buffer window, and command bar. In truth, and this will likely surprise people who don’t spend time on this sort of thing, getting complementary color schemes sorted out was a very high-effort activity that was only finalized late in testing. Because the css-set-fast phrase uses text strings, I was able to use what Inform calls “texts with random alternatives.”

This is the color scheme rule:
	css-set-fast ".play; background; [one of]#0c0c0d[or]#e1e0e0[cycling]";
	css-set-fast ".BufferWindow; background; [one of]#0c0c0d[or]#e1e0e0[cycling]";
	css-set-fast ".BufferWindow; color; [one of]#e1e0e0[or]#0c0c0d[cycling]";
	css-set-fast ".BufferWindow; scrollbar-color; [one of]#656586 #0c0c0d[or]#656586 #e1e0e0[cycling]";
	css-set-fast ".GridWindow; background; [one of]#292929[or]#e6e6e6[cycling]";
	css-set-fast ".GridWindow; color; [one of]#e1e0e0[or]#0c0c0d[cycling]";
	css-set-fast ".Style_input; color; [one of]#e1e0e0[or]#0c0c0d[cycling]";
	css-set-fast ".Input; color; [one of]#e1e0e0[or]#0c0c0d[cycling]";
	css-set-fast ".GridWindow a:any-link; color; [one of]rgba(249, 240, 133, 0.9)[or]rgba(4, 41, 190, 0.9)[cycling]";
	css-set-fast ".BufferWindow a:any-link; color; [one of]rgba(249, 240, 133, .9)[or]#01016f[cycling]";

Note that this rule does not include link colors for the command bar. This proved to be a special case. Inform does not honor alternatives here, presumably due to modifications made for making stale command bars disappear (more on this in a second). For this reason, I had to use a condition and two seperate rules for color mode changes.

to say linkbar:
	css-set-fast ".session[onlinecounter][sessionid]; display; none";
	increment onlinecounter;
	if dark mode is true:
		set-any-class "linkbar_dark session[onlinecounter][sessionid]";
	otherwise :
		set-any-class "linkbar_light session[onlinecounter][sessionid]";

Speaking of the vanishing command bar, Cloak of Bisquixe only displays one command bar at any time. This prevents the screen from becoming cluttered with command interfaces with dead links. Inform output, once printed, cannot change. That is an immutable law. But with Bisquixe, which changes CSS on the fly, we can change the properties of something that has alread printed. Using Onlinecounter and Sessionid variables, Cloak of Bisquixe gives every printed instance of the command bar a unique identifier.

Onlinecounter is initially 1.
sessionid is a number that varies

Sessionid is a number that varies.

The restore the game rule response (B) is "Ok[resetseed]."

To say resetseed:
	now sessionid is a random number from 1111111111 to 2147483647;
	
after starting the virtual machine:
	follow the light mode linkbar rule;
	follow the dark mode linkbar rule;
	now sessionid is a random number from 1111111111 to 2147483647;
	now the command prompt is "[linkbar][command bar][roman type][line break]>";

When a new command interface prints, the old one is set to display; none, removing it from the bufferwindow. The text is still there, somewhere, it just isn’t displayed anymore. This method was initially devised by Mathbrush, and it was further developed in coversations with him and Zed.

In terms of the formatting of the command bar, I chose to keep links aligned via a pseudo “tab stop.” Each column occupies ten characters, and, after printing a link, Inform prints however much white space is required to fill in the gap.

to decide which text is whitespace for ( l - a link ):
	let t be "";
	choose row with a link of l from the table of linking;
	let C be 10 minus the number of characters in printed entry;
	repeat with whitespace running from 1 to C:
		now t is the substituted form of "[t] ";
	decide on t;

I think ten characters is too much real estate for one link. If I get it down a bit, I think I could comfortably print up to five links on a line. Four doesn’t seem like enough.

The mini-map uses an extension that I wrote for a work-in-progress. That game has a massive map that could never fit on the status bar, so it centers on the player. That’s overkill here, but I didn’t want to write a new extension just for this demo. Hopefully it still communicates what the Simple Multimedia Effects extension can do!

What would I change? I have mixed feelings about deciding to define links in a table. This mostly worked out well, but the table can’t be sorted, and it can’t contain phrase names. These capabilities (one or both) would have trimmed the code quite a bit, though I suppose I would have needed to define the links elsewhere.

The concept of using an object-based rulebook for prioritizing links has been suggested by more than one party. I like the sound of it and will investigate further. However, in this moment, I need to declare this effort finished so that I can move on to other things. It’s been all-Bisquixe, all-day for a month!

After some time has passed, I’ll get an extension for the command bar released, and, following that up, I’ll look into a rewrite down the road. For now, I’d like to get to my current WIP, I, Thief, which I hope some people will look forward to.

As a reminder, now that the reference is complete, feel free to discuss Bisquixe here, though please make new threads for help with coding problems (to help your fellow programmers find solutions while searching the forum). This is also a great place to share Bisquixe code and examples if you have any. I’d love to see it!

Meanwhile: I’ve updated the itch page to include all assets required to compile, including extensions, figures, and build templates. Grab them here:

Cloak of Bisquixe by Biting Cat Demos

5 Likes