Quoll Work Thread, 2025-10-25 - 2025-10-25 20:20
I’m getting back to working on Quoll, and I decided to tackle something to be nicer to the Playerr when they try to do the optional puzzle in the Glitch’s First Tutorial level I am adding in this major release. It requires me to address one of the big holes I’ve painted myself into and do some refactoring… (This may contain some spoilers!)
OK, let’s see how quickly I can summarize this. One of the new features this major release will be a new character, Taffany Guava, who is one of Ada’s “old roommates” that have been created by Glitch for Glitch's Chronomancy tutorial. Taffany is a taffy-based skunk who has an odd manner of speech, where she (or he…) talks like a Pokemon, using mostly parts of her name. Taffany also has a cognitohazardous effect where this manner of speaking spreads to Ada as Ada converses with her.
In game, this causes Ada’s responses to the Playerr to increasingly become filled with “taff-speak”, replacing normal words with Taffany’s name, or parts thereof. Implementing and testing this has been quite the challenge. To be kinder to the Playerr, Ada’s responses are written in such a way that certain important words will never be taffificated. One place I overlooked is when Ada mentions or describes the CDs that serve as part of an optional puzzle involving Taffany.
Now, my implementation of this allows for a great deal of flexibility in what text I allow or don’t allow to be
taffificated. There are two text substitutions, [start-taffificated-text] and [end-taffificated-text] that controls
that. It’s tedious to add these to all responses, but that’s the cost of giving me the flexibility as a write to turn it
on and off at will.
It’s important that this gets wrapped up nicely, because one of the first things I ran into implementing this is that I needed to create different implementations for my two release platforms, browser and interpreter. Browser is what runs in your web browser on the website using the Vorple library for it. Interpreter is using a classic downloadable text adventure interpreter program like the Inform 7 editor or my reference interpreter, Gargoyle.
The reason for the different implementations is that when running on an interpreter, I use the Text Capture by Eric Eve
Extension. Using this Extension when encountering [start-taffificated-text] I can use the Phrase start capturing text, and then when I reach [end-taffificated-text] I use stop capturing text and write out the captured text,
taffificating random words based on Ada’s current taffification level.
The Extension does not work in the browser on Vorple, so there, both phrases in Inform 7 just write out my favorite ASCII control character, the bell character (UTF-8 0x07). When taffification begins, I turn on Vorple’s output filter functionality which calls a JavaScript function I wrote to find these bell characters and taffificate the text before printing text.
Yeah, it has been quite the rathole getting this implemented, as you may guess. One of the things I ran into is that I did not prepare for there to be nested uses of the phrases. For example:
say `"[start-taffificated-text]Wow, that's really [start-taffificated-text]cool[end-taffificated-text].[end-taffificated-text]`.
This ends up happening because I am often using other text substitutions in my responses which may call the taffification substitutions themselves:
To have Taffany-Being accept the desired CD:
say "[start-taffificated-text]I hand the very [ada-cool-phrase] CD over to Taffany[end-taffificated-text].".
To say ada-cool-phrase:
if GNBSP-1-Taffany-Desired-CD is cool:
say "very [start-taffificated-text]cool[end-taffificated-text]";
otherwise:
say "not at all [start-taffificated-text]cool[end-taffificated-text]".
(This is a made-up example.)
Thanks to the copious amount of testing (which requires basically printing out every piece of possible text Ada may say during this level), I ran into this pretty fast and fixed it… on the interpreter implementation. I missed porting that fix into the browser implementation, or more accurately, I think I figured that I didn’t need that complexity for the browser implementation. But that has changed.
Like I said, one place I want to be nicer to the Playerr is when Ada mentions or describes the CDs for the optional puzzle, because the Playerr will need to use the color of the CD to write commands about them like “GIVE WHITE CD TO TAFFERY” (this is male Taffany’s name). Right now, the color is something that may be taffificated, so the Playerr may have no idea how to even refer to the CD with extremely bad luck. But I don’t need luck. I have the power of coding!
My plan is to add new [block-taffificated-text] and [unblock-tafficated-text] substitutions that will completely
turn off taffification for that text regardless of the Current-taffification-depth variable, which is how I fixed it
in the interpreter implementation. Basically, text remains taffificating until Current-taffification-depth hits zero
with enough [end-taffificated-text]s.
But I want to completely stop taffification, hence the need for new phrases. It is a pretty straightforward idea, hacky
as it is. However… this won’t work in the browser version because it doesn’t worry about Current-taffification-depth
at all. But to fix that, the browser implementation needs to be aware of [start-taffificated-text] and
[end-taffificated-text] calls versus just both of them together represented as the bell character.
And guess what? There are other control characters that explicitly go back to shifting in and out a character set, Shift In (0x0F) and Shift Out (0x0E). I was looking at Start of Text (0x02) and End of Text (0x03), but the Wikipedia page for End of Text pointed out that it’s what gets sent when you press Ctrl-C in a terminal to stop a currently executing program. It should be safe, but it definitely could be dangerous in the browser context.
OK, enough yapping, let’s go get it done.