How can I learn the insane art of 4K democoding? [closed]
Asked Answered
S

4

28

I love the demoscene a lot, especially those small 4K exefiles. They don't have any dependencies except for the files already found in windows and they exhibit the awesome power of programming: 3D graphics + sound, all in 4K.

How is this possible? What's the language they are using? What are the tools of trade, best practices and important websites?

Sublieutenant answered 13/5, 2009 at 16:49 Comment(1)
@Sublieutenant I assume they believe it isn't concrete and focused enough to be reasonably answerable on SO. It is pretty broad. Compare to "How can I learn Rails?", which would surely be closed.Counterpoison
H
11

compression algorithms obviously feature heavily, as do short mechanisms for indexing large amounts of data and a deep knowledge of the available libraries on the target system. (That stuff can just be linked in.)

If I were you, I'd start by reverse-engineering your favourite 4k demos; perhaps starting with ones from 7-10 years ago, and working forwards to follow the state of the art as it progresses. Analysing your compiler's output is a good place to start, too, though they tend to optimize for speed rather than for space.

Techniques for embedded programming may also be helpful, given the constraints they operate under regularly.

Hallucination answered 13/5, 2009 at 16:59 Comment(2)
"Indexing large amounts of data"? Why?Sublieutenant
because you'll have to reference the data you unpack/generate from your 4k binary - so you'll want to be able to do that efficiently.Hallucination
S
14

In the meantime I have found a great website dealing with 4K coding:

IN4K

Sublieutenant answered 13/5, 2009 at 17:8 Comment(0)
H
11

compression algorithms obviously feature heavily, as do short mechanisms for indexing large amounts of data and a deep knowledge of the available libraries on the target system. (That stuff can just be linked in.)

If I were you, I'd start by reverse-engineering your favourite 4k demos; perhaps starting with ones from 7-10 years ago, and working forwards to follow the state of the art as it progresses. Analysing your compiler's output is a good place to start, too, though they tend to optimize for speed rather than for space.

Techniques for embedded programming may also be helpful, given the constraints they operate under regularly.

Hallucination answered 13/5, 2009 at 16:59 Comment(2)
"Indexing large amounts of data"? Why?Sublieutenant
because you'll have to reference the data you unpack/generate from your 4k binary - so you'll want to be able to do that efficiently.Hallucination
P
7

Inigo Quilez has some examples of 1K and 4K intros. You can learn a lot from them. Check out his other articles too.

The article on Tiny PE by Alexander Sotirov is interesting too.

Primula answered 15/8, 2012 at 16:7 Comment(0)
A
4

Might not be quite what you're looking for, but in the same spirit: There are several Java 4k contests. The objective being to create a Java demo or even game (!) that completely fits into a single JAR of max 4096 bytes.

See e.g.

http://www.mojang.com/notch/j4k/l4kd/

or

http://javaunlimited.net/contests/java4k.php

One might argue that Java makes it much easier (since you can use the whole runtime), but it's still impressive (and you are cross-platform and don't need to learn assembler ;)).

Artiodactyl answered 13/5, 2009 at 17:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.