Logo Pending


Musings on iMuse

One of the things I think LucasArts got Sierra beat in with regards to their old point-and-click adventure games has to be the music. I don’t mean that the music itself is better, but the underlying technology.

In SCI, a given music track can have cue points and a loop. These cue points can increase or set a value visible to the game engine, and let the game time things accordingly. Notable examples off the top of my head include the singalong text and images in Freddy Pharkas Frontier Pharmacist, the selection highlight following the beat in Quest For Glory, the singalong in Leisure Suit Larry 6… yeah.

But that’s just one way. The song can nudge the game, and that’s about it. A harmless bit of Mickey Mousing at best.

iMuse, on the other hand? The DirectMusic of its day. Remember DirectMusic? Me neither. Anyway, an iMuse song (near as I understand it) has queued triggers and a sense of beat, allowing the game to say “hey, switch to the cartographer’s version of Woodtick” and the song would wait for the current beat to finish, play a little flourish, and seamlessly transition into a different song. You could cancel them too, if you were fast enough. And let’s not get into the most triumphant example I’ve heard so far, X-Wing/Tie Fighter.

I figure if you give an SCI track beat markers, preload a fill riff, and have a script listen for requests, you might be able to approximate the basics. If you’re playing variations of the same song that only differ in instruments, you might be able to mute specific tracks, or send raw “Program Change” messages if you’re really adventurous…

But yeah. That’s why you can have proper MIDI dumps of SCI games, but you can’t quite hack it with most SCUMM games.

[ , ] Leave a Comment

What’s even the deal with felinese?

I’m glad you didn’t ask. When I originally started my Felin mod for Starbound, there was no associated conlang. I had some signage that I’d written in the Standard Galactic Alphabet from Commander Keen, but that’s about it. I did early on have the idea to make the felin very sexually open, with sex workers you could visit (even if not buy services from) that would be heavily implied to be self-employed and happy with their job and all that.

They had this sign at the door:

If you can read SGA, you can figure out what this says. Or just hover over it like a caveman. The sex workers themselves, even though the term would never appear on-screen, were defined in the prostitute.npctype file. All was good for a few weeks or so.

And then I got a private message from one of the forum moderators:

Someone has just reported the mod, claiming that there is a “prostitution NPC” included as an “undocumented and unreported ‘feature'”. Now, I thought I’d bring this up with you before anything else. Is there any truth to this? Maybe the NPC in question exists, but is not a prostitute. Or the person reporting it is just plain wrong. In any case, I’d like to hear from you about this.

I will never forget that moment.

So what I ended up doing to appease the mod (who agreed that the person reporting it was wrong) was to rename the NPC to something less explicit. A comforter, perhaps? And that’s what almost immediately evolved into the Four Paths that the felin follow, making prostitutes a kind of comforter, along with doctors and bartenders. But that’s another dumb story.

That just left the sign. The most explicit, visible thing about the prostitutes. It wouldn’t be that difficult to find out what that second line involves. So what I decided I’d do was, I’d rewrite the sign. But there’s only so much space on it…

If “intercourse” won’t fit, and another language is too readable, why not use your own?

Even if you can read SGA, you’ll find there are characters on this sign that you can’t recognize. And yet, this says basically the same thing as the other sign, including the full word for “intercourse”, in a completely functional language with 2,379 words and counting.

Those two words were quite literally the first I’d defined.

[ , ] 1 Comment on What’s even the deal with felinese?

The State of Noxico

Okay so what has happened to Noxico this past year. Let’s see, can’t be a lot, right?

First of all, I moved the thing to Github. The Bitbucket repo is still there, but I can’t say for how long. Going by the commit history as seen on Github…

  1. Reworked a bunch of text things to use Lua in hopes of making i18n easier.
  2. Added color support to fonts.
  3. Fixed a dumb bug that removed water when restoring a game.
  4. Added general support for weighted lists.
  5. Used testing characters to reveal and fix a bunch of things.
  6. Added a Markov chain option to name generation. 
  7. Reworked clothes tearing to give clothing a torn token instead of replacing them with entirely different items.
  8. Made character stats defined in Lua.
  9. Completely reworked the walkaround UI. Again.
  10. Overhauled the mod system, because I like Starbound.
  11. Added a test arena option, because I guess I kinda like Dwarf Fortress?
  12. Finally started on the team behavior thing that I’d been sitting on all this time.

In roughly that chronological order. I’m not sure about some of the Lua things, because of the whole “start from index 1” bullshit, but eeeh. It certainly bit me when I tried to convert the team behavior lookups to Lua, and that makes me worry about the attack multipliers.

[ ] Leave a Comment

King’s Quest 4 Copy Protection

King’s Quest 4 – The Perils of Rosella starts with a copy protection challenge right off the bat.

If you were playing the original 1988 version you could just enter the magic word “bobalu” and be done with it, but the 1989 version removed this.

It’s a pretty simple challenge-reply system, but the interesting bit is how your answers are considered. If someone were to somehow find the challenges they would also find the answers in the same order, but there’s a catch: the answers are hashed.

Very simply so, but they are. And of course the script code containing the challenges and answer hashes is compressed in the RESOURCE.001 file, and the whole thing is script code and nobody outside of Sierra could be expected to be able to read that stuff back in 1988. Sure, maybe some people could but still good luck figuring out how this worked. Even the backdoor phrase was compressed.

But now it’s 2018, nearly 2019, and I for one have made happy use of the tools now available to us, mostly to slake my own thirst for knowledge. So here’s how it works.

The copy protection script has several local variables: a random number from 1 to 79, the challenge text, the correct answer’s hash, a buffer for the user’s input, the hash for said input, and some work variables.

On startup, the random number is chosen. Then, in a big ol’ switch statement, the correct hash is decided on:

(switch (= randomPick (Random 1 79))
  (1 (= requestSum 431))
  (2 (= requestSum 521))
  (3 (= requestSum 535))
  ;...
  (79 (= requestSum 686))
)

In another big ol’ switch (instead of doing it at once?), the matching challenge is set up:

(switch randomPick
  (1 (= requestText "On page 2, what is the fourth word of the first sentence?"))
  (2 (= requestText "On page 2, what is the fourth word of the second paragraph?"))
  (3 (= requestText "On page 3, what is the fourth word in the first paragraph?"))
  ;...
  (79 (= requestText "In the section TIPS FOR NEW ADVENTURE PLAYERS, what is the eighth word in the first paragraph of tip #2 (STAY OUT OF DANGER)?"))
)

Incidentally, I said our guess would be stored in a buffer variable, that is an array in memory large enough to contain it, but I did not say any such thing about the challenge text. That’s because it’s stored as a pointer to the text, in the place it was loaded to as part of the script. From then on these challenges don’t mutate in any way. Our input can be literally anything.

Anyway, after displaying the challenge, we have our input in a buffer. This is where the magic happens:

(= i 0)
(while (< i (StrLen @userInput))
  (= ch (& (= ch (StrAt @userInput i)) $005f))
  (StrAt @userInput i ch)
  (= inputSum (+ inputSum ch))
  (++ i)
)

Iterating through the user’s input, we read the next line inside-out. Using the StrAt function we fetch the next character and store its value in our work variable. Then we use some binary magic on that same value to turn it into UPPERCASE, and assign that to our work var. Now, as I write this I feel like this can be simplified a little bit…

(= ch (& (StrAt @userInput i) $005f))

…Yeah, that seems nice. I don’t think it’d hurt functionality to do this. Anyway, the next line shows how SCI function and kernel calls can be variadic as all get out — given three arguments, StrAt will set the character on the given spot. In the third line, we add the character’s value to our running sum.

And that’s it! We can now compare our input to the expected answer, and either continue on to the title screen or display an error and quit.

But that’s not all there is to it. First, for some reason, the input is uppercased and then stored again, character by character. This is so the 1988 release can compare it against the magic backdoor word, which is also in uppercase. This seems like an awful waste when you could compare it against a number instead. Not to mention, the 1989 release doesn’t even have the backdoor and still does all this. (For the record, that would be 437.)

Second, this is such a simple method that there are guaranteed to be words with the same hashes. For example, “voice” and “licks” are both 374.

But yeah, that’s just about all there is to know about the copy protection in King’s Quest 4 – The Perils of Rosella.

[ , , , ] 7 Comments on King’s Quest 4 Copy Protection

Just don’t

Me: ..and what is Pinball Witch’s source for this bold claim? An article on themarysue. Disregarded like I don’t even know what.
Letrune: It is not true, it is just that it was a sudden reveal.
Me: Look, I don’t think themarysue is a good source on this
Letrune: …no it isn’t! They think Asimov got NO female characters, not protags, CHARACTERS

“Samus is canonically trans”, my fuzzy buttcheeks.

Look, I got no problem with trans people and such, just ask Letrune, but when your source is that ill-informed you probably shouldn’t take their claims for gospel truth.

Okay so sure, the manual for the first game called Samus a “he”, and the name works both ways. It’s called “not spoiling the surprise at the end”, thanks.

[ , ] Leave a Comment

On snakes

“Watch out! A poisonous snake!”

Who among us who have played King’s Quest V – Absence Makes the Heart Go Yonder doesn’t remember this iconic line?

Thing is, it is of course wrong. The snake is venomous, in that it bites you and you die. Indeed, the narrator gets it right when you look at the snake: “A large, venomous snake blocks Graham’s passage to the east.”

I have nine different versions of this game and only two of them get it somewhat right.

The original diskette version with the separate “walk” and “travel” icons? Poisonous. The CD version? Poisonous, even with some script changes!

The Amiga version? Poisonous.

The v55 and v62 EGA releases? Poisonous.

The French diskette version? Venimeux.

The German diskette version that I acquired while I was composing this post? Eine Giftschlange.

Now, I myself am Dutch, and I can confirm that in Dutch too, something venomous and something poisonous are both giftig. If there was a Dutch version of KQ5, Cedric would likely say this:

(made with Foone’s death generator because it was quicker than modding.)

The Japanese PC-98 version?  毒, doku.

Even though doku means poison, a dokuhebi (properly 毒蛇) is very much a venomous snake.

(Note from December 15: this brings to mind a thing from Orphan Subs’ Stop! Hibari-kun! release about the word wani being both crocodile and alligator.)

Of course, there is one more version left – I only listed eight so far. The ninth is a real slap in the face.

Yes, let’s rewrite the entire game so it can run on the NES and not finally fix this while you have the chance.

So basically English is the only language I’ve seen KQ5 in where there’s separate words for “it bites you, you die” and “you bite it, you die”, and none of the English versions get it right!

[ , ] 1 Comment on On snakes

Kamen Rider Zi-O and the Konami Code

Or is that the Minako Code? Either way, Zi-O episode 3 had a particularly nice reference:

I’ve seen several people, including whoever wrote the episode’s page on the KR wiki, completely mess this up.

The Code is “up up down down left right left right B A”. This note is “down down up up right left right left, then press all keys at once.”

I’ve seen people say this note has the Code as-is, I’ve seen them say it’s got the left and right inputs reversed… it’s almost as bad as thinking “start” is part of the Code proper.

[ , , , ] Leave a Comment

No windows, but no DOS either

But why did AGI have that big black command line bar to begin with?

Because the original didn’t have popup windows:

By then the picture format and all that was pretty much set or something like that. With SCI, they could do it all from scratch, using their AGI experience as merely a guideline, and images could go up to 320×190.

[ , , ] Leave a Comment

Colors!

Mono modes had an underline attribute. Great for text.

CGA/EGA text modes both had colors. Please excuse the off-color brown.

VGA was much the same but allowed trading the blink attribute for bright backgrounds.

[ , ] Leave a Comment