Dr. Maze

This game is from the old Ludum Dare platform. You can try viewing the original page on Web Archive
(may not load correctly).
My first Mini-Ludum Dare entry!

I went with writing a DOS game, because that's what I have the fondest memories of programming in as a teen. I've learned a lot since those days, and I wish I could have known then the kinds of things I know now. But luckily, this project let me combine the past and the present, during which I still learned some new things!

The game is called Dr. Maze. The backstory, which I didn't really get around to adding into the game itself somehow, is that a brilliant scientist named Morton A. Zeman had an passion for mazes. Gradually this became an obsession for him, which leached more and more into his work, until eventually his peers began to ridicule him for it. He disappeared into an underground laboratory of his own design, becoming a recluse and referring to himself only as Dr. Maze from then on, vowing to get his revenge on everyone on the surface. Your job is to infiltrate his lab and retrieve his plans before it's too late!

Gameplay is pretty simple. Find your way through the mazes to the ladder at the end of the level, collecting the floppy disks along the way, while avoiding Dr. Maze's Mazerunner robots. If one of them catches you, they'll drag you back to the start of the level.

The mazes are dynamically generated, so you should always get a different gameplay experience.

WASD moves you around, and spacebar leaves behind a marker beacon to help you remember where you've been. Pressing it again on one will retrieve it. The arrow keys will pan the camera, letting you look farther ahead. Holding shift while doing so makes the camera pan faster. It'll automatically pan back to the player when you're done. But be careful, Mazerunners can still get you while you're looking ahead!

There's still some debug keys: number keys to play sound effects, N to toggle no-clipping, and holding shift while moving lets you move faster, although technically you might find it useful as a gameplay feature as well.

There are a couple of bugs that I'm aware of:
- Occasionally scrolling will cause graphical artifacts from sprites to remain on the screen
- Walking diagonally in some directions results in you not being able to place a marker at the same time, due to the way the keyboard matrix is designed I guess

It runs in 320x200x256, "mode Y" (aka unchained mode), with double-buffering. Plain old PC speaker sound effects. Default DOSBox settings should be able to handle it fine.

I started with an entirely different project (an isometric-style Minecraft-ish game), but that wasn't working out very well performance-wise, so I moved on to a proper tile engine. I'd read about John Carmack's work on the original Commander Keen before, so it was fun to finally trying to implement something like that myself. I found myself against a wall many times in terms of performance, and ended up converting various code into assembly loops to get the speeds I needed. I also had to split the rendering across two frames: the first handles scrolling, and the second handles sprites, making the game technically run at 35fps instead of the 70hz refresh rate of that video mode.

This was written using a dev environment of Notepad++, OpenWatcom, DOSBox, Paint Shop Pro 7 (yes, that old!), Tiled, and a couple of custom utils I wrote during this to convert PNGs and maps to C headers.

Source is included for you to peruse, but mind you that it's a total mess, due to switching game ideas, as well as having no real idea of what the game would be until the last few days, which resulted in lots of hacks for features and bugfixes.
Found a bug?
Tell us on Discord