-
Notifications
You must be signed in to change notification settings - Fork 2
/
resources.html
289 lines (250 loc) · 15.8 KB
/
resources.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="64k Scene"/>
<meta property="og:description" content="A list of resources and tips to create 64k intros: realtime computer animations in less than 64kB" />
<title>64k Scene | Resources</title>
<link rel="stylesheet" href="style.css">
<header>
<nav>
<a href="index.html">Gallery</a>
<a href="resources.html">Resources</a>
<a href="about.html">About</a>
</nav>
</header>
<section>
<div class="card intro">
<p>This page contains technical resources for the people who want to create their own 64k intros, or understand how
they are made.
</p>
<h2>Contents</h2>
<ul>
<li><a href="#getting-started">Getting Started</a>
<li><a href="#compression">Compression</a>
<li><a href="#music">Music</a>
<li><a href="#texture">Texture</a>
<li><a href="#meshes">Meshes</a>
<li><a href="#ray-marching">Ray Marching</a>
<li><a href="#making-ofs">Making-ofs</a>
</ul>
</div>
<div class="card">
<h2 id="getting-started">Getting Started</h2>
<h3>Community</h3>
<p>
There are multiple ways to join the 64k scene community, but one starting point can be the dedicated <strong>4k-64k</strong> channel on the <strong><a href="https://discord.gg/pZE5rAQrHx">Sizecoding Discord server</a></strong>.
</p>
<p>
There, you can share tips, ask questions and get acquainted with other creators.
</p>
<h3>Setup</h3>
<p>
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.
</p>
<p>
These links can help you get started:
</p>
<ul>
<li><a href="https://github.com/Kwarf/64k-starter">64k-starter</a> is a good starting point for writing a 64k intro in
Rust.
<li><a href="https://madethisthing.com/iq/Demo-Framework-64k">Demo-Framework-64k</a> can be used a template for intros
in C++.
<li><a href="https://conspiracy.hu/articles/11-creating-a-tiny-windows-executable/">Creating a tiny Windows executable</a> explains how to get Visual Studio to compile a minimal working executable.
</ul>
</div>
<div class="card">
<h2 id="compression">Compression</h2>
<h3>Windows executable packers</h3>
<p>
There are two main alternatives to compress native binaries on Windows: kkrunchy and squishy.
</p>
<h4>kkrunchy</h4>
<p>
<a href="http://www.farbrausch.de/~fg/kkrunchy/">kkrunchy</a> 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 <a href="https://github.com/ConspiracyHu/rekkrunchy-with-analytics">rekkrunchy</a>). Note that the generated binaries are generally flagged as malware by antivirus vendors.
</p>
<p>
<a href="https://github.com/ConspiracyHu/kkpView-public">KKP Analyzer</a> 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 <a href="https://github.com/ConspiracyHu/rekkrunchy-with-analytics">rekkrunchy</a>, as the information report generated by the original kkrunchy is incomplete.
</p>
<div class="links">
<h5>At a glance</h5>
<ul>
<li>Windows 32 bits
<li><a href="http://www.farbrausch.de/~fg/kkrunchy/">kkrunchy project page</a> and <a href="https://github.com/farbrausch/fr_public/tree/master/kkrunchy">source code</a>
<li><a href="https://github.com/ConspiracyHu/rekkrunchy-with-analytics">rekkrunchy project page and source code</a>
<li><a href="https://github.com/ConspiracyHu/kkpView-public">KKP Analyzer project page and source code</a>
<li><a href="https://fgiesen.wordpress.com/2011/01/24/x86-code-compression-in-kkrunchy/">Article: x86 code compression in kkrunchy</a>
</ul>
</div>
<h4>squishy</h4>
<p>
<a href="https://logicoma.io/squishy/">squishy</a> is a recent and modern alternative to kkrunchy, written by Logicoma. It generally gets better results than kkrunchy in terms of final size (<a href="https://docs.google.com/spreadsheets/d/1tbQ7fgnG5DAI06eFoXvkE8fZKnrO4SpYQrrBbsmwdWk/edit?usp=sharing">see the metrics</a>), but is also significantly slower, so it offers a different tradeoff.
</p>
<div class="links">
<h5>At a glance</h5>
<ul>
<li>Windows 32 bits and 64 bits
<li>Currently the best compression
<li><a href="https://logicoma.io/squishy/">squishy project page</a>
<li><a href="https://docs.google.com/spreadsheets/d/1tbQ7fgnG5DAI06eFoXvkE8fZKnrO4SpYQrrBbsmwdWk/edit?usp=sharing">squishy / kkrunchy comparison</a>
<li><a href="https://www.youtube.com/watch?v=O5LfE_qNzes">Revision 2020 seminar: modern 64k intro compression</a>
<li><a href="https://yupferris.github.io/blog/2020/08/31/c64-4k-intro-packer-deep-dive.html#squishys-decompressor-compressor">Blog post with some details about squishy</a>
</ul>
</div>
<h4>Crinkler</h4>
<p>
While <a href="https://github.com/runestubbe/Crinkler">Crinkler</a> is the de facto executable compression tool for 4k and 8k intros, its use for sizes like 32k and 64k is not recommended.
</p>
<div class="links">
<h5>At a glance</h5>
<ul>
<li>For 1k, 4k, 8k, but not for 64k
<li><a href="https://github.com/runestubbe/Crinkler">Crinkler project page and source code</a>
</ul>
</div>
<h3>Javascript</h3>
<p>The two most common tools for packing Javascript are:</p>
<ul>
<li><a href="https://www.pouet.net/prod.php?which=59298">JsExe</a>
<li><a href="https://gist.github.com/gasman/2560551">pnginator.rb</a>
</ul>
<h3>Shader minification</h3>
<h4>Shader Minifier</h4>
<p>
<a href="https://github.com/laurentlb/Shader_Minifier">Shader Minifier</a> 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.
</p>
<div class="links">
<h5>At a glance</h5>
<ul>
<li>GLSL and HLSL
<li><a href="https://github.com/laurentlb/Shader_Minifier">Shader Minifier project page and source code</a>
<li><a href="https://www.youtube.com/watch?v=S-VDVgCBy-M">Revision 2023 seminar: Shader minification for 4k - 64k intros</a>
</ul>
</div>
<h3>Tips</h3>
<p>
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).
</p>
<p>Some techniques can be useful:</p>
<ul>
<li>Group data by type, so that similar things are packed together.
<li>Repetitive data doesn't take much space. Sometimes, the smart "Don't Repeat Youself" principle can be
counterproductive.
<li>Try <a href="https://en.wikipedia.org/wiki/Delta_encoding">delta encoding</a>.
<li><a href="https://www.ctrl-alt-test.fr/2018/making-floating-point-numbers-smaller/">Make the floats smaller</a>.
</ul>
<p>
You may also read <a href="https://conspiracy.hu/articles/6/">Why are SMF files smaller?</a> about packing the music
data.
</p>
</div>
<div class="card">
<h2 id="music">Music</h2>
<p>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.
</p>
<p>
Multiple synths have been published that were specifically designed for 64k intros:
</p>
<ul>
<li><a href="https://github.com/hzdgopher/64klang">64klang</a>, an extended version of 4klang (a popular synth for 4k
intros).
<li><a href="https://github.com/logicomacorp/WaveSabre">WaveSabre</a>, used in Logicoma intros and many others.
<li><a href="https://tunefish-synth.com/">Tunefish</a>, used in Brain Control intros.
<li><a href="http://1337haxorz.de/products.html">v2</a> was a popular option around 2005-2015. It uses less
CPU than the alternatives above, but it can feel slightly outdated.
</ul>
</div>
<div class="card">
<h2 id="texture">Texture</h2>
<p>
Procedural texture generation can be done either on the CPU or on the GPU. The article
<a href="https://conspiracy.hu/articles/9/">GPU Based Texture Synthesis</a> discusses some advantages of using the GPU.
Generating textures on the CPU can be slow, so you'll probably want to use multiple threads.
</p>
<p>General introduction to texture generation:</p>
<ul>
<li><a href="http://www.upvector.com/?section=Tutorials&subsection=Intro%20to%20Procedural%20Textures">Intro to
Procedural Textures</a>
<li><a href="https://www.ctrl-alt-test.fr/2018/texturing-in-a-64kb-intro/">Texturing in a 64kB intro</a>, an overview of
the texture generation in H – Immersion.
</ul>
<h3>Voronoi</h3>
<p>Voronoi diagrams are a simple tool for procedural generation and can be used in a variety of ways:</p>
<ul>
<li><a href="https://thebookofshaders.com/12/">Cellular Noise</a>, a good overview of the Voronoi algorithm, from the Book of Shaders.
<li><a href="https://www.alanzucconi.com/2015/02/24/to-voronoi-and-beyond/">To Voronoi and Beyond</a>, another introduction that also discusses other applications.
<li>Inigo Quilez wrote multiple articles: <a href="https://iquilezles.org/articles/cellularffx/">voronoi effect</a>,
<a href="https://iquilezles.org/articles/smoothvoronoi/">smooth voronoi</a>,
<a href="https://iquilezles.org/articles/voronoilines/">voronoi edges</a>, and
<a href="https://iquilezles.org/articles/voronoise/">voronoise</a>.
<li><a href="https://fgiesen.wordpress.com/2010/03/28/how-to-generate-cellular-textures/">How to generate cellular
textures</a> discusses the implementation and optimizations.
</ul>
</div>
<div class="card">
<h2 id="meshes">Meshes</h2>
<p>Some techniques that can be useful for including meshes in a 64k intro:</p>
<ul>
<li><a href="https://iquilezles.org/articles/meshcompression/">Mesh compression</a>
<li>The <a href="https://en.wikipedia.org/wiki/Catmull%E2%80%93Clark_subdivision_surface">catmull clark subdivision algorithm</a>
is useful to generate smooth surfaces from a low-poly mesh
(see <a href="https://iquilezles.org/articles/breakpoint2007/bp2007.pdf">this presentation</a> for a code sample).
<li><a href="https://en.wikipedia.org/wiki/Marching_cubes">Marching cubes</a> can be used to convert a signed distance
function into a traditional mesh.
<li><a href=https://en.wikipedia.org/wiki/L-system">L-Systems</a> are a simple way to generate recursive objects, such as trees.
</ul>
<p>You may also check:</p>
<ul>
<li><a href="https://qoob.weebly.com/features.html">Qoob</a> a tiny modeling tool that can be used as
an inspiration.
<li><a href="https://fgiesen.wordpress.com/2012/02/13/debris-opening-the-box/">The series of articles about Debris</a>
also contains information about mesh generation.
<li>The article <a href="https://www.ctrl-alt-test.fr/2023/procedural-3d-mesh-generation-in-a-64kb-intro/">Procedural 3D
mesh generation in a 64kB intro</a>.
<li><a href="https://github.com/ConspiracyHu/apEx-public/blob/main/apEx/Phoenix/Mesh.cpp">The mesh generation source code in apEx</a>, the demomaking tool used by Conspiracy intros.
</ul>
</div>
<div class="card">
<h2 id="ray-marching">Ray Marching</h2>
<p>
Raymarching is a rendering technique that is extremely popular among 4k intros developers and the <a
href="https://www.shadertoy.com/">ShaderToy</a> community. It is also commonly used for 64k intros.
</p>
<ul>
<li><a href="https://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/">
Ray Marching and Signed Distance Functions</a> is a good introduction.
<li>Many <a href="https://iquilezles.org/articles/">articles from Inigo Quilez</a> discuss raymarching</a>.
<ul>
<li>In particular, see the <a href="https://iquilezles.org/articles/distfunctions/">distance functions page</a>.
</ul>
</li>
<li>The <a href="https://mercury.sexy/hg_sdf/">Mercury SDF toolbox</a> provides another set of common SDF.
</ul>
</div>
<div class="card">
<h2 id="making-ofs">Making-ofs</h2>
<ul>
<li><a href="https://www.youtube.com/watch?v=Y3d8jR_IwYw">Atlas 64k Graphics Breakdown - Demoscene Stream</a>, 2019
<li><a href="https://www.ctrl-alt-test.fr/2018/a-dive-into-the-making-of-immersion/">A dive into the making of Immersion</a>, 2018
<li><a href="http://www.lofibucket.com/articles/64k_intro.html">How a 64k intro is made</a>, 2017
<li><a href="https://geidav.wordpress.com/2013/04/14/making-of-turtles-all-the-way-down/">Making-of “Turtles all the way down”</a>, 2013
<li><a href="http://peisik.untergrund.net/zine/gaia_machina/">Making of Gaia Machina</a>, 2012
<li><a href="https://www.ctrl-alt-test.fr/2010/behind-incubation/">Behind Incubation</a>, 2010
<li><a href="https://iquilezles.org/articles/breakpoint2007/bp2007.pdf">Tricks and techniques for rgba's past and future intros</a>, 2007
</ul>
<p>
Not stricly a making of, <a href="https://fgiesen.wordpress.com/2012/02/13/debris-opening-the-box/">Debris: Opening the
box</a> 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.
</p>
<p>
Moreover, Conspiracy has released the <a href="https://github.com/ConspiracyHu/apEx-public">source code of apEx</a>, the demomaking tool they used for their intros between 2014 and 2023, as well as the projects for those intros.
</p>
</div>
</section>