Skip to content

“Ergo”

Let’s get the business out of the way first; the rest of this post will be a rambly mess, but we’ll get things done here above the line.

I have a “new” browser game! “New” in quotation marks because it’s something I 80% finished eight years ago and then 95% finished four years ago, and also because it’s basically just a port of the old puzzle game Cogito.

Play Ergo here

Try it out and let me know what you think!


Last weekend, I was inspired to tweak my blog theme to reduce the amount of useless JavaScript and CSS that every page downloads. The pages are still definitely heftier than they need to be, but I’m pretty pleased with getting rid of the jQuery library from almost every page, at least.

While I was working on that I ended up looking at the source of a lot of the posts here on the blog, and for some reason seeing the <i> and <b> tags I’d strewn everywhere over the years ticked me off a little bit, so after I was done with the trimming I went through a bunch of my posts and embraced Semantic Markup by using <cite> for game titles and all that good stuff.

After I was finished, I figured I might as well do the same for my main site, too. One SSH session later and we’re acking through a bunch of static files, looking for tags to replace.

And one of the hits was for Ergo, a game I started eight years ago and shelved, then picked back up four years ago and then shelved again. I have an extraordinarily awful ability to almost finish something and then find a reason to sit on it forever without releasing it, and this was a double victim. So, I decided to get myself into full shipping mode and get this thing out the door as quickly as possible. And I did! I’m super happy about that.

Since the plan was to release this game come hell or high water, it does have some big warts, chiefly that it’s not especially mobile-friendly. When I started working on this in 2008, the resolution of the iPhone screen was only 320×480, which wasn’t big enough to display the whole 385×385 game grid at full size, so I made the choice to only target desktop web browsers. 2012 me never revisited the decision, and 2016 me decided just to patch in the easiest touch detection that would possibly work rather than go for a UI overhaul and risk finding a reason to kill the project for another four years.

So that’s what’s been going on since last week Friday. Now, let’s go back twenty years and work our way back to this point.


Cogito is far from a top-tier puzzler: its difficulty curve is bumpy to the point of discontinuity, and most of its rules don’t offer a significantly different challenge from the others. It’s also not a game I’ve ever legitimately owned; I had a demo of it on my home computer, and it was one of many games installed on the personal computers that my sixth grade teacher had in her classroom. This combination of factors meant I never got particularly far in the game back then; the demo skipped enough of the hard puzzles that I was able to see the third grid pattern, but in the full version I doubt I ever saw the third pattern, and I’m not sure that I even beat the twelfth puzzle and saw the second pattern.

Cogito is, despite all this, one of the most important games in the entire world to me.

It’s a “developmental” game for me, in that something about where and when I played it during my childhood let it firmly attach itself to my being. At any time of day, no matter what I was doing beforehand, I can crack the game open, let the background music wash over me, and be transported into its zone, where it’s 1997 again and I’m solving this one puzzle again for the fiftieth time and everything’s totally awesome.

My old Mac emulation environment in SheepShaver was never able to run Cogito, and I’ve never bothered to set up a different one (Basilisk II can apparently be successful), so I haven’t been able to properly play the game in its original form in a long time. That’s what ultimately led me to start Ergo in 2008.


I began working on Ergo at the same time as Guide, which wasn’t a super great idea because one of the reasons that I never finish anything is that I have an idea for a different project and the first one gets waylaid forever. But it was 2008, and I was working on both Guide and Ergo.

I did eventually figure out a way to run Cogito in SheepShaver, which was pretty important, because it’s really hard to port a game without being able to access its stage data!

chz16: Also not really relevant but I got Cogito kind of working in SheepShaver.

Mactigerz: “kind of”?

chz16: Occasionally freezes and I have to restart the emulator.

chz16: Also stage 24 was way glitchy.

Mactigerz: How’d you get it working?

chz16: Clicked a lot until the main game screen showed up.

Mactigerz: lmao

It might seem like a throwaway line, but the most important part of that chat log is actually line 4, when I mentioned that one of the stages was glitchy. Because, as it turned out, it’s not just stage 24 that had problems, but stage 24 and every stage after it.

For who knows what reason, after you hit stage 24, the buttons only start rotating part of a row or column, not the whole thing. Because the world doesn’t make sense, the glitch manifests itself in different ways in different puzzles. For example, on stage 25 above, each button only shifts five of the cells in a row or column, but on stage 49, which uses the same rules, the top and left buttons move six and the bottom and right buttons only four.

It’s baffling and infuriating, and it combined with the already ridiculously high difficulty of the rules to make it so I simply could not solve stage 34.

This is the point when Ergo development ground to a halt: even though I’d managed to put together a largely functional clone of Cogito, I’d never finish it if I couldn’t even play far enough into the original game to copy its stage data. Guide‘s development had also slowed to a trickle by now, largely because of my bizarre insistence that it have an arbitrarily high amount of puzzles.

I’d eventually finish Guide in early 2010, but I wouldn’t pick up Ergo again for nearly four years: July 2012.


I was reminded that Ergo existed after my friend Colin set up a SheepShaver environment himself. This time, I was able to find a password file that, while incomplete, had enough codes for the later puzzles that I was able to grab the layout data for the seven remaining patterns.

After that, things went super great for about a week! I added in the rest of the stage data, extracted all of the game’s other tilesets besides the one I’d been using, and finished off all the remaining features. I even put it under version control, which was an extremely pleasant surprise when I found the project again last week.

That’s when the sound effect bugs ruined everything.

One was in Firefox, where something about how short the shifting sound was made the browser unable to immediately seek it back to the beginning while it was playing. This caused audio desynchs when interrupting and restarting it rapidly, mainly noticeable during the puzzles where one click causes two shifts. I fixed this by, uh, adding some silence at the end of the sound.

The bigger bug was in Safari, which had some soft of weird playback lag on <audio> tags that other browsers didn’t. This resulted in some absolutely untenable audio desynching where the sound would play like a full second after you clicked a button, and the puzzle scrambling might play one or two sounds at most.

Nothing I tried had any sort of positive effect, so the game got chucked down the memory hole for a second time.


So now we’re back to the present day, when an invocation of ack <i> found the in-progress page I had in my webspace for Ergo and I remembered that this thing existed again. I didn’t take me too long to rediscover the sound effects bug.

I asked my old friend Google what to do about this and it suggested the Web Audio API, which I’d heard of before but never investigated because I’d somehow gotten the impression that it was a complicated mess and trying to use it was a disaster. But after I took an actual look at the documentation, it turned out that it was basically just setting up a Core Audio graph, which is something I’ve done before. So uh, yeah! I cranked out a new sound effect engine in an afternoon and it totally worked everywhere, which was neat.

And that was the only thing left that was blocking me from shipping the game. I did make a couple of other small improvements, like retrofitting in touch as previously mentioned and making the stage selection grid less actively hostile to colorblind folks, but the game was basically complete four years ago and it’s embarrassing that it took me as long as it did to find what was a relatively straightforward fix for the sound problem.


So that’s pretty much the Ergo story, but there’s a postscript.

The version of Cogito I grew up was the Mac version, but there was one for Windows 3.x too (and an Apple IIGS port that looks awful). In the past I’d never tried it because I wasn’t able to run Windows games, but since then I’ve finally set up an early Windows environment in Boxer (DOSBox). But even if I hadn’t, the Internet Archive went ahead and put DOSBox in everyone’s web browser, so it still would’ve been accessible to me.

And hey, something interesting about the Windows version of Cogito running in DOSBox: it glitches in the same way that the Mac version does in SheepShaver.

Barring the seemingly unlikely outcome that two emulators for different operating systems are bugging out different binaries in the same way, it seems like the bug is in the game itself, or the bug was in one version and it was maintained in the port to the other, or—maybe worst of all—it’s an intentional gameplay shift for some unfortunate reason.

Except, I’ve been lying a bit in this section, because the bug doesn’t work the same way in Mac and Windows. On Mac the glitch starts with stage 24, but on Windows it doesn’t start until stage 25.

And it gets worse. Remember how I said that, on stage 49, the top and left buttons move six cells in the Mac version while the bottom and right buttons only move four? Well, in Windows, the top and left buttons still move five like in earlier puzzles, but the bottom and right buttons move six.

I don’t even know what to think any more. How does this happen, intentionally or unintentionally?

So anyway, if you want to play Cogito but don’t want to deal with the rules arbitrarily changing into nonsense a fifth of the way through, go ahead and try out Ergo!

Post a Comment

You must be logged in to post a comment.