How we made an animated movie in 8kB
January 25, 2024 8:11 PM   Subscribe

In November 2022, we set ourselves a challenge: make a real-time animation that looks like a standard short animated movie, with the constraint that it should fit in 8 kilobytes. The goal was to have decent graphics, animations, direction and camera work, and the matching music… Yes, 8 kilobytes, less than half of this post, for everything.
posted by flabdablet (26 comments total) 17 users marked this as a favorite
 
Holy moley, that’s freaking amazing that’s only 8kb!

Loved the ending.
posted by Thorzdad at 8:19 PM on January 25


OK so instead of my initial drive-by snark, I'll just point out that the sheep is killed senselessly to give the creators an opportunity to animate gore.
posted by tigrrrlily at 8:40 PM on January 25 [6 favorites]


Ok, now make it porn.

More seriously, I wish I understood how impressive this is.
posted by slogger at 8:43 PM on January 25


It's pretty fucking impressive...

No app I ever wrote would have fit in 8kb.

And clicking on the link, got a "Trojan" warning. Careful y'all
posted by Windopaene at 8:48 PM on January 25


Windopaene, can you memail me the link that generated that warning for you? I suspect it's a false positive triggered by detection of the Crinkler executable compression tool, but I'd like to be sure.
posted by flabdablet at 8:56 PM on January 25


the sheep is killed senselessly to give the creators an opportunity to animate gore

From the GitHub page:
No animals were harmed during the making of this demo. The sheep is a stunt actor. Do not try this at home.
posted by flabdablet at 8:58 PM on January 25 [6 favorites]


I compare this to stuff I saw in the 64k category at the turn of the century and it's absolutely mind blowing!

I guess maybe it's not a fair comparison since the gpu and languages for those are more advanced? The nuance is tricky but this is a huge achievement no matter how you look at it. Catchy tune too, thanks for posting!
posted by SaltySalticid at 8:58 PM on January 25 [1 favorite]


I guess maybe it's not a fair comparison since the gpu and languages for those are more advanced?

I'd say the new thing since the C64 days is that the 8kb limit ignores the GPU drivers, etc. Those old demos were doing a lot more low-level rendering. Today, you "just" need to ask your OS for a window, set up a GPU rendering context, and then tell the GPU drivers to load evaluate the shader that you've decompressed. Quotes for "just" because writing a ray-marching renderer that fits in 8kb is still a bunch of work.
posted by Alterscape at 9:06 PM on January 25 [8 favorites]


OK flabdablet. I consider you one of my favorite mefites, and i really look up to you in a lot of ways. You're a voice of reason in countless discussions.
I'm gonna step out of this thread, and remove it from activity. Feel free to lulz about my reaction to a depiction of gory animal death as you will.
posted by tigrrrlily at 9:58 PM on January 25 [1 favorite]


Today, you "just" need to ask your OS for a window, set up a GPU rendering context, and then tell the GPU drivers to load evaluate the shader that you've decompressed. Quotes for "just" because writing a ray-marching renderer that fits in 8kb is still a bunch of work.

You can raymarch by yourself purely in software, though I don't know how it would compare in size. You'd probably need to bring your own implementation of vector and matrix operations. But generally for raymarching the GPU is just there for speed, you often aren't really taking advantage of any of the GPU's powerful APIs.
posted by BungaDunga at 10:36 PM on January 25


eg you can raymarch with pico-8, raymarching is super flexible because it barely needs a runtime, just math.
posted by BungaDunga at 10:41 PM on January 25 [1 favorite]


depiction of gory animal death

It's no Happy Tree Friends, but your point is taken. Cartoongore and splatter tags added.
posted by flabdablet at 10:45 PM on January 25 [5 favorites]


I love challenges like this. I've been following the progress of the programmer who's gotten the snake game down to 60 bytes. It's taken me 299 bytes just to make this comment.
posted by betaray at 11:03 PM on January 25 [2 favorites]


Reminds me of Veggietales. Slightly more violent. I bet Phil Vischer would get a kick out of this.
posted by shenkerism at 11:10 PM on January 25


the sheep is killed senselessly to give the creators an opportunity to animate gore

I got more of a Bambi Meets Godzilla vibe from the ending.
posted by Thorzdad at 1:11 AM on January 26 [4 favorites]


I took did not appreciate the ending. It was unnecessary.
posted by Faintdreams at 1:53 AM on January 26 [5 favorites]


"just" 8K if you ignore the shoulders of giants you stand on by starting your code with

#include <windows.h>
#include <mmsystem.h>
#include <mmreg.h>

It's like saying "I deploy a fully configured scalable cloud computer cluster in just 6 lines" ignoring all the work terraform can do for you in those lines.

Still impressive but don't ignore the foundations...
posted by DreamerFi at 2:46 AM on January 26 [4 favorites]


Agree. The gore was unnecessary. The ending could've been more cartoony.
posted by RonButNotStupid at 5:20 AM on January 26 [1 favorite]


This reminded me very much of the 80s experimental and proof-of-concept CG films that I loved to watch on VHS back in the day. (See "Peedee Meets the Dragon.") And the ending is also very much an 80s/90s ending, with violence towards cute things being its own gag. I expected it, but I thought the flower was going to eat the sheep.
posted by Countess Elena at 6:27 AM on January 26 [1 favorite]


It's like saying "I deploy a fully configured scalable cloud computer cluster in just 6 lines" ignoring all the work terraform can do for you in those lines.

To a first approximation I think all those imports are just there to 1) create a window and 2) load the shaders into the GPU. Unlike a 6-line terraform script, that stuff is really just boilerplate and not doing the interesting heavy-lifting. It's not their fault that you can't designate a file as "GPU executable" and have the OS load and execute it on the GPU, like you can with ordinary binaries.

If you didn't want it to run in realtime you could skip those imports and render it in software- which would involve a binary of a similar size, but I think that was a non-goal of the project. The interesting part is cramming a raymarched animation into 5kb. They could probably have dumped the imports and built a software renderer directly to bitmaps for it in another few kb if they'd wanted to.
posted by BungaDunga at 6:27 AM on January 26 [3 favorites]


that is to say that if you can do this in 8kb you could do one without the GPU APIs in less than double that if you are as good as these people evidently are. It might not run in realtime but it would work just fine. I don't think there's much essential complexity being smuggled in by using Windows APIs as a runtime dependency
posted by BungaDunga at 6:34 AM on January 26 [3 favorites]


I'd say the new thing since the C64 days is that the 8kb limit ignores the GPU drivers, etc. Those old demos were doing a lot more low-level rendering. Today, you "just" need to ask your OS for a window, set up a GPU rendering context, and then tell the GPU drivers to load evaluate the shader that you've decompressed

The Apple II hardware project I’m working on has this as one of its design goals, and we demoed a very crude example of it at last year’s Kansasfest. We created a basic tile rendering API such that the Apple could upload tile graphic resources to an external rendering process, and then the Apple only had to send relatively short instruction commands to change what tiles were rendered to the screen.

All the classic Apple II graphics games spent 90% or more of their time pushing pixels to their video memory, so an API which dramatically reduces the amount of data needed to update the screen is, effectively, a huge clock speed multiplier because it frees so much time to, like, run the rest of the game with.

The reason the original NES (powered by the same 6502 as the Apple II) had so much better graphics than the Apple, was because it had a (very simple, but still powerful) tile rendering coprocessor. So this isn’t a new idea. But I can tell you that my coprocessor can beat up their coprocessor! I mean, it’s got 30 years of Moore’s Law behind it.

There are still real limits enforced because it’s remains just a 1MHz, 8-bit CPU that is needing to do all the decision making. The 64k address space is possibly even more limiting than the clock speed. Which is why I’m also going to be trying to provide 1MB of fairly flexibly segmented extended memory, but that’s still a work in progress to design.
posted by notoriety public at 6:36 AM on January 26 [1 favorite]


I was grooving on the fact that humans have been depicting/tell stories with animals for 30+ thousand years but then the ending was weak.
posted by brachiopod at 7:48 AM on January 26


Agreed re: the ending.

#define TRACK_AS_WAV_FILE L"sheep.wav"

Wait, they didn't include the soundtrack as part of the program size?
posted by grumpybear69 at 10:16 AM on January 26


The wav file is generated at program startup. It's kind of nice that you can find an off-the-shelf modular software synth that's written in x86 assembler when you need it.
posted by credulous at 10:18 AM on January 26 [2 favorites]


Before looking at the post and product, my reflection was "they must have done awesome things with circles". And, yes, that seems to be a feature.

Pretty ok film.
posted by DeepSeaHaggis at 2:58 PM on January 26


« Older Vets seek new feathers for wedge-tailed eagle   |   Behind Netflix Film Chief’s Exit —And What It... Newer »


This thread has been archived and is closed to new comments