A screenshot of the world's first 64kB boomer shooter

QUOD Is A Quake-Like In Only 64kB

The demoscene is still alive and well, and the proof is in this truly awe-inspiring game demo by [daivuk] : a Quake-like “boomer shooter” squeezed into a Windows executable of only 64 kB he calls “QUOD”. We’ve included the full explanation video below, but before you check out all the technical details, consider playing the game. It’ll make his explanations even more impressive.

OK, what’s so impressive? Well, aside from the fact that this is a playable 3D shooter in 64kB, with multiple enemies, multiple levels, oodles of textures, running, jumping et cetera–it’s so Quake-like he’s using TrenchBroom to make the levels. Of course he’s reprocessing them into a more space-efficient, optimized format. Yeah, unlike the famous .kkrieger and a lot of other demos in the 64kB space, this isn’t all procedurally generated. [daivuk] did make his own image editing program for procedurally generated textures, though. Which makes sense: as a PNG, the QUOD logo is probably half the size of the (compressed) executable.

The low-poly models are created in Blender, and all created to be symmetric–having the engine mirror the meshes saves 50% of the vertex data. . Blender is just exporting half of a low-poly mesh; just as he wrote his own image editor, he has his own bespoke model tool. This allows tiling model elements, as well as handling bones and poses to keyframe the model’s animation.

Audio is treated similarly to textures and meshes: built up at runtime from stored data and a layered series of effects. When you realize all the sounds were put together in his sound tool from square and sine waves, it makes it very impressive. He’s also got an old-style tracker to create the music. All of these tools output byte arrays that get embedded directly in the game code.

The video also gets into some of his optimization techniques; we like his use of a map file and analyzing it with a python tool to find the exact size of game elements and test his optimizations thereby. One thing he notes is that his optmizations are all for space, not for speed. Except, perhaps, for one thing: [daivuk] created a new language and virtual machine for the game, which seems downright extravagant. It actually makes sense, though, as the virtual machine can be optimized for the limits of the game, as he explains starting at about 20 minutes into the video. Apparently it saved a whole 2kB, which seems like nothing these days but actually let [daivuk] fit an extra level into his 64kB limit. Sure, it’s still bigger than Quake13k–and how did we never cover that?–but you get a lot more game, too.

So, to recap: [daivuk] didn’t just make a game with an impressively tiny size on disk, he made the entire toolchain, and a language for it to boot. If you think this is overoptimized, check out Wolfenstien in 600 lines of AWK. Of course in spite of the 1980s file size, this needs modern hardware to run. You can get surprising graphics performance from a fraction of that, like this ATtiny sprite engine.

Thanks to [Keith Olson] for the tip, which probably took up more than 64kB on our tips line.

Continue reading “QUOD Is A Quake-Like In Only 64kB”

What Game Should Replace Doom As The Meme Port Of Choice?

DOOM. The first-person shooter was an instant hit upon its mrelease at the end of 1993. It was soon ported off the PC platform to a number of consoles with varying success. Fast forward a few years, and it became a meme. People were porting Doom to everything from thermostats to car stereos and even inside Microsoft Word itself.

The problem is that porting Doom has kind of jumped the shark at this point. Just about every modern microcontroller or piece of consumer electronics these days has enough grunt to run a simple faux-3D game engine from 1993. It’s been done very much to death at this point. The time has come for a new meme port!

Good Game

Doom became a popular meme port for multiple reasons. For one, it’s just complex and resource-intensive enough to present a challenge, without being so demanding as to make ports impractical or impossible. It’s also been open-source for decades, and the engine has been hacked to death. It’s probably one of the best understood game engines out there at this point. On top of that, everybody plays Doom at some point, and it was one of the biggest games of the 90s. Put all that together, and you’ve got the perfect meme port.

However, you can always have too much of a good thing. Just as The Simpsons got old after season 10 and Wonderwall is the worst song you could play at a party, Doom ports have been overdone. But what other options are there? Continue reading “What Game Should Replace Doom As The Meme Port Of Choice?”

Quake In 276 KB Of RAM

Porting the original DOOM to various pieces of esoteric hardware is a rite of passage in some software circles. But in the modern world, we can get better performance than the 386 processor required to run the 1993 shooter for the cost of a dinner at a nice restaurant — with plenty of other embedded systems blowing these original minimum system requirements out of the water.

For a much tougher challenge, a group from Silicon Labs decided to port DOOM‘s successor, Quake, to the Arduino Nano Matter Board platform instead even though this platform has some pretty significant limitations for a game as advanced as Quake.

To begin work on the memory problem, the group began with a port of Quake originally designed for Windows, allowing them to use a modern Windows machine to whittle down the memory usage before moving over to hardware. They do have a flash memory module available as well, but there’s a speed penalty with this type of memory. To improve speed they did what any true gamer would do with their system: overclock the processor. This got them to around 10 frames per second, which is playable, but not particularly enjoyable. The further optimizations to improve the FPS required a much deeper dive which included generating lookup tables instead of relying on computation, optimizing some of the original C programming, coding some functions in assembly, and only refreshing certain sections of the screen when needed.

On a technical level, Quake was a dramatic improvement over DOOM, allowing for things like real-time 3D rendering, polygonal models instead of sprites, and much more intricate level design. As a result, ports of this game tend to rely on much more powerful processors than DOOM ports and this team shows real mastery of their hardware to pull off a build with a system with these limitations. Other Quake ports we’ve seen like this one running on an iPod Classic require a similar level of knowledge of the code and the ability to use assembly language to make optimizations.

Thanks to [Nicola] for the tip!

ZX Spectrum Gets A 3D FPS Engine

The Sony PlayStation and Nintendo 64 are well-known for bringing 3D gaming into the mainstream in a way that preceding consoles just couldn’t. The ZX Spectrum, on the other hand, is known for text adventures and barebones graphics. However, it now has a rudimentary version of a Quake-like engine, as demonstrated by [Modern ZX-Retro Gaming].

As you might expect, the basic ZX Spectrum that sat in front of your dodgy old TV in the 1980s isn’t really up to the task of running a full 3D game. The engine runs at a fairly jerky frame rate on a 3.5 MHz ZX Spectrum, with purely monochrome graphics. However, the game can run more smoothly on 7, 14, and 28MHz ZX Spectrum compatibles. As with many such projects, most of the video you’ll see is of the game running in emulators. Impressively, the game features sound effects, three weapons, and a standard WASD control layout as per modern FPS games.

If you’re wondering about the confusing visuals, there’s a simple explanation. Yes, the UI and weapons are straight out of Doom. However, the game is running on a true 3D engine, with 3D enemies, not sprites. It’s inspired by the full 3D engine pioneered by Quake, hence the designation.

Files are available for those wishing to try it out at home. We do see a fair bit of the ZX Spectrum around these parts. Video after the break.

Continue reading “ZX Spectrum Gets A 3D FPS Engine”

Quake 2 Ported To Apple Watch

DOOM always seems to spontaneously appear on any new device the day it’s released. From printers to industrial robots to pregnancy tests, it always makes its way on anything with an integrated circuit and a screen. But that’s not the only 90s video game with a cult following and and ability to run on hardware never intended for gaming. The early Quake games are still remarkably popular, and the second installment of this series was recently brought to the Apple Watch thanks to [ByteOverlord].

Building this classic for the Apple Watch requires using the original Quake files and some work with Xcode to get a package together that will run on the wrist-bound computer. There are a few other minimum system requirements to meet as well, but with all of that out of the way the latest release runs fairly well on this small watch. The controls have been significantly modified to use the Apple’s touch screen and digital crown instead of any peripherals, and as a result it’s not likely you’d win any matches if it was possible to cross-play with PC users with a setup like this, but it’s definitely playable although still missing a few features compared to the PC version.

This actually isn’t the first Quake game to be ported to the Apple Watch, either. The first version of Quake ran on this device thanks to [MyOwnClone]’s efforts a little over a year ago. It’s also not the first time we’ve seen Quake running on unusual Apple hardware, either. Take a look at this project which uses one of the early iPods to play this game, along with the scroll wheel for a one-of-a-kind controller.

Thanks to [Joni] for the tip!

Adding Portals To Quake

For those who have played Quake extensively, adding portals seems unnecessary, as teleporters are already a core part of the game mechanics. What [Matthew Earl] accomplishes is more of the Portal style of portal by rendering what is on the other side of the portal with a seamless teleportation transition.

Of course, Quake is an old game with a software renderer. Just throwing another camera into the scene, rendering to another texture, and then mapping that texture to the scene isn’t an option. Quake uses an edge rasterizer and generates spans along scanlines that track where edges intersect the current scanline. Rather than making expensive per-pixel comparisons, [Matt] stashes the portal spans and renders them in a second render, so even with multiple portals, only a single screen’s worth of pixels are rendered.

However, this technique has no near clipping plane, which means objects can appear in the portal that don’t make any sense as they are in front of the portal’s viewpoint. Luckily, Quake has an ingenious method for polygon occlusion: the BSP. While [Matt] is manually checking polygons, the BSP is the perfect tool for bisecting a room along a plane. It’s an incredible hack, and we’re excited to see Quake expand into a puzzle game. [Matt] dives into greater detail on how the software renderer works in another video that’s well worth a watch.

Perhaps the most incredible aspect of this technique is that it could run on original hardware. If you want to bring a little more Quake to life, why not get the Quake light flicker in your house? Video after the break.

Continue reading “Adding Portals To Quake”

Bringing The Quake Flicker To Life With A Hacked Light

If you ever feel a pang of shame because you’ve been reusing the same snippets of code in your projects for years, don’t. Even the big names do it, as evidenced by the fact that code written to govern flickering lights back in 1996 for Quake is still being used in AAA titles like 2020’s Half-Life: Alyx. In honor of this iconic example of digital buck-passing, [Rodrigo Feliciano] thought he’d port the code in question over to the Arduino and recreate the effect in real-life.

Since the Quake engine has been released under the GPLv2, it’s easy to pull up the relevant section of the code to see how the lighting was configured. Interestingly, lighting patterns were implemented as strings, where the letters from a to z referenced how bright the light should appear. So for example, a strobe light that goes between minimum and maximum brightness would be written as “aaaaaaaazzzzzzzz”, while a flickering light could be represented with the string nmonqnmomnmomomno“.

An emergency light provided the LEDs and enclosure.

This ended up being very easy to implement on the Arduino in just a few lines, as [Rodrigo] simply had to assign each letter in the string a numerical value between 0 and 255 using map, and then use the resulting number to set the LED brightness with analogWrite.

With the code written, [Rodrigo] then had to put the hardware together. He stripped down a basic emergency light to get an array of white LEDs and a handy enclosure. He also wired up a simple transistor circuit on a scrap of perfboard so the Arduino Pro Mini could control all the LEDs from a single GPIO pin. Combined with a long USB cable to power it, and he’s got a perfect desk accessory for late-night gaming sessions.

In the video below you can see the final result, which [Rodrigo] has even synced up to footage from the classic 1996 shooter. The light makes for an interesting conversation piece, but we think the logical next step is to work this technique into an ambilight-like system to really make it feel like you’re wandering down those dimly lit corridors.

Continue reading “Bringing The Quake Flicker To Life With A Hacked Light”