←back to thread

531 points kuberwastaken | 1 comments | | HN request time: 0.768s | source

I sometimes pick up random projects just because I can, this was one of those times. I made it as a week long project a while back this year but never shared here, so thought to go for it haha.

I created a game inspired by Doom and the backrooms called The Backdooms under 2.4kb in minified html. (for reference, this entire post would be around 1.8kB haha) I had to use a not popular way of using GZip with Zlib headers (had to write my own script for compressing it, also in the repo) to eventually convert it a size 40 QR code that works right in your browser using Decompressionstream API.

This is of course a very oversimplified description of it, using a lot of the same technologies that DOOM had but combining it with infinite seed based map generation in 2.4kb (QR codes can only store 3kb, which includes changing formats) was pretty hard.

Here are some links about it if you want to nerd out and read more:

Repository Link (MIT License): https://github.com/Kuberwastaken/backdooms

A Hosted (slightly improved) version of The Backdooms: https://kuberwastaken.github.io/backdooms/

Game Trailer: https://www.youtube.com/shorts/QWPr10cAuGc

My Linkedin post about it: https://www.linkedin.com/feed/update/urn:li:activity:7295667...

(PS: You'd need something like https://qrscanner.org/ or something that can scan bigger QR codes and put the text data onto your browser to play it)

My Blogs documenting the process and development in detail:

https://kuberwastaken.github.io/blog/Projects/How-I-Managed-... https://kuberwastaken.github.io/blog/Projects/How-I-Managed-...

Show context
cosignal ◴[] No.43733860[source]
Pardon my dumb query, as I'm a tech novice, but aren't QR just encodings of data? And the max amount of data a QR can encode is like 3kb, which would roughly correspond to 3000 or so plaintext characters. So the achievement here is that this Doom-like game can be run from an executable roughly of that size?
replies(1): >>43734015 #
matheusmoreira ◴[] No.43734015[source]
QR codes have various encoding modes: numeric, alphanumeric, 8 bit and kanji. The most common is alphanumeric encoding and the densest is 8 bit encoding which just stores binary data.

The QR code standards seem to be a little ambiguous on the meaning and purpose of the 8 bit encoding. I got the impression they added it to support alternative character encodings. Still, it's a mode that "represents an 8-bit byte value directly".

> The default interpretation for QR Code is ECI 000020 representing the JIS8 and Shift JIS character sets.

> 8.3.4 8-bit Byte Mode

> The 8-bit byte mode handles the 8-bit Latin/Kana character set in accordance with JIS X 0201 (character values 00HEX to FFHEX).

> In this mode data is encoded at a density of 8 bits/character.

> 8.4.4 8-bit Byte Mode

> In this mode, one 8 bit codeword directly represents the JIS8 character value of the input data character as shown in Table 6, i.e. a density of 8 bits/character.

> In ECIs other than the default ECI, it represents an 8-bit byte value directly.

In any case, it is possible to use QR codes to store arbitrary binary data. The qrencode tool can do this natively. Decoder support is more tricky, they tend to assume all QR codes contain text. I had to send patches to zbar to help it decode QR codes with binary data in them because it was passing the data through iconv and mangling the output. I also had to add options to the zbar tools to make them decode exactly one QR code

I just wanted to print out 4096 bit RSA secret keys as QR codes. People started QR encoding video games pretty soon after. It's awesome.

https://youtu.be/ExwqNreocpg

https://news.ycombinator.com/item?id=24287347

replies(1): >>43779218 #
1. cosignal ◴[] No.43779218[source]
Interesting, thanks for the reply!