{"id":25992907,"url":"https://github.com/kuberwastaken/backdooms","last_synced_at":"2026-03-11T14:15:53.715Z","repository":{"id":277212651,"uuid":"931517011","full_name":"Kuberwastaken/backdooms","owner":"Kuberwastaken","description":"A self-contained game that fits inside a QR code inspired by DOOM 1993 and The Backrooms","archived":false,"fork":false,"pushed_at":"2025-04-21T08:34:33.000Z","size":20691,"stargazers_count":410,"open_issues_count":3,"forks_count":17,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-26T10:02:44.744Z","etag":null,"topics":["doom","game","minification","qrcode","thebackrooms"],"latest_commit_sha":null,"homepage":"https://kuberwastaken.github.io/backdooms/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kuberwastaken.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-12T12:13:21.000Z","updated_at":"2025-04-26T10:00:56.000Z","dependencies_parsed_at":"2025-02-12T19:21:52.010Z","dependency_job_id":"cd68d9ea-5e97-42ea-b5b2-b8fc869d8705","html_url":"https://github.com/Kuberwastaken/backdooms","commit_stats":null,"previous_names":["kuberwastaken/backdooms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kuberwastaken/backdooms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuberwastaken%2Fbackdooms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuberwastaken%2Fbackdooms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuberwastaken%2Fbackdooms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuberwastaken%2Fbackdooms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kuberwastaken","download_url":"https://codeload.github.com/Kuberwastaken/backdooms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuberwastaken%2Fbackdooms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30383529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doom","game","minification","qrcode","thebackrooms"],"created_at":"2025-03-05T14:31:38.644Z","updated_at":"2026-03-11T14:15:53.709Z","avatar_url":"https://github.com/Kuberwastaken.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eThe Backdooms: Running DOOM on a QR Code\u003c/h1\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"qrcode.png\" alt=\"QR Code for The Backdooms\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\" style=\"font-size: small; font-weight: lighter;\"\u003e\n    Yes, this is literally the entire game. You can \u003ca href=\"https://scanqr.org/\"\u003escan it\u003c/a\u003e to play.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/static/v1?label=Kuberwastaken\u0026message=Backdooms\u0026color=black\u0026logo=github\" alt=\"Kuberwastaken - Backdooms\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/version-13.0-black\" alt=\"Version 13.0\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/License-MIT-black\" alt=\"License MIT\"\u003e\n\u003c/p\u003e\n\n## 🚀 Project Overview\n\n**The Backdooms** is a compressed, self-extracting and infinitely generating HTML game inspired by DOOM 1993 and The Backrooms that can be launched and played in a web browser directly from a QR code.\n\nThis project was a week-long study I performed (now slightly longer) designed to push the limits of QR code storage and compression, to demonstrate an innovative method of hosting lightweight web applications entirely within a QR code.\n\n---\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://kuberwastaken.github.io/backdooms\"\u003ePlay a slightly less compressed version of this game here\u003c/a\u003e\n    \u003cbr style=\"font-size: small; font-weight: lighter;\"\u003e\n    \u003cspan style=\"font-weight: lighter;\"\u003eYes, it's 8bit Undertale Music There\u003c/span\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://cdn.jsdelivr.net/gh/kuberwastaken/backdooms/public/Gameplay-GIF.gif\" alt=\"Gameplay Demo\"\u003e\n\u003c/p\u003e\n\n---\n\n## 📜 Features\n\n✅ **Fully Offline:** No internet connection is required to play the game after scanning the QR code. The URL basically has the ENTIRE code to the game\n\n✅ **Extreme Compression:** Utilizes a combination of Zlib compression with Gzip Decompression stream along with base64 encoding to make the final result extremely compressed.\n\n✅ **Self-Extracting Webpage:** Uses the `DecompressionStream` API to dynamically decompress and execute the game within the browser.\n\n✅ **Mobile Compatible:** Works on modern mobile browsers that support the Decompressionstream APIs (Edge, Yandex, Opera) `[NEW]`\n\n## 📦 Installation \u0026 Dependencies\n\nWell, technically speaking, just a modern web browser.\n\n But if we do get into the nitty gritty of generating a QR code of a ≈ 2.5kb game:\n\n### Prerequisites\n- **Python 3.7+**\n- `qrcode` library (for generating QR codes)\n- `pillow` (for QR code image handling)\n\n### Install Dependencies\n```bash\npip install qrcode[pil]\n```\n\n---\n\n## 🛠️ Usage\n\n### 1️⃣ Convert Your Game to a QR Code\nRun the script with the following command:\n```bash\npython3 QRGEN.py \u003cyour-game.html\u003e \u003coutput-qrcode.png\u003e\n```\nExample:\n```bash\npython3 QRGEN.py EVEN-SMALLER-SLAMMER-BACKROOMS.html qrcode.png\n```\n\n\u003e **Note:** An alternative implementation using BigInt instead of Base64 for even smaller QR codes is available at [The BigInt Branch](https://github.com/Kuberwastaken/backdooms/tree/BigInt), though it has limited mobile browser compatibility.\n\n\n### 2️⃣ Scan the QR Code\nUse a smartphone or QR scanner to open the game directly in a web browser.\n\n### 3️⃣ Play Instantly 🎮\nEnjoy *The Backdooms* without needing to download or install anything!\n\n---\n\n## 🔍 Technical Breakdown\n\n### Compression Workflow\n```mermaid\nflowchart TD\n    A[Read Input HTML] --\u003e B[Compress with Zlib]\n    B --\u003e|wbits=15| C[Base64 Encode]\n    C --\u003e D[Embed in HTML Wrapper]\n    \n    subgraph browser[Browser Processing]\n        D --\u003e E[DecompressionStream 'gzip']\n        E --\u003e F{Format Mismatch}\n    end\n    \n    F --\u003e G[Convert to Data URI]\n    G --\u003e H{Fits QR Code?}\n    H --\u003e|Yes| I[Generate QR]\n    H --\u003e|No| J[Reduce HTML Size]\n    J --\u003e A\n```    \n\n**Read Input HTML:** The process starts by reading the given HTML content from a file or input source.\n\n**Zlib Compression + GZip decompression:** The HTML is compressed using Zlib and uses Decompressionstream from GZip for best compression\n\n**Base64 Encoding:** The compressed data is encoded in Base64, ensuring that it remains text-based and can be embedded in an HTML file safely.\n\n**Embedding in HTML Wrapper:** A JavaScript-based self-extracting HTML wrapper is created. This wrapper includes a DecompressionStream API function that automatically decompresses the content when opened in a browser.\n\n**Data URI Conversion:** The entire HTML is converted into a data:text/html;base64,... format, allowing it to be stored and shared easily without a physical file.\n\n### QR Code Generation Logic\n\nThe system first tries to generate the smallest possible QR version using qr.make(fit=True), which dynamically adjusts the QR size based on content length.\n\nIf the required version exceeds 40 (the QR code standard limit), it forces version 40 with fit=False.\n\nThe lowest error correction level L (which allows the maximum data capacity) is used to fit as much data as possible.\n\nIf the data is still too large for QR v40 with level L, the process fails, and an error is returned.\n\n### Outcome\n\nIf successful, a QR code is generated and displayed.\n\nIf not, the process terminates with an error message indicating that the data is too large to be encoded in a QR code.\n\n---\n## Understand the Frustration and Trial and Error\nRead about the development journey on my blog [MindDump](https://kuberwastaken.github.io/blog/Projects/How-I-Managed-To-Get-Doom-In-A-QR-Code)\n\n---\n\n## 📜 License\nThis project is released under the **MIT License**—free to use, modify, and share.\nIt would make me EXTREMELY happy to see other QR games or even seeing better versions of DOOM in a QR code, given there's so little resources related to this\n\n---\n\n## 🙌 Credits\n-  id Software for Developing DOOM\n- matttkc for putting this idea in my head 5 years ago\n- Toby Fox for the amazing music in Undertale, this game's GitHub hosted version uses an 8 bit version of Bonetrousle\n- The amazing contributers that continue to make backdooms even more insane\n\n Developed by **Kuber Mehta** :)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuberwastaken%2Fbackdooms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuberwastaken%2Fbackdooms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuberwastaken%2Fbackdooms/lists"}