7 ms·
Infinite complexity in 4096 bytes
- Eduard 15y agoEasily forgotten, a lot of today's demos' complexity lies behind API calls to graphics drivers and OS system calls, whose implementations don't count to the byte limit.
- __alexs 15y agoBecause Amiga demos never exploited the way low res CRT displays looked or used the SID chip right?
- ssdsa 15y agoFor the record, the SID chip was used in Commodore 64, while Amiga had the Paula chip for sound output.
- enqk 15y agoVariations of this comment are made on just about any story about 4kB intros. This is not a very interesting point to me because of how it forgets that in any case, software never exist into a vacuum, and hardware is needed for it. And that hardware does perform a great deal of duties. The subtext often is that for some reason it's less noble or impressive to code against APIs. However hardware also is a sort of API of its own. Even on a ZX-81.
- mm_alex 15y agoI understand why this always comes up, but in this particular case it's particularly 'un-useful'. I can tell you exactly what API calls he makes: on boot he makes API calls the equivalent of PlayGigantic3MinuteWav(), InitOpenGL(), Compile2Shaders(), and then each frame he calls DrawFullScreenQuad() (twice, once to an offscreen texture, once to the screen), and Flip(). All the magic of the demo is in the synth (pure x86 fpu code) for the music, and the sphere tracer / camera choices / colors / fractal equation, for which precisely 0 'API' is used. Put another way, the really amazing thing these days is that we have hardware (cpu, gpu) capable of so many FLOPS that you can do brute force things like sphere tracing complex fractals. the goal, seen in this light, of the demoscene, is to expose the wonder of all that power in visually interesting or arty ways. Seriously, you couldn't have picked a worse example of someone 'leaning on an api'. :)
- exDM69 15y agoJust like early PC 4k's used the BIOS/DOS interrupt routines which were not counted either. And before that, there were all these custom purpose built chips for doing graphics and audio synthesis. When making 4k intros for Linux (may apply to other platforms) you have to do your own startup and runtime linking code because otherwise the executable will go over the limit before it does anything. Because of this, you will have to minimize the amount of libraries you use and the amount of functions you use. The name of every function you use must be included as a string in the (uncompressed) binary. So even though you can use peripheral libraries, there is an incentive to minimize the amount of library functions you use. And what are the libraries that are used? You need to get something on the screen, so many demos use SDL or similar, like this: SDL_Init(...); SDL_SetVideoMode(width, height, 32, SDL_FULL_SCREEN); instead of: xor eax, eax mov al, 13h int 10h ; I wonder if I still remember this correctly The former is not much easier (or harder) than the latter but the latter is simply impossible with a modern computer. Then there's OpenGL and Direct3D, which are used to talk with the GPU. These days a GPU is basically a method of drawing triangles really really fast. But it draws only triangles and you have to program all the lighting and whatnot. Then there are fancy shader tricks you can do, but they're not (a lot) easier than it was when poking pixels directly to video memory. It's arguably easier to do 3d graphics using a GPU than writing your own triangle fillers and perspective correct texture mappers. But this is a double edged sword. Getting shit done with triangles only is a constraint that did not exist back in the pixel pushing days. And finally, audio. Writing a software synth consumes quite a big chunk of your byte budget. Back in the day, there were dedicated synth chips in computers, from the SID to the OPL-3 in SoundBlasters and Ad-Libs. Programming them was not super easy either, but I'd guess it takes a few bytes less than writing a PCM-emitting synth from scratch and sending that data to the sound output. So what you say is correct, library implementations don't count to the byte limit. But if your message is that it makes stuff easier and it was 2000% more hardcore in the 1990's with DOS, I disagree.
- raverbashing 15y agoYeah, I think you got the int 10h right (not sure I remember this as well) But then came VESA which was a little bit more complex and of course, screen sizes bigger than a segment (ouch) About audio, IMHO it's much easier now, dealing with those interrupt handlers and dma controllers wasn't easy. Of course, once the library worked it was ok.
- Eduard 15y agoGosh, some guys are so easily hurt by a fact. And what "subtext" you read in my comment. Terrible. As a matter of fact, demo producers are offered more and more API choices. Compare what you had to accomplish with tinkering around with bare-metal BIOS interrupts in the 90s, compared to a full-fledged DirectX API including GPU-raytraycing almost out-of-the-box.
- mm_alex 15y agoI dunno about hurt blah blah blah but could you explain how exactly the 'modern API choices' provide 'GPU-raytraycing almost out-of-the-box'? if you search for ray tracing in opengl/directx/webgl, you will find no mention of ray-tracing, and for good reason: they don't provide it 'out of the box'. The ray tracing going on in this demo has nothing to do with the APIs he is using; indeed, that demo could be implemented, pixel perfect, on any platform with floating point arithmetic. it just uses the 'advanced api' to display the resulting image on the screen... now, the point you make is still a valid one, in that we have more api's than before, but this demo is not an example of using such apis. Better 'grey area 4k' examples that would support your point, are the ones that (for example), loaded the general midi file from windows, and used it as a source of samples (that was a trend a few years ago); or the ones that make use of D3DX's truetype font->extruded mesh routine, to create almost all their geometry out of extruded Arial letters. In both cases, these are such ingenious hacks that despite being in the 'grey area', and definitely (ab)using data available in the host OS, they represent such crazed creativity you can't help but admire them. either way, such tricks were not used here; you're just seeing the result of a very large number of multiply-add instructions, artfully composed; and that's nothing to do with 'demo producers making more and more API choices'
- inoop 15y agoOh look, it's this old chestnut again.
- haberman 15y agoSo what? 100% of the information that makes Demo 1 different from Demo 2 lives inside that 4k. 0% of the creativity that makes demos actually inspiring lives in the OS or graphics drivers.
- jacquesm 15y agoYou should probably exercise a disassembler on the code for a bit and come away enlightened.
- __alexs 15y agoOr ~4096 bytes of Kolmogorov complexity...
- Symmetry 15y agoYes, its not literally "infinite complexity in 4096 bytes", but I think poetic license is entirely justified here... it is a sort of visual poetry after all.
- jackpirate 15y agoTechnically it's only 4096 bytes given all the other infrastructure the code accesses. Which is quite a bit.
- vmind 15y agoCool, but I think my favourite 4k demo is still Elevated, which is much less obviously procedural. (http://www.youtube.com/watch?v=_YWMGuh15nE http://www.youtube.com/watch?v=_YWMGuh15nE)
- nkoren 15y agoBloody hell, that's brilliant. That's really 4k?!? The intro gave me chills. I wish the geometry were less obviously faceted, but the texturing is astonishing. Of course the OP is brilliant too. Kudos to all these guys!
- z303 15y agoiq has a presentation on the techinques used http://iquilezles.org/www/material/function2009/function2009.htm http://iquilezles.org/www/material/function2009/function2009...
- cies 15y agothat was also my favorite... but this one is at least on par. gosh, and only 4k.
- rnicholson 15y agoTBC does some great ones. Although Receptor is my fav -- http://www.youtube.com/watch?v=0UOpWfX6gw8 http://www.youtube.com/watch?v=0UOpWfX6gw8
- Iwaan 15y agoI was an intern at a game company last year. I showed the CEO some of the stuff that is going on in the demoscene. He got really worried and told me to not show that to any of his staff. He was afraid that it intimidates his highly paid coders and designers. I found that rather disturbing. How are you going to kill Hollywood if you are afraid of algorithms?
- ebiester 15y agoThe funny thing is that many game programmers I know grew up watching demos if not making them. Who hasn't seen at least one Future Crew demo?
- muyuu 15y agoAny game coder worth his salt knows fractals. Many veterans from the demoscene ended up in the game industry at some point. In the 90s most wizkids dreamt of living off making games, and many demosceners made intros to cracked games. Good game coders like Carmack have little to feel intimidated about.
- aptwebapps 15y agoYour point is good but saying that Carmack shouldn't feel intimidated is probably not helpful. ;)
- ralfd 15y agoAs a coder I too feel intimidated by these impossible 4 KB Demos. It is also important to remind oneself that the optimizations to do this stuff are mostly meaningless for making a game. You are mostly constrained by time in a project, and shouldn't distract oneself in being cute with neat tricks.
- ctdonath 15y agoWhat you can do within severe constraints can be very impressive. Particular impressive results may not fit into severe constraints. Do not confuse the two. Even a small "that's great, but it needs to do..." can change 4KB into 4GB.
- 15y ago
- ssdsa 15y agoIf you are not familiar with 4k intros, you may wonder how things are organized at the executable level to achieve this kind of packing-performance. Probably the most important and essential aspect of 4k-64k intros is the compressor. Have a look here: http://code4k.blogspot.de/2010/12/crinkler-secrets-4k-intro-executable.html http://code4k.blogspot.de/2010/12/crinkler-secrets-4k-intro-...
- ajtaylor 15y agoI've always wondered how they managed to pack so much information into so small a space. Obviously it's all algorithms which generates everything at run time. But still, it's very impressive!
- draakon 15y agoThe lossless 60 fps high definition video capture is currently unavailable (traffic limit). Any mirrors (or torrent would probably be a pretty good idea)? YouTube 1080p version seems to have pretty terrible quality.
- jonknee 15y agoSomewhat humorous that the full resolution demo of a 4k intro is too large to handle on the server. Just post the source
- lloeki 15y agoThis seriously begs for a torrent.
- sp332 15y agoThis one? http://www.youtube.com/watch?v=0w_xEUoK79o http://www.youtube.com/watch?v=0w_xEUoK79o It was uploaded in 2048x1526 resolution, so anything less than that will be downsampled by Youtube.
- pjmlp 15y agoDemoscene!
- aerique 15y agoWhat a piece of art!
- degenerate 15y agoI once spent hours looking for an internet archive or community of demo scene files / artists. There doesn't seem to be one out there in the eyes of google. Can anyone familiar with this art form please provide links to your your underground hangout? :)
- cocoflunchy 15y agohttp://www.pouet.net http://www.pouet.net is the only I'm aware of. [edit] maybe http://scene.org http://scene.org also ?
- deleted 15y ago[deleted]
- sp332 15y agoThis is a very thorough list of the most famous (read:best) and most influential demos: https://news.ycombinator.com/item?id=3840830 https://news.ycombinator.com/item?id=3840830
- bane 15y agowww.pouet.net www.demoscene.tv www.scene.org http://www.scenemusic.net/demovibes/ http://www.scenemusic.net/demovibes/ I understand lots of the scene is still active on IRC if you hunt around.
- inoop 15y agopouet.net, #coders on ircnet, or just visit a demoparty in your area.
- bane 15y agoSomething to keep in mind is that these groups spend months building a world in these 4096 bytes. These aren't weekend hack jobs. Near the end they may be hacking off individual notes from the music, or letters from the credits to fit within their byte budget. Very little of modern programming can replicate what it was like to work on old systems outside of these kinds of competitions. For those interested in the music side of these productions, many of the composers use this to write the music. http://4klang.untergrund.net/ http://4klang.untergrund.net/
- bane 15y agoThe entire 4k competition from that party is here http://www.youtube.com/watch?v=bdG-5Fhnx-I http://www.youtube.com/watch?v=bdG-5Fhnx-I well worth the watch...
- inoop 15y agoThe technique used here is raymarching. Relevant thread on pouet: http://pouet.net/topic.php?which=7920 http://pouet.net/topic.php?which=7920
- dualogy 15y agoYeah and there's many WebGL samples of this awesome technique: http://www.postronic.org/h3/pid65.html http://www.postronic.org/h3/pid65.html http://y-alice.blogspot.com/2012/04/final-submission.html http://y-alice.blogspot.com/2012/04/final-submission.html One pointlessly bouncy (but fun to make) experiment I ported from desktop GL to WebGL a short while ago: http://glsl.heroku.com/e#2417 http://glsl.heroku.com/e#2417 Set quality to 4 or 8 as fast as you can unless you already got one of them 2014 GPUs. That being said, none of those are 4K =)
- haberman 15y agoI'm pretty proud of my programming skills. I've worked in everything from assembly to JavaScript, JIT compilers to websites to large-scale, fault-tolerant distributed systems. etc. etc. But demoscene programming is still the one thing that leaves me totally in awe, feeling like I wouldn't even know where to start to achieve what these guys pull off. Even if I could imagine fitting all those drawing and sound generation routines into 4k, how on earth would you script the whole thing in that little space? How would you encode and execute the sequence of camera paths, music events, and synchronize light flashes with the music? And make it consistent in time, as opposed to depending on the speed of the CPU? I just can't even imagine what the main loop would look like.
- gaius 15y agoOn a C64, you disable interrupts, pull out your trusty table of opcodes, and can time everything down to a single clock cycle.
- maratd 15y agoHave to start when you're young =) I'm in the same place as you. Pretty sure if I started doing it when I was 10, it'd be self-obvious by the time I turned 12.
- pjscott 15y agoDon't be intimidated! There are a lot of things you don't know about how to make demoscene-style programs, and the reason you don't know them is probably because you haven't tried to learn them yet. I'm pretty sure that if you start learning when you're n, a lot of things will seem self-evident when you're n+2. Here's a series of really good blog posts from someone who decides to make a shiny procedurally-generated city. The result is an amazing how-did-he-do-that demo, but the steps he went through and the way he thought about the problem are understandable. http://www.shamusyoung.com/twentysidedtale/?p=2940 http://www.shamusyoung.com/twentysidedtale/?p=2940
- randlet 15y agoThis is a really great (well written, entertaining, informative, inspiring) series of articles about a guy programming just for the joy of it! Thanks for posting.
- josefonseca 15y agoDoes this give anyone else the sense that with amazing processors we have available that we're being really wasteful with these bloated apps we currently have? I mean if these guys are able to do this in 4K, what else could be done in operating system terms if we achieved that same level of excellence?
- Klinky 15y agoThese demos rely on the OS to access sound & graphics, they could not reach the fidelity they do without the OS hiding away much of the file size. You could not do a 4K demo if you had to include the infrastructure to load a modern graphics driver & OpenGL/DX libraries. They are also only small in terms of package size. This demo for example uses about 550MB of RAM while running(Win7x64).
- gaius 15y agoRight, but you could do pretty impressive stuff even on a VIC-20.
- spitfire 15y agoThat's not true in the least. We used to do 4K's in dos. Which was a glorified executable loader. Once your program started executing you were on your own, graphics, sound, memory management, everything. People still managed to get the first level of descent into 4K.
- Klinky 15y agoI didn't say you could not make a 4K demo at all. I said you could not make one if you had to include an OS, drivers & DX/OpenGL libraries that most modern 4K demos rely on. You could probably make something like this demo in DOS, but it probably would look nowhere near as pretty. My point was that modern 4K demos are still fun, but they should not be looked at as though they are great examples of efficient uses of resources. You have to watch out for Man on the Moon Syndrome where people start asking "Why can we get infinite 3D fractal explorations in 4K of space, but Ruby's binary is 10MB!!?".
- winestock 15y agoNot only are there 4-kilobyte demos, there are also 256-byte demos. http://dang.posterous.com/256-byte-demos http://dang.posterous.com/256-byte-demos http://www.pouet.net/search.php?what=256+bytes&type=prod&x=0&y=0 http://www.pouet.net/search.php?what=256+bytes&type=prod...
- evincarofautumn 15y agoWell, colour me impressed. Interesting side note: demos tend to use music with pentatonic (ambient) or whole-tone (dreamy) scales. They’re easy to harmonise, which makes it easy to procedurally generate decent-sounding music.
- jlgreco 15y agoWhen watching demoscenes these days I find myself always waiting for the dubstep 'drop'. Sadly I think modern music is starting to spoil this sort of thing for me.
- 10098 15y agoit's things like this that remind me how sucky my "skills" actually are
- jacquesm 15y agoGerman hartverdrahtet -> hardwired / hardcoded but also 'wired hearts' (the opening shot and the primitive the scene appears to be made out of)
- markerdmann 15y ago"Herz" is the German word for heart. Do you mean that "hart" sounds like the English word "heart"?
- jacquesm 15y agoYes, it looked like a play on words. In dutch (halfway between English and German) it literally means heart.
- pnathan 15y agoNote that if you crave this kind of world of limited resources and ingenuity for packing things very small, it still exists in a professional setting in hard real-time embedded systems. I heard a story at my company about fixing a bug a couple years ago. Memory was full, so in order to do that, the engineers rewrote the UI messages to allow the extra instructions to fit into memory.
- Voltage 15y agoHere's my first 4k production: http://www.youtube.com/watch?v=sBcwQCBpEiE http://www.youtube.com/watch?v=sBcwQCBpEiE If you want to play with this type of code right now in your browser, check this out... http://glsl.heroku.com/e#2431.0 http://glsl.heroku.com/e#2431.0