blog · git · desktop · images · contact


Pooliard and Squayce

2024-01-07

I’ve spent the last remaining days of my vacation making two DOS games.

Pooliard, a 2D pool billiards game:

pooliard.jpg

And Squayce, a 3D racing game:

squayce.jpg

You can find precompiled binaries and some videos of both games over here:

Both are released as free software under the “MIT” license (see LICENSE file in the repos for details):

I have tested them on DOSBox 0.74 and on a real installation of MS-DOS 6.22 on my retro machine (Pentium 133). They run in Real Mode and use VGA Mode 13h.

Both games are currently at “version 0.9”. They are very young, obviously, and have never been tested on any machines other than my own. Maybe they break horribly for you. Patches welcome.

Pooliard

This was the first one I made, very soon after Advent of Code ended. There was some code from my AoC visualizations that I was able to re-use. Also, the physics in the game were copied from an earlier simulation that I made in 2015.

Since aiming the cue ball isn’t particularly easy with this low resolution, I added a zoom mode.

I spent quite some time trying to figure out how to get high resolution timestamps – that’s required for the physics stuff. DOS/BIOS only gives you a very coarse clock (~55 ms resolution). I then dug through the following tutorial:

https://www.xtof.info/Timing-on-PC-familly-under-DOS.html

I ended up with sub-microsecond timestamps, quite good. Only problem is, this only works on native MS-DOS (and DOSBox). It breaks when run under Windows 3.11, for example. I have yet to figure out how to do this properly (probably missed something in the tutorial), but for the time being, it’s good enough.

Squayce

This one is more elaborate. It uses raycasting as explained in this tutorial:

https://lodev.org/cgtutor/raycasting.html

I found it a bit hard to understand at times, so, while working through the tutorial, I took notes in a LaTeX/TikZ document. The resulting PDF is available as doc.pdf alongside the game’s ZIP file. It’s written in German, though, because this file is more like my personal set of notes, and I didn’t want anything to get lost in translation.

The following tutorial by “LateBlt”, which talks about how to process keyboard input, was also really helpful:

https://www.youtube.com/watch?v=YsQG1Sr91z0

Squayce uses procedurally generated levels, like Worms did back in the day. I like this concept very much and have used it in earlier games as well.

To get acceptable performance on my retro box (~35-40 fps – I’ve configured my DOSBox to be a little bit slower than that), some parts of this game had to be written in assembly. This has been suggested to me on Mastodon. That was quite the surprise to me, because, in my experience, you usually can’t beat the output of modern C compilers (if anything, you make it worse). Not so this time.

Speaking of Mastodon, a lot of interesting material has been suggested as well:

I haven’t had the chance yet do read through all of this.

The cool thing about Squayce: I already find myself practicing on certain tracks and trying to beat my previous times. The game works. This might be something that I’ll actually play every now and then.

Where to go from here?

As I said, my vacation is over now. I won’t have the time or energy anymore to really work on this stuff for a while. Things will slow down considerably now.

Still, I plan on keeping them alive. Especially Squayce has a couple of interesting items in its TODO list: The most intriguing one being sound. What’s a racing game without sound?

DOS is a fascinating platform – I’ll probably put up another blog post explaining why I think so. And the feeling of seeing my games run on my retro PC is … unique. I’ll definitely keep exploring this.

Comments?