GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Gallery
  • Resources
  • About

This view

  • Original page
  • New address

GeezerVison is showing 64k-scene.github.io — 64k Scene | Resources

This page contains technical resources for the people who want to create their own 64k intros, or understand how they are made.

Contents

  • Getting Started
  • Compression
  • Music
  • Texture
  • Meshes
  • Ray Marching
  • Making-ofs

Getting Started

Community

There are multiple ways to join the 64k scene community, but one starting point can be the dedicated 4k-64k channel on the Sizecoding Discord server.

There, you can share tips, ask questions and get acquainted with other creators.

Setup

Not all programming languages are suitable for creating 64k intros. It's important to check that you can create small executable files, and you'll often need to adjust the compiler options. The most common languages are C++, Rust, and Javascript.

These links can help you get started:

  • 64k-starter is a good starting point for writing a 64k intro in Rust.
  • Demo-Framework-64k or Ctrl-Alt-Test demo engine can be used as a template for intros in C++.
  • Creating a tiny Windows executable explains how to get Visual Studio to compile a minimal working executable.

Compression

Windows executable packers

There are two main alternatives to compress native binaries on Windows: kkrunchy and squishy.

kkrunchy

kkrunchy was written by Farbrausch and has been the de facto executable compression tool for 64k intros since its release in 2006. It is simple to use, fast and efficient, but gives little debugging information (Revival and BoyC have written a version giving more detail, which they've dubbed rekkrunchy). Note that the generated binaries are generally flagged as malware by antivirus vendors.

KKP Analyzer is a tool from Conspiracy meant to help understanding how code and data impacts the final binary size, by analysing and visualising the compression information provided by kkrunchy. It requires using rekkrunchy, as the information report generated by the original kkrunchy is incomplete.

At a glance
  • Windows 32 bits
  • kkrunchy project page and source code
  • rekkrunchy project page and source code
  • KKP Analyzer project page and source code
  • Article: x86 code compression in kkrunchy

squishy

squishy is a recent and modern alternative to kkrunchy, written by Logicoma. It generally gets better results than kkrunchy in terms of final size (see the metrics), but is also significantly slower, so it offers a different tradeoff.

At a glance
  • Windows 32 bits and 64 bits
  • Currently the best compression
  • squishy project page
  • squishy / kkrunchy comparison
  • Revision 2020 seminar: modern 64k intro compression
  • Blog post with some details about squishy

Crinkler

While Crinkler is the de facto executable compression tool for 4k and 8k intros, its use for sizes like 32k and 64k is not recommended.

At a glance
  • For 1k, 4k, 8k, but not for 64k
  • Crinkler project page and source code

Javascript

The two most common tools for packing Javascript are:

  • JsExe
  • pnginator.rb

Shader minification

Shader Minifier

Shader Minifier written by Ctrl-Alt-Test and is the de facto shader minification tool. It rewrites shader source code in a way that uses a smaller footprint and compresses well, and options are exposed to choose the transformations to apply. Note that it can be more difficult to use efficiently with multiple shaders.

At a glance
  • GLSL and HLSL
  • Shader Minifier project page and source code
  • Revision 2023 seminar: Shader minification for 4k - 64k intros

Tips

Compression changes how we need to think about size coding. Reducing the size of the compiler output doesn't mean the compressed file will be smaller. If you're short on space, we recommend that you check the compressed size regularly to avoid surprises (e.g. you can include it in the commit messages).

Some techniques can be useful:

  • Group data by type, so that similar things are packed together.
  • Repetitive data doesn't take much space. Sometimes, the smart "Don't Repeat Youself" principle can be counterproductive.
  • Try delta encoding.
  • Make the floats smaller.

You may also read Why are SMF files smaller? about packing the music data.

Music

It's common for the music to take around 16kB, but this can vary a lot. Instruments are often generated using sound synthesis, and the list of notes is compressed.

Multiple synths have been published that were specifically designed for 64k intros:

  • 64klang, an extended version of 4klang (a popular synth for 4k intros).
  • WaveSabre, used in Logicoma intros and many others.
  • Tunefish, used in Brain Control intros.
  • v2 was a popular option around 2005-2015. It uses less CPU than the alternatives above, but it can feel slightly outdated.

Texture

Procedural texture generation can be done either on the CPU or on the GPU. The article GPU Based Texture Synthesis discusses some advantages of using the GPU. Generating textures on the CPU can be slow, so you'll probably want to use multiple threads.

General introduction to texture generation:

  • Intro to Procedural Textures
  • Texturing in a 64kB intro, an overview of the texture generation in H – Immersion.

Voronoi

Voronoi diagrams are a simple tool for procedural generation and can be used in a variety of ways:

  • Cellular Noise, a good overview of the Voronoi algorithm, from the Book of Shaders.
  • To Voronoi and Beyond, another introduction that also discusses other applications.
  • Inigo Quilez wrote multiple articles: voronoi effect, smooth voronoi, voronoi edges, and voronoise.
  • How to generate cellular textures discusses the implementation and optimizations.

Meshes

Some techniques that can be useful for including meshes in a 64k intro:

  • Mesh compression
  • The catmull clark subdivision algorithm is useful to generate smooth surfaces from a low-poly mesh (see this presentation for a code sample).
  • Marching cubes can be used to convert a signed distance function into a traditional mesh.
  • L-Systems are a simple way to generate recursive objects, such as trees.

You may also check:

  • Qoob a tiny modeling tool that can be used as an inspiration.
  • The series of articles about Debris also contains information about mesh generation.
  • The article Procedural 3D mesh generation in a 64kB intro.
  • The mesh generation source code in apEx, the demomaking tool used by Conspiracy intros.

Ray Marching

Raymarching is a rendering technique that is extremely popular among 4k intros developers and the ShaderToy community. It is also commonly used for 64k intros.

  • Ray Marching and Signed Distance Functions is a good introduction.
  • Many articles from Inigo Quilez discuss raymarching.
    • In particular, see the distance functions page.
  • The Mercury SDF toolbox provides another set of common SDF.

Making-ofs

  • Atlas 64k Graphics Breakdown - Demoscene Stream, 2019
  • A dive into the making of Immersion, 2018
  • How a 64k intro is made, 2017
  • Making-of “Turtles all the way down”, 2013
  • Making of Gaia Machina, 2012
  • Behind Incubation, 2010
  • Tricks and techniques for rgba's past and future intros, 2007

Not stricly a making of, Debris: Opening the box is a great series of highly technical articles from 2010 to 2012, about the design decisions behind the engine and the tools written for the mid 2000s Farbrausch intros.

Moreover, Conspiracy has released the source code of apEx, the demomaking tool they used for their intros between 2014 and 2023, as well as the projects for those intros.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.