GSoC Week 6: Harcourt Fenton Mudd, have you been drinking again?

Mission 4: “Love’s Labor Jeopardized”, is an odd one. You don’t really need to do very much to complete the mission; most of the challenge comes from getting the maximum number of points possible by discovering as much as you can about an alien ship.

There is only one way to die, which involves waiting for 25 minutes with plenty of warnings, and there aren’t even any redshirt deaths! Lt. Buchert must be the luckiest security officer in the crew.

Though, he has to deal with Harry Mudd, so I guess he breaks even. Honestly, the best part about this mission is talking to the crewmembers and getting their reactions to Mudd.

Mission oddities

This mission follows familiar patterns; there are pieces of unused audio, despite clearly having places to fit in. For instance, there was an instance where McCoy and the redshirt had the same line, but the redshirt played McCoy’s voice clip when his textbox came up. That was easily fixed, since his voice clip still exists in the game data.

I also encountered invalid actions, which was a first. For example, there was an action defined for “using a viewscreen on Kirk”. Obviously, that’s supposed to go the other way.

What’s great is that, if the text exists, it’s voice-acted. They were thorough with that, even if the text was unused for one reason or another.

Aside from that, there is one very, very, very obvious bug in this mission. Basically, Mudd goes completely insane after inhaling some alien aromas, and you’re supposed to help him out. (Or you can leave him as-is.)

However, you can just go straight back to the first room, and he’ll still be there, cheerfully bantering with the crew as if nothing happened. Then you can go back to the previous room, and he’s insane again.

I’m still finishing up the mission, but I’ll be sure this gets fixed in ScummVM.

A detour into Mac OS 8

Earlier this week, I took a quick break from mission logic to take a look at the Mac port. Since I was convinced at that point that the mission logic was hand-written assembly, I wanted to see what they did with the different processor architectures.

I spent two days trying to read from almost-dead floppy disks, searching for obscure unmaintained programs to read from a file’s so called “resource fork” (a feature of the mac filesystem), figuring out how to use Mac OS 8, and looking for an appropriate emulator to run it. (The program is called Sheepsaver, it’s pretty swell.)

This was what my Monday evening looked like.

And, what did I find when I finally dumped the files? x86 assembly in the mission logic. Now, I haven’t done any serious reverse-engineering on the main executable file, but since the Macs of that day ran on 68k processors, it’s quite obvious that emulation was going on.

The Amiga was apparently based on the 68k processor as well, so, perhaps this is related to the complaints of sluggishness in the Amiga port that I’ve heard about. That being said, mission logic would take only a very small fraction of the total execution time, so perhaps there are other reasons for the sluggishness. Or perhaps even parts of the engine code are emulated as well. That’s just speculation, though.

A fun side-note: I was running Mac OS 8 when installing this version, which ran on PowerPCs. So, my x86 computer was emulating a PowerPC for MacOS, emulating a 68k for Star Trek, emulating an x86 for the mission logic. Ahh, the circle of life is beautiful.

PS

I was mentioned on Github’s blog in a feature on ScummVM! It’s great to know that people are paying attention. It motivates me to make these posts as interesting as possible.