5 minute read

Microsoft-isms

The other day I was trying to copy the contents of an email in Outlook and paste it into OneNote. The text was copied over fine, but the formatting kept getting messed up. All of my bullets were losing their indentation, which made the output hard to read. I manually fixed the formatting, shrugged it off as a “Microsoft-ism”, and almost continued on with my day before I remembered how the legendary Everett Kaser solved his problems with Microsoft software.

Whenever I ask developers if they’ve heard of Everett Kaser I usually get a blank stare. He doesn’t have the same Internet following as Jeff Dean, Martin Fowler, or Robert C. Martin. He hasn’t written a manifesto, ascended to the exosphere of a corporate org chart, or published “the book” on something. So it’s very understandable that no one I talk to has heard of him.

Honeycomb Hotel

My own discovery of Mr. Kaser was purely by chance. In high school I had a computer and lots of time, but I didn’t have any money, so I frequently browsed the shareware scene for fun games. A puzzle game called Honeycomb Hotel caught my eye one day. After installing it, I quickly liked the music, progressive difficulty of the puzzles, and the no-nonsense graphics. I played until I ran out of “free trial” games.

Most of the shareware games had a somewhat transparent technical implementation. Platformers relied on a core physics model of 2D collision detection, accelerated control inputs, and some form of gravity. FPSes relied on similar logic, but in 3 dimensions instead of 2. Adventure games took a different route, relying on dialogue trees and word puzzles.

Honeycomb Hotel was different. The game started with a hexagonal grid of mostly empty hexagons, called “honeycombs”. Each honeycomb could be occupied by exactly one “thing”, where each thing belonged to a category, such as animals, plants, fruits, letters, insects, etc. Every row of honeycombs focused on one category of “thing”, so one row would contain all of the animals, a different row would contain the plants, etc. A set of clues were visible around the honeycomb. For example, one clue might indicate the red apple is aligned with the brown bear along the northeast diagonal of the honeycomb. If the player knew the location of the brown bear then she could deduce the location of the red apple. The goal was to use the existing occupants of the honeycombs and the remaining clues to determine where all of the occupants lived in the honeycomb.

In the lower difficulty levels, players could easily use the available clues to solve the puzzle. As the difficulty ramped up, the game purposely left “holes” in the clues that required the player to choose one of several potential routes to solve the puzzle. Only one route led to a valid solution, so players sometimes had to backtrack if they went down a dead end. The game helpfully provided a tool for situations where a player wanted to go down a temporary route to the solution. The tool was called the “What-If?” tool, because the player was effectively saying “What if this thing goes in this honeycomb?”.

The “What-If?” tool intrigued me because the game knew when a human would have to use it to solve the puzzle. How did the game know when a human needed to use the tool? How could it know what I was thinking with my deductive logic?

I went searching for answers on the Everett Kaser website. Fortunately, I didn’t find what I was looking for. Instead, I discovered a whole new world.

K-What?

You can read about KINT on your own, but the summary is that Mr. Kaser was tired of Microsoft changing the Windows APIs every few years, so he did what any developer would do. He created a “framework” to abstract the Windows API instability away from his games. That way, his games would be coded against the stable API of his framework and any time the Windows APIs changed he only had to update the framework code instead of all of his games.

Except he didn’t just create a framework. He went lower than that.

Did he create his own interpreter, called KINT? Yup, but he went lower than that.

Did he create his own assembly language, called KASM? Yup, but he went lower than that.

Did he create his own CPU (K-CPU), linker (KLNK), and object files (.KO)? Yes. Yes, that’s how low he went. In case you are curious, he open sourced the platform. You can download it on his website. The last time I checked there were 10s of thousands of lines of fairly clean C code.

I’ve often seen resumes touting “5+ years of C++” or “likes to study algorithms”, but I’ve never seen someone say they designed their own virtual hardware and software ecosystem by themselves because they were tired of keeping up with Windows API changes!

Of course, I’m aware of game engines like Unreal Engine, Serious Engine, CryEngine, etc. But those are all created by a team of people.

Everett Kaser created his platform by himself.

That blew my mind the first time I heard about it and it blows my mind even more to see he’s successfully used his platform for over 10 years now.

What-if it’s SAT?

I’m not sure if my Google-fu has improved over the years or if the collective knowledge of the Internet has grown to encompass my prior searches. Regardless, I recently discovered a clue to my original question about how the “What-If?” tool worked. One way Honeycomb Hotel could both generate clues and know the usefulness of the “What-If” tool is if the game treated the board state and clues as a boolean satisfiability problem. An open source implementation of the Zebra Puzzle shows that a combination of randomly generated clues and a tight ruleset can lead to knowing if the generated clues provide enough information to solve the puzzle. To implement the “What-If?” tool, similar logic would have to know how many required clues are missing, possibly by allowing a certain number of free variables in the boolean formula.

I’ve never had the opportunity in my professional life to work on boolean satisfiability problems. Maybe someday I’ll get some time to explore them on my own and finally unlock the secret of the “What-If” tool.

In the meantime, sometimes I’ve wondered how many other Everett Kasers are out there.

Tags: ,

Categories:

Updated: