Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Hacking Hi-Def Graphics and Camerawork Into 4Kb

timothy posted more than 5 years ago | from the thumbdrive-could-hold-the-entire-world dept.

Graphics 255

TRNick writes "The old home-computing art of hacking elaborate graphics and camerawork into tiny amounts of memory has been lost, right? Not so. The demoscene is keeping ingenious coding skills alive, and TechRadar finds out the latest developments. Winner of the 4kb competition at 2009's Breakpoint party was RGBA's demo 'Elevated,' a gorgeous scrolling demo featuring photo realistic landscapes and music, which fits into the memory used by one of your PC's desktop icons. This is really impressive stuff."

cancel ×

255 comments

Sorry! There are no comments related to the filter you selected.

I assume the SOURCE fits into 4 kb (-1)

ls671 (1122017) | more than 5 years ago | (#28756905)

> which fits into the memory used by one of your PC's desktop icons.

I would assume that the source code may fit into 4 KB but that it requires a lot more memory to execute.

"Fitting into the memory used by one of your PC's desktop icons" would thus seem a little overstated...

I did not read the whole article but I did not see any mention of how much memory is required for execution of the code.

Re:I assume the SOURCE fits into 4 kb (5, Informative)

Anonymous Coward | more than 5 years ago | (#28756969)

If you're not going to read the article, maybe you should at least have some idea of what the demo scene is about before rushing to first post.

What it is saying is that the executable file is 4096 bytes. The source code has little relation to that. If the program asks to use more memory beyond that after it's loaded, that's fine.

Re:I assume the SOURCE fits into 4 kb (-1, Troll)

ls671 (1122017) | more than 5 years ago | (#28757203)

Well, I could have used executable, I used source as in an mpeg file constituting the media source for your movie as opposition to VHS tape source for example.

I just think "Fitting into the memory used by one of your PC's desktop icons" leads to believe that it takes as much resources as displaying an icon on your PC, which I would assume is not true.

That's all I said, I never said it wasn't a great achievement !

By the way, the article says it is 4 KB not 4 kb.

Re:I assume the SOURCE fits into 4 kb (1)

myrrdyn (562078) | more than 5 years ago | (#28758217)

By the way, the article says it is 4 KB not 4 kb.

So? I understood it this way:
4 KB -> 4 KBytes
4 kb -> 4 kbits
(let forget about decimal(1000)/binary(1024) for a moment)
The GP was saying 4096 bytes... the rest is left as an exercise on obviousness for the reader

Re:I assume the SOURCE fits into 4 kb (0)

Anonymous Coward | more than 5 years ago | (#28757587)

Not only that, so many inexperienced people tend to not realize that many times the source code is many many times greater than the produced binary. Like Linux kernel is, what, 56 meg or so but obviously isn't remotely that large when compiled. I guess they think that "if/then" when compiled must still take up 6 bytes(I-F-T-H-E-N), not including the code branches and tests of course.

Re:I assume the SOURCE fits into 4 kb (2, Informative)

Anonymous Coward | more than 5 years ago | (#28757003)

You assume correctly, but in no way does that detract from how impressive their work (and others' in the DemoScene) is.

Here, read up some more about it: http://en.wikipedia.org/wiki/Demoscene

Re:I assume the SOURCE fits into 4 kb (1)

immakiku (777365) | more than 5 years ago | (#28757005)

The executable is 4KB

Re:I assume the SOURCE fits into 4 kb (0)

Anonymous Coward | more than 5 years ago | (#28757015)

wrong too. the executable is = 4kb. no idea how much memory it uses.

Even smaller - the BINARY is 4k (5, Informative)

kyz (225372) | more than 5 years ago | (#28757027)

The source is much larger. The size counted is the size of the executable. Write as many comments as you like in your source code.

You can use as much memory as you like, but it's a very boring pile of memory if you don't then precompute a pile of pretty pictures using algorithms and data, which is what the 4kb is really counting.

You can use as many external libraries you like, as long as they're public; so you don't have to write your own OpenGL implementation, but you can't hide 200kb of your latest cool code somewhere other than the 4kb executable.

Feel free to hack the executable format to remove unnecessary headers and sections that an average compiler or linker would generate.

Re:Even smaller - the BINARY is 4k (0)

Anonymous Coward | more than 5 years ago | (#28757075)

linking in libraries is kind of cheating, no?

Re:Even smaller - the BINARY is 4k (1, Insightful)

Anonymous Coward | more than 5 years ago | (#28757127)

running on an operating system is kind of cheating, no?

Re:Even smaller - the BINARY is 4k (0)

Anonymous Coward | more than 5 years ago | (#28757277)

How else do you expect people to access the graphics card? They're cheating if they don't write their own GPU driver and OpenGL implementation? Should they even be allowed to run on an existing OS, or should they have to write their own?

Perhaps the parent post was a bit unclear. You can't bundle a ton of external libraries along with your application. Bundling the GNU Triangulated Surfaces library (http://gts.sourceforge.net/) is not OK, but using OpenGL is. I'm not in the scene myself, so the line is fuzzy to me... for example, is it OK to use high-level DirectX utility functions to generate mesh geometry? I suspect not, that it's only OK to use the functions that you need to talk to the GPU, but I don't know for sure.

Re:Even smaller - the BINARY is 4k (2, Insightful)

slim (1652) | more than 5 years ago | (#28757417)

How else do you expect people to access the graphics card? They're cheating if they don't write their own GPU driver and OpenGL implementation? Should they even be allowed to run on an existing OS, or should they have to write their own?

To be fair, the old C64 demos probably overwrote a lot of the OS with their own code. DOS demos wrote directly to the graphics hardware (and hence often had very specific hardware requirements).

However, I think it's entirely fair to set competition rules that allow you to use OpenGL / DirectX etc.

Re:Even smaller - the BINARY is 4k (3, Insightful)

Anonymous Coward | more than 5 years ago | (#28758423)

The difference is, the old C64 demos would run on any C64.

This '4K' demo requires gigabytes of other code to run, so you need to install a hell of a lot of other software before it will work.

It will only work on certain PCs with the right configurations too, and will break when the external libraries it uses change.

Re:Even smaller - the BINARY is 4k (0)

Anonymous Coward | more than 5 years ago | (#28757305)

But if you can use as much memory as you like, can't you have a tiny program which generates every possible 1 MB program? A counter makes it stop generating at the exact 1 MB program you want, and it starts executing it.

Re:Even smaller - the BINARY is 4k (1, Insightful)

Anonymous Coward | more than 5 years ago | (#28757391)

No that is impossible. The number that tells your program to stop generating would be 1MB in size.

Re:Even smaller - the BINARY is 4k (1)

The_mad_linguist (1019680) | more than 5 years ago | (#28757407)

Compression does not work that way.

Re:Even smaller - the BINARY is 4k (0)

Anonymous Coward | more than 5 years ago | (#28757763)

What the poster wrote is not compression. I could easily create a 4K program that can generate every possible 1MB long byte sequence (it may take a while to run). Heck, I can write that in well under 64 bytes. The rest of the 4K can be used for hueristics to stop the counter when needed and run the resulting program.

Your failure is you assumed the poster meant to compress every 1MB program into a 4K one.

Of course stopping at an arbitrary one is a problem. But of all 1MB sequences the one you may want to stop at could perhaps be identified using some heuristic or other identifier, making the original posters idea still valid.

Re:Even smaller - the BINARY is 4k (2, Informative)

myrrdyn (562078) | more than 5 years ago | (#28758277)

What the poster wrote is not compression. I could easily create a 4K program that can generate every possible 1MB long byte sequence (it may take a while to run). Heck, I can write that in well under 64 bytes. The rest of the 4K can be used for hueristics to stop the counter when needed and run the resulting program.

Your failure is you assumed the poster meant to compress every 1MB program into a 4K one.

Of course stopping at an arbitrary one is a problem. But of all 1MB sequences the one you may want to stop at could perhaps be identified using some heuristic or other identifier, making the original posters idea still valid.

This whole post seems to me an odd and convolute definition of compression...
BTW, information entropy prevents just what you are talking about (most of the times)

KC explored (4, Insightful)

eddy (18759) | more than 5 years ago | (#28757501)

Yes, and that'd be very neat and much much harder than you seem to think. Try it, go looking for that magical random seed that creates a 1MB blob of code that does something impressive. Maybe you should expand your idea to first generate a filtering program that can determine if a code sequence, when run over some data, creates a demo? :-)

4K demos are sort of an artistic exploration of Kolmogorov complexity [wikipedia.org] .

Remember also that, if the judges die of old age before your demo appear, you're unlikely to place well in the compo.

Re:Even smaller - the BINARY is 4k (1)

BOBSta (1120709) | more than 5 years ago | (#28757355)

If the PC demoscene is anything like the proppa old skool C64 and Amiga demoscene, then these guys are hand coding directly in machine code! They're also prob'ly 14 year olds from Sweden or Denmark.

Re:Even smaller - the BINARY is 4k (1)

xouumalperxe (815707) | more than 5 years ago | (#28757945)

From what I remember from seeing some of this stuff a few years ago, at least some groups actually write full-fledged applications for their artists to "program" procedurally-generated artwork, and the final binaries are at least partially assembled from such generated code.

Re:I assume the SOURCE fits into 4 kb (0)

Anonymous Coward | more than 5 years ago | (#28757047)

That would be totally pointless... you can have huge source code with big descriptive variable names, that could take up a lot of space, and then change the variable names to single (or double if necessary) characters and your source code's size would drop significantly.

However, the executable size is going to be the same for either.

That's kind of like car ads that exclaim that the car can "drive 300 miles on a single tank of gas!" while never letting you know how much the gas tank can hold.

you mean the executable (0)

Anonymous Coward | more than 5 years ago | (#28757095)

The source is probably 40KB+, but you're right it probably uses multiple MBs of video memory at the very least once it is running. I don't keep up with the PC demo scene but I remember one of the 64KB Farbrausch demos needed around 200MB of RAM.

Trojan (0, Troll)

Anonymous Coward | more than 5 years ago | (#28756987)

The demo executable contains the trojan W32/Smalltroj.NCSD!

Re:Trojan (5, Informative)

Anonymous Coward | more than 5 years ago | (#28757135)

The compression techniques in demo code drive AV products nuts, that's just the way it is. They're not going to infect your system -- that would add too much bloat.

Shame it doesn't work on Win7 64-bit tho.

Re:Trojan (0)

The_mad_linguist (1019680) | more than 5 years ago | (#28758089)

Doesn't work on my XP pro box either. Music plays fine, but all I see is a blue screen with scattered 8x8 blocks of gray and white pixels.

Re:Trojan (4, Informative)

AmiMoJo (196126) | more than 5 years ago | (#28758563)

You need d3dx9_33.dll, which is not included on 64 bit systems.

With that DLL it works fine on XP x64.

Re:Trojan (4, Informative)

Anonymous Coward | more than 5 years ago | (#28757445)

The loaders they use to uncompress the image are routinly also used by virus writers for their own non-3d distructive payloads. Sometimes the people adding the virus signatures get lazy and just target the loader rather than the payload.

I'm just happy these demos run with DEP enabled.

TROJAN?! (0, Insightful)

Anonymous Coward | more than 5 years ago | (#28757037)

Downloaded the exe.

Tried to run.

SAM quarantined the file, claiming it contains a trojan.

Damn! Photo-realistic rendering -and- a trojan in 4kb? _THAT_ is impressive!

Re:TROJAN?! (4, Funny)

Ilgaz (86384) | more than 5 years ago | (#28757165)

Funny is 4 KB app manages to do HDTV and your AV solution being thousands (if not millions) times bigger can't figure the difference between a trojan and packed executable. That is in case it is even packed.

Re:TROJAN?! (1, Insightful)

Anonymous Coward | more than 5 years ago | (#28757177)

All that means is that your antivirus software sucks.

Re:TROJAN?! (0)

Anonymous Coward | more than 5 years ago | (#28757291)

...OR that it really contains a trojan. Be careful downloading stuff from the Internet.

Re:TROJAN?! (0)

Anonymous Coward | more than 5 years ago | (#28757823)

Nope [virustotal.com] . Only 12 out of 41 and none of the high quality ones detect it as a trojan.

Re:TROJAN?! (0)

Anonymous Coward | more than 5 years ago | (#28758433)

None of the larger demo groups would risk their fame and fortune by including a trojan. These demo's are safer than online banking.

Wow (4, Funny)

Lord Byron II (671689) | more than 5 years ago | (#28757105)

It takes a 64MB avi to store the 4KB demo!

Cheating (0, Interesting)

Anonymous Coward | more than 5 years ago | (#28757121)

I assume that 4K doesn't include the 3D libraries they used. It's still impressive but 4k of code can create a lot of procedural graphics if you have a few megs of graphics libraries to display it.

Re:Cheating (2, Insightful)

hattig (47930) | more than 5 years ago | (#28757419)

Indeed, it's not exactly hitting the hardware at a register level like all the proper old-school 8/16/32 bit demos in the 80s and 90s.

It's an OpenGL or DirectX demo at best, not a hardware demo.

It is still impressive of course. Especially when you consider the music engine that's taking up some of that 4KB.

Re:Cheating (2, Insightful)

Goaway (82658) | more than 5 years ago | (#28758167)

Ok, you go do it and show us all how easy it is.

I wish (3, Insightful)

Khyber (864651) | more than 5 years ago | (#28757149)

I wish more developers would try doing things like this. I can imagine a game along the designs of Doom3 or Quake4 that would fit on a floppy disc with some proper code crunching.

Of course, the downside is that it'd be all too easy to snag tiny files like that on a torrent site.

Re:I wish (1)

ground.zero.612 (1563557) | more than 5 years ago | (#28757187)

You mean like Cube?

Re:I wish (5, Informative)

molukki (980837) | more than 5 years ago | (#28757201)

Try .kkrieger [theprodukkt.com] -- FPS game in 96kB

Re:I wish (1)

cadu (876004) | more than 5 years ago | (#28757299)

downside? o_O

Re:I wish (4, Interesting)

slim (1652) | more than 5 years ago | (#28757333)

Try Left 4K Dead [mojang.com]

The fact is that cramming a lot of game into a small space is still worth doing.

  • Flash games sites have bandwidth costs
  • Console gamers develop high expectations as the hardware reaches the end of its lifecycle, and developers compete to squeeze more out of it

Re:I wish (1)

CannonballHead (842625) | more than 5 years ago | (#28757345)

One problem that is easily foreseeable: this would require very distinct and very specific libraries to be installed on all computers you want it to run on. That may work if all you use is DirectX, but if you use any other libraries of code... well, this really severely limits it. (example: I the exe I downloaded for the 4k demo crashed).

I would rather have to have an entire CD (incidentally, I wouldn't be able to use a floppy anymore) and be able to run it without downloading this, that, and one other library. :)

Re:I wish (2, Insightful)

RobVB (1566105) | more than 5 years ago | (#28757383)

Of course, the downside is that it'd be all too easy to snag tiny files like that on a torrent site.

That, and games would take 4 hours to start on today's processors.

Re:I wish (1)

Hatta (162192) | more than 5 years ago | (#28757489)

Would libraries on the host system count? I can see how it would be easy to make a really small game, if you have hundreds of megabytes of libraries on the host system to leverage. Much harder if you have to do it all from scratch. What are the rules for these kinds of things?

Re:I wish (1)

Knos (30446) | more than 5 years ago | (#28757715)

No extra download on top of a fresh installation of your (proprietary) OS.

On linux, it's much harder to define what's in and what's not, so it's a genuinely less interesting playing field for competitions.

Roboblitz does this (1)

Bieeanda (961632) | more than 5 years ago | (#28757505)

An indie game titled 'Roboblitz' uses procedural generation to 'unpack' game textures the first time the game is run. It makes the installer smaller, but the unpacking process is still time- and processor-intensive. It saves transmission bandwidth, but doesn't do the end user any other favours.

Re:I wish (1)

somersault (912633) | more than 5 years ago | (#28757593)

It's already easy to snag gigabytes of stuff on a torrent site, I doubt making games smaller is going to make people any more inclined to pirate them unless they were truly gargantuan to begin with.. besides, having all your games generate the levels, characters, animations, sounds, AI etc procedurally would create some rather annoying loading times - not worth it unless you then save the uncompressed game so you don't have to go through the same procedure every time you run the game.

No, they wouldn't (4, Insightful)

Sycraft-fu (314770) | more than 5 years ago | (#28757695)

While demos like this are extremely neat, there are also some real limitations to what you can do. This is by no means an all inclusive list but some of the major limitations of making something like this:

1) All graphics are completely procedural, as in mathematically described. That means you don't get to have an artist sit down and draw them. Puts limits on how they can look and demands a fair bit of self similarity.

2) You use a MASSIVE amount of memory in relation to your file size. You may have noticed it sits at a black screen for a bit before running. Why? It is doing all its calculations, decompressing in to memory. When running on my system, it took 350MB. Rather than storing lots on disk and streaming as needed, you store little on disk and have to use tons of RAM.

3) You can't have things like voices and such in the game, takes too much space. Even with extremely efficient compression (which produces audible artifacts) voices will quickly make your game larger.

4) All assembly coding. To do this, you are writing everything as efficient as you can. That's wonderful, but hard to maintain. For a large project that is going to need to run on a lot of systems, be patched and so on, you want a higher level language. Doing everything in assembly would be a nightmare to maintain.

I could go on, this is just an example. What it comes down to is that this is neat for demos. I -love- stuff like this, Farbrausch is one of my favourties for this sort of thing. However it is not a realistic exercise for normal applications. You do not want to sacrifice everything just to try and have a small program footprint. On the contrary, if increasing the on disk size makes it better or more efficient, then you want to do that. Disk space is extremely cheap. Better to use more of it than to sacrifice in another area.

Re:No, they wouldn't (1)

rbarreira (836272) | more than 5 years ago | (#28759319)

RAM comsumption isn't bigger than for other games. With more CPU power it should be possible to generate more things on the fly as opposed to precomputing them, reducing RAM comsumption.

As for voices, I guess we just have to wait for better text-to-voice synthesis algorithms.

Re:No, they wouldn't (1)

gencha (1020671) | more than 5 years ago | (#28759331)

You don't write everything in assembly. A common technique today is write the whole content in a single pixel shader in the shader language that suits you best.
And even writing intros in C or C++ is very common.

This doesn't mean I disagree with the notion of your post ;)

Re:I wish (1)

HalAtWork (926717) | more than 5 years ago | (#28758015)

Try out .kkreiger [kk.kema.at] from farbrausch/.theprodukkt [theprodukkt.com] . It's a first person shooter in 96k.

YouTube version (5, Informative)

slim (1652) | more than 5 years ago | (#28757213)

I strongly suspect my video card won't be up to this, so I seeked out a capture of it on youtube:

http://www.youtube.com/watch?v=_YWMGuh15nE [youtube.com]

Re:YouTube version (4, Funny)

odin84gk (1162545) | more than 5 years ago | (#28758057)

Wouldn't it be more appropriate to post a tinyurl than the direct youtube link?

Re:YouTube version (2, Insightful)

Anonymous Coward | more than 5 years ago | (#28758827)

Wouldn't it be more appropriate to post a tinyurl than the direct youtube link?

no, because then you wouldn't know what you are clicking on

Re:YouTube version (1)

anonymous donor (1440447) | more than 5 years ago | (#28758971)

Not sure if you are just trolling, but just in case: NO!

Re:YouTube version (1)

MooUK (905450) | more than 5 years ago | (#28758137)

I watched the YouTube version, and all I can say is... fuck me, that's incredible.

Re:YouTube version (1)

oneofthose (1309131) | more than 5 years ago | (#28758911)

Thank you for that link. Now let's compress that video back to 4kb.

For those w/o Windows - video (3, Informative)

Maxmin (921568) | more than 5 years ago | (#28757215)

Elevated by RGBA and TBC [youtube.com] .

Impressive, though it seems the demo scene has evolved to include the use of platform libraries (graphics/synthesizer.) Impressive anyways - I'm assuming the imagery is all algorithmic.

When I last paid attention to demos, it seemed to be all in the executable, code dealing directly with hardware.

Re:For those w/o Windows - video (0)

Anonymous Coward | more than 5 years ago | (#28757385)

Unfortunately, that's not really possible with modern hardware anymore. The only way to access fancy features like shaders is through the driver's API.

Re:For those w/o Windows - video (2, Insightful)

fishbowl (7759) | more than 5 years ago | (#28757507)

>The only way to access fancy features like shaders is through the driver's API.

The API gets there somehow other than magic.

Re:For those w/o Windows - video (1)

Goaway (82658) | more than 5 years ago | (#28758227)

Yes, through a secret and hardware-specific way. Not exactly very useful for anybody else.

Re:For those w/o Windows - video (3, Insightful)

Maxmin (921568) | more than 5 years ago | (#28757425)

On second viewing, two things come to mind:

1) the opening scene from LOTR: The Two Towers, an amazing piece of design and rendering.

2) Audio player visualizations. The giveaway is the contrails appearing in sync to the music.

Is it possible RGBA are using a built-in visualization library, possibly from WMP? That would explain the high level of detail and apparent use of texture maps, which I'm guessing wouldn't fit into 4kb, algorithmic or not.

This (admittedly weak) theory can be verified by disabling the visualization library for Windows Media Player [techspot.com] .

Anyone want to volunteer to verify this?

Re:For those w/o Windows - video (0)

Goaway (82658) | more than 5 years ago | (#28758249)

Is it possible RGBA are using a built-in visualization library, possibly from WMP?

No, that is a stupid idea.

Re:For those w/o Windows - video (-1, Flamebait)

Maxmin (921568) | more than 5 years ago | (#28759139)

Stupid is /. commenters arguing over whether 4k means 4 kilobits or 4 kilobytes, or if the 4K file is source or executable! And not so much stupid as naive.

Stupid is believing that RGBA could possibly fit what they did -high-detail 3D rendering with textures, ray-tracing, atmospheric effects and camera motion, plus synthesized audio- into a 4KB executable, with no supporting libraries other than common Windows hardware device drivers.

Just. Not. Possible. Come up with a plausible explanation and I'm all ears.

Re:For those w/o Windows - video (1)

Dr. Impossible (1580675) | more than 5 years ago | (#28757571)

The only thing that makes this impressive is that it fits into 4 kilobytes. As a 3D engine it's otherwise nothing special, and it's quite boring to watch. Not nearly as interesting as, say, Sequential [youtube.com] .

Re:For those w/o Windows - video (1)

Maxmin (921568) | more than 5 years ago | (#28758399)

Yeah, and Elevated *has* to be using platform libraries, no way to fit such detailed 3d rendering and audio into 4k. Probably just high-level invocations of Win/WMP libraries, though impressive they fit that much direction into so little space.

Sequential - very nice. Any idea how big the program is?

Not 4k! (-1, Flamebait)

Anonymous Coward | more than 5 years ago | (#28757245)

Did they forget to include the 300MB of code that actually draws all this amazing stuff on screen. I don't think a 4k demo was meant to be: draw.directx.3Dcircle(98,98), move 200,300; render.directx.3Dcircle,(Built in directx texture 22), shade; coolbuilding.directx.raytrace(); I think it's kinda silly to call these 4K demoes. I know people argue, but really 4K demos use to be ALL the code to do a cool demo, including not just the sound files, but the entire code for the player too. Now a 4k demo is list of command for some 300MB library to execute. The 4K demos today are more like a .bat script, not like it use to be which was "AMAZING! How did they fit ALL that Code, Graphics, and sound into 4K??!!?"

I agree (2, Funny)

DahGhostfacedFiddlah (470393) | more than 5 years ago | (#28758769)

I was still impressed, but the demo is heavily dependent on existing libraries. If there were an OpenGL function to draw_glorious_mountainscape_and_fly_around_it_while_playing_majestic_music(), they could have packed this into less than 100 bytes.

Youtube video of demo (-1, Redundant)

Anonymous Coward | more than 5 years ago | (#28757301)

Here is a youtube video of the demo;

http://www.youtube.com/watch?v=ro5grR_efG0

Complete with applause and cheers! :) Must have been nice watching it live!

Worm (-1, Redundant)

Anonymous Coward | more than 5 years ago | (#28757321)

Suspicious#kkrunchy (Worm) in file rgba_195_95_256.zip

Meh (2, Insightful)

abigsmurf (919188) | more than 5 years ago | (#28757359)

I don't deny these demos are impressive but the fact they use existing libraries lessens the achievement for me.

When DirectX basically has it's own 3D engine, you're basically turning the task of creating a demo into generating sounds, textures and models from formulae.

Libraries used should be limited to the minimum needed to create a window or change the display mode and shouldn't do any real grunt work or, there should be a second metric of RAM and swap files used.

Re:Meh (1)

Knos (30446) | more than 5 years ago | (#28757687)

It seems to me you would also forbid a demo to use a 3d accelerator in the name of having a metric you can understand.

That's alright, but that's not really pushing your hardware to its extents.

Re:Meh (0)

Anonymous Coward | more than 5 years ago | (#28757691)


echo "int main(){printf('Hello World');}" > test.c
gcc -Os -o test test.c
strip test
wc -c test

With gcc 4.3.3 the result is an executable 2928 bytes long. So you have 4000-2928=1072 (in case a Kb means 4000 bytes, not 4096) bytes to generate textures, music, terrain, etc. Yes, the instruction set of the x86 is very compact, but taking into account library symbols (which I guess are put into the executable in the plt section, as GNU binutils does) and generation data, it is very impressive.

Re:Meh (1)

kyz (225372) | more than 5 years ago | (#28758165)

Well, you're really wasting space there. With a default compile and link, you've included crt0.o which sets up the default C environment, and sections to command the dynamic linker to link in references to printf().

If you read this tutorial on the ELF format [muppetlabs.com] , you'll find the smallest valid Linux x86 ELF file that sucessfully does nothing is 368 bytes (although this demo is for Windows, so will be using the Portable Executable [wikipedia.org] format instead). So you have far more code space to play with.

There are other tricks; usually the thing is packed with a code compressor, as even tightly-written code is likely to have some redundancy. I haven't looked at this one, but it's likely that 4kb executable is the result of an exe-packer packing a 5kb-10kb executable.

The famous production people usually refer to when it comes to small files with procedurally generated graphics is .the .product [theproduct.de] by farbrausch. If you read that site, you'll find out many of the tips and tricks that can be used to really pack down the size of executables and still make amazing 3d scenes.

Re:Meh (1)

mobby_6kl (668092) | more than 5 years ago | (#28757915)

Yeah, I'll have to agree. It's still impressive, but when using DirectX it just isn't the same. I don't have the D3D SDK installed now, but I recall it was possible to get a teapot to render in a few lines of code, so I'd think by not including any dependencies in the binary the filesize could be very small without getting into any extreme measures.
  A few more things:

  • The demos don't work on 64bit Win7, whether in XP compatibility or not.
  • They can cram HD graphics in 4Kb, but can't make a website without iframes?
  • There are separate binaries for each resolution, but nothing for 1680x1050 :(

Re:Meh (0)

Anonymous Coward | more than 5 years ago | (#28758435)

I recall it was possible to get a teapot to render in a few lines of code

Now if only they can get the Stanford Bunny [gatech.edu] to spin around and render in a multitude of ways with only 4Kb... Would that be impressive?

Re:Meh (4, Interesting)

ivoras (455934) | more than 5 years ago | (#28758347)

No, it just raises the bar. Back when all you had to work with was CGA in 320x200 it was impressive to show a rotating cube in 4k. Today, this demo nicely shows where the virtual bar is when even considering making a 4k demo. As you couldn't do "Elevated" on your 100 MHz 486 in *no* condition or with any libraries, so would you be laughed at if you presented a rotating cube or a wormhole today.

Here's an excerpt from TFA:

for those wondering, this a (too) low density flat mesh displaced with a procedural vertex shader. there arent any texturemaps for texturing, instead texturing (and shading) is defferred and computed procedurally in a full screen quad. this means there is zero overdraw for the quite expensive material at the cost of a single geometry pass. then another second full screen quad computes the motion blur. camera movements are computed by a shader too and not in the cpu, as only the gpu knows the procedural definition of the landscape.

If you can do better, show your work :)

News? (0)

Anonymous Coward | more than 5 years ago | (#28757437)

!news == olds

libraries (5, Insightful)

Anonymous Coward | more than 5 years ago | (#28757487)

Everyone going on here about how stupid it is that they used existing libraries mind you that typical compo rules state that it must run on a base install. Nobody here is linking to myuberleetcode.dll or anything. That and think about the freaking sound for a second or better yet try and write a 4k and then come back and talk about how stupid it is

Re:libraries (1)

noidentity (188756) | more than 5 years ago | (#28758697)

You said basically what I was going to say. Unlike the demos of a decade ago, these can use 3D libraries and music playback, so all this is doing is providing some 3D models (most likely algorithmically generated), textures, and some music sequence data (very likely using MIDI instrument sets that are built into the OS, or something similar). The ones from ages ago had their own 3D and music engines built in, outputting finished images to the framebuffer and sound to the playback buffer.

It's not only about techinical skill (2, Insightful)

Anonymous Coward | more than 5 years ago | (#28757533)

While i certainly admire the technical skill involved, the demoscene is more than that. It's a form of art.

Just look at http://www.pouet.net/prod.php?which=31571 [pouet.net]

Damn! (0)

Anonymous Coward | more than 5 years ago | (#28757539)

This pushed me over my Comcast cap!

the memory used by one of your PC's deskop icons (-1, Offtopic)

Culture20 (968837) | more than 5 years ago | (#28757635)

which fits into the memory used by one of your PC's desktop icons.

I use Gnome, you insensitive bastard!

Re:the memory used by one of your PC's deskop icon (-1, Offtopic)

Anonymous Coward | more than 5 years ago | (#28758495)

Too obscure.

Re:the memory used by one of your PC's deskop icon (0, Offtopic)

Culture20 (968837) | more than 5 years ago | (#28758591)

Too obscure.

For /.?

finally! (1)

Possan (1601927) | more than 5 years ago | (#28757769)

finally some more demoscene stories! keep em coming!

Re:finally! (3, Insightful)

Goaway (82658) | more than 5 years ago | (#28758345)

No, don't. Then we'll have to listen to the "THEY JUST USED BUILT-IN DIRECTX FUNCTIONS FOR THIS THEY TOTALLY SUCK" crowd all over again. There's no lack of people around here who don't have a single clue what it takes to do something like that, but will yak on and on about how it is nothing impressive.

Interesting, but... (0)

Anonymous Coward | more than 5 years ago | (#28757933)

It won't run in Wine...

AVG Virus Scan... (-1, Flamebait)

Qybix (103935) | more than 5 years ago | (#28757985)

Well, I don't know about you folks, but the first thing that I did was download the programs in Mac OSX and the scan them from windows in Parallels Desktop using AVG... The results were horrendous! Every file has a virus. EVERY FILE. Check your computers people... I am so glad that I only run windows in emulation these days! This could be a false positive, but I doubt it.

Qybix

Re:AVG Virus Scan... (1)

^_^x (178540) | more than 5 years ago | (#28758195)

Hard to say... most demos by Farbrausch will trigger virus scanners due to some of the algorithms they use, but they're actually safe.

Demo doesn't run on at least one Win system (-1, Troll)

MSTCrow5429 (642744) | more than 5 years ago | (#28758527)

Um, pretty amazing, it's appears incapable of running in Vista Business SP1, and attempting to run it results in a "elevated_%resolution%.exe has stopped working" error message. Don't know anyone who is going to bother to troubleshoot a demo, and kind of annoying that a 4KB program is so buggy and/or badly written that it can't run.

Luxury! (1)

argent (18001) | more than 5 years ago | (#28758789)

Elevated is packed down into a 4k package, but it clearly uses many many times that space when it runs. That's practically cheating... a real 4k demo would run in 4k of memory, total, usually including the screen buffer.

When we did our entry for the BADGE killer demo contest in the '80s (a version of Lunar Lander that ran on the Amiga workbench and required you to land on top of your open windows) I felt we were already pushing the envelope of what was really "fair", since we were getting the "terrain" for free.

Re:Luxury! (0)

Anonymous Coward | more than 5 years ago | (#28758909)

Ok, and how large was badge? I'm checking pouet and cannot find it. What was the party?

Re:Luxury! (1)

argent (18001) | more than 5 years ago | (#28759393)

Never heard of pouet, and never been to a demo party, but Google brings up the first BADGE killer demo contest [pouet.net] . Badge was the Bay Area Amiga Developer's Group (don't ask me about the acronym). Our unimpressive demo was entered in one of the later contests.

I'm not much of a hardcore demo hacker, but I am a hardcore real-time programmer who started on a machine with less than 512 bytes (that's just plain bytes, not kilo, mega, or giga bytes) of memory. So when I see someone talking about fitting something into 4k, I expect to see something running in 4k. :D

Link (4, Funny)

eulernet (1132389) | more than 5 years ago | (#28759085)

Torrent anyone ?

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>