logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·03.11.26
← Back to news

Quake in 13 Kilobytes (2021)

Original article
js13kgames.com|123 points|18 comments|by mortenjorck|Jun 26, 2026

Quake in 13 Kilobytes (2021)

🕹️ Q1K3 | js13kGames 2021

The js13kGames competition is a grueling test of efficiency, challenging developers to create a fully functional game within a strict limit of 13 kilobytes (zipped). In 2021, the project Q1K3 attempted something seemingly impossible: recreating the essence of a 3D first-person shooter—inspired by Quake—within that minuscule footprint.

🛠️ The Engineering Challenge

Fitting a 3D engine into 13,312 bytes requires more than just minification; it requires a fundamental rethink of how game assets and logic are handled. The developer had to move away from traditional asset loading and toward procedural generation.

"The goal wasn't to port the actual Quake engine, but to evoke the feeling of 90s 3D gaming while fighting a war against every single byte of the budget."

Development Roadmap

  • Implement basic 3D projection math.
  • Create a procedural map generator.
  • Develop a lightweight rasterizer.
  • Optimize collision detection.
  • Include high-resolution textures →\rightarrow→ Replaced with procedural noise.

📐 The Technical Architecture

To achieve a 3D effect without the overhead of massive libraries like Three.js, Q1K3 relies on a custom rendering pipeline.

The Rendering Pipeline

The Mathematics of Projection

The engine transforms 3D world coordinates (x,y,z)(x, y, z)(x,y,z) into 2D screen coordinates (x′,y′)(x', y')(x′,y′) using a basic perspective projection formula:

x′=x⋅fz,y′=y⋅fzx' = \frac{x \cdot f}{z}, \quad y' = \frac{y \cdot f}{z}x′=zx⋅f​,y′=zy⋅f​

Where fff represents the focal length of the virtual camera. This ensures that objects further away (larger zzz) appear smaller on the screen.


📦 Optimization Strategies

The project utilizes several "tricks" to keep the file size under the limit:

TechniqueDescriptionImpact
MinificationUsing tools like Terser to strip whitespace and shorten variables.High
ProceduralismGenerating textures and levels via algorithms instead of files.Critical
Typed ArraysUsing Uint8Array for efficient memory management.Medium
Brotli/GzipLeveraging heavy compression for the final delivery.High

Example: Asset Compression

Instead of storing a .png for a wall, the engine uses a small function to generate a "stony" texture on the fly:

function generateWallTexture() {
  const canvas = document.createElement('canvas');
  // ... procedural noise logic ...
  return canvas.getContext('2d').getImageData(0, 0, 64, 64);
}

🎮 Gameplay and Experience

Despite the constraints, Q1K3 delivers a surprisingly cohesive experience. The player navigates a claustrophobic, industrial environment that mirrors the Gothic architecture of the original Quake.

Key Features include:

  • Fluid Movement: Standard WASD controls with a simulated "bob" to mimic walking.
  • Combat: A basic weapon system that utilizes Math.random() for spread.
  • Atmosphere: A limited color palette to simulate the dark, moody lighting of the 1996 classic.

Conceptual Screenshot of Q1K3

🏁 Final Verdict

Q1K3 stands as a testament to the power of creative constraint. By stripping away the bloat of modern game development and returning to the raw mathematics of the 90s, the project proves that immersion is not a product of file size, but of clever engineering.