by bayindirh · 3y ago · 0 comments
I remember watching Farbrausch's "fr-08 .the .produkt" [0] when it came out and telling myself "If a computer can do this with 64KB of data, at this speed, my programs should be able to do the same, or at least shall be close". I was forever poisoned at this point, and this simple sentence shaped my whole academic life and career.
[0]: https://www.pouet.net/prod.php?which=1221
P.S.: Rewatching it, again, for the nth time. Hats off to chaos, fiver2, kb, doj, ryg & yoda.
P.P.S: I show people YouTube version of Elevated (https://www.pouet.net/prod.php?which=52938), and ask them to guess the binary size rendering this thing in real time. The answer blows everyone's mind, every time.
If you like that kind of "compression", I hope you know Linus "lft" Åkesson's "A Mind Is Born": 256 bytes.
This demo is more on the side of "do magic and observe output", rather than "let's make something looking normal in an impossible way" (i.e: elevated) or "let's make something impossible possible" (i.e. 8088 MPH [0]).
All three kinds are equally impressive in my book, yet I prefer the latter ones more.
My main takeaway from Demoscene is not "compression", but the possibility of writing code which performs very well, and what I found is, it's not very hard to do at the end of the day. You just have to be mindful about what you're doing, and how that thing called computer works under the hood.
Compression is still a big part of it, just not in the "take the original data, minimize it and reproduce it later" sense of the word. The procedural generation employed by these demos is still a form of compression: the highly-specialized decompressor needs only a few bytes of information to create the intended effect (texture or shape).
If anything, it shows how much compression can be achieved if the decompressor can be tuned to the data domain, as opposed to general-purpose compression algorithms.
In the case of the Farbrausch procedural generation, a chaining of parametrized modules creates the textures etc. - as those who have played with their generation system, ".werkkzeug", know directly ( .werkkzeug1, 2004: https://www.pouet.net/prod.php?which=12511 ; .werkkzeug4, 2019? : https://www.pouet.net/prod_nfo.php?which=91144 )
In the case of flt's "A mind is born", several efficiency techniques are used - overlapping of palette and SID registers etc., but especially notable could be that the melody is generated by a sequence-after-seed process (Linear-Feedback Shift Register), where the seed is chosen so that a good melody is returned ( full explanation of the code: https://linusakesson.net/scene/a-mind-is-born/ )
This 100%. It's not exclusive to demoscene, but demoscene is certainly yet another inspiration to write lean apps. (The performance of Electron is another :) )
I'll never ever be able to work for an AAA game company because I couldn't stomach dumping 100GB of raw texture data onto someone's hard drive.
Not a knock on demos at all! (the originals handed around on floppy disks also inspired me to become a coder in the early 90s). Just saying that it's different to try to make the most amazing thing you can in a wide open 4k than it is to start with something 16k and try to reduce it.
Hence the bunny quotes. Not really «mak[ing] something extremely small», the idea is to pack as much wonder value as achievable in as as little resources as possible.
You can use 'compress', as long as the need to interpret as needed is held - the term is legitimate for the idea of e.g. "pressing together" what would normally be the content of a wardrobe in a suitcase.
https://www.youtube.com/watch?v=m7iuFVmTJus
>You can take any piece of content in the game, and imagine an algorithmic solution to it. Or also, you know, a way that the player could customize that object of thing.
>There's this group in Europe called the Demoscene that make these very elaborate demos for a computer that fit into very tiny little memory blocks, you know like 64K of memory, and you run the thing, and in fact it algorithmically generates about 100 megabytes worth of data, you know these rich 3D environment, generated music, generated wave files, generated animation.
>And they're developing techniques to generate, you know, huge amounts of interesting data, with very very simple, elegant, compression algorithms.
>And this is a skill that game developers used to have, back in the 8-bit days. That was the only ways to do a game like Karateka(?), was to find all these little tips and tricks to compress things and generate them algorithmically.
>But since the CD-ROM came out, and very cheap hard drives, storage is cheap, so basically we've lost that skill set, and now we attack all those problems with brute force. I think we've lost something by dropping that skill set.
The Future of Content — Will Wright’s Spore Demo at GDC 3/11/2005: What I learned about content from the Sims. …and why it’s driven me to procedural methods. …And what I now plan to do with them. Talk by Will Wright, Game Developers Conference, 3/11/2005.
https://donhopkins.medium.com/the-future-of-content-will-wri...
>Algorithmic compression.
>Games consist of a mix of code and data. Computers use code to compress data. The ratio of code to data has changed over time.
>Games used to be mostly code and very little content, so compression was important.
>CDROM is the medium that was the death knell for the algorithm.
>Myst was a very elaborate and beautiful slide show, with a vast amount of data. It looked like they had a great time building this world. Building the world is a fun game in itself.
>At the other end of the spectrum from CDROMs: The Demo Scene. Algorithmic compression of graphics and music.
Will Wright GDC 2005 Spore (The Future of Content) Remastered: 6:18
More info in the extended cut starting at this timestamp: https://youtu.be/5qxg0ykOcgM?t=3465
The costs now run the other way, in fact. If you viewed the main benefit of procedural systems as compression, you're much better off saving the compute cost and just pre-generating and streaming terabytes worth of game assets. (Arguably, Spore could have even benefited from such an approach). The lasting benefit of the procedural is that whoever plays it gets a truly unique experience that no one has seen before, or will see again.
Anecdotally, my Pentium 3 machine (forgot what GPU it had, sadly) back in 2004 was struggling with most modern (for the time period) games that had even a hint of graphical fidelity. Max Payne 2, on the other hand, looked mindblowing and ran like butter.
One interesting VGA hardware effect in this context which I have not seen in any demo, is to change the character width from 8 to 9 pixels _during_ a horizontal scanline. The trick is to use RDTSC to estimate the pixel position, with which you can create a nice wobble effect in text mode. Obviously, this requires a Pentium or higher, and at the time this became possible, text mode was rather outdated.
And don’t forget scream tracker 3 ! ( which is actually how I discovered the demoscene)
The GPU powered demos are impressive in a different way.
Clearly there was a little more space they could have eeked out!
Considering ZIP normally uses deflate, which is LZ77 + huffman. LZ77 is super simple and can be implemented in ~30 bytes of code. Huffman tables are fairly simple, but I can't easily visualize some assembly instructions to implement them, however arithmetic coding in all cases exceeds huffman's performance, and can be implemented in about 60 bytes of code. Total = 90 bytes to save 2 kilobytes. Seems worth it.
Note that both these decompressors will be awfully slow, but for just 64 kilobytes of input data I don't think that'll be an issue.
I've seen movie CG that looks way way shittier, that's ten years newer.
Demoscene stuff is fun, and cool, but it's a hobby. It doesn't reflect how software is developed and deployed in the real world.
You're right, when developing a product, the goal is to deliver the product and value, however a programmer who likes their job doesn't develop products all the time, they also improve themselves.
What I found is, studying "The Machine" and its details, and trying to write exceptional code, improves the "daily, mundane" code, too. Because you know what to do, and how to do it better.
In other words, if Demoscene is F1 racing, and you have the chops to design vehicles which can compete there, the technology you develop trickles down to your road-going designs, and improve them, too.
While I was writing my Ph.D. code, knowing the peculiarities of the machine allowed me to write very efficient and fast code in the first go, and the code can saturate the machine it's running on extremely well. To put in context, I was able to evaluate 1.7 million adaptive Gaussian integrations per second, per (3rd generation Intel i7) core. That code scales almost linearly until memory controller chokes because of the traffic (incidentally this happens after I saturate all the cores).
This code has no special optimizations. A single, naive, multithreaded implementation which I spent half a day designing it, that's all. There are all kinds of optimizations I can do to speed this a bit further, but since it's fast enough, I didn't bother.
At the end of the day, I'm an HPC sysadmin and developer. I inhale hardware and exhale performance. While there's a value to be delivered, it's extreme speed in my case. Because that speed saves days in research time, not milliseconds.
A rubbish hammer may be e.g. «useful» for some dozen bangs in a few weeks, then crumble. A rubbish item will have compromises. A "good" product will be masterful and optimal for function, less compromising for the demanding user.
The title says 4kb, but I assume it's 4KB, which is impressive but not mind blowing for a procedurally generated landscape.
So it's either 4kB (4000 bytes) or 4KiB (4096 bytes).
why throughput is bits and storage is bytes I might never understand, probably has something to do with baud
It might not be the most impressive demo tech-wise, but it's one of the best executed ones, and it matters.
Also it's the second most loved prod in pouet.net, which means something.