Jump to content

Incredible


Aralez

Recommended Posts

Try the demo "Chaos Theory" from this site: https://conspiracy.hu/releases.php

Don't worry, it's 64kb (!!!!!!) only. After a loading animation a video/audio poart begins. See it for yourself and explain to me how they packed all that stuff in such a tiny file ?!

 

if you don't trust links to small exes (and you really shouldn't!) you can always use the free online virusscanner here to test downloaded files: https://virusscan.jotti.org/

 

I watched that thing 3 times now and still don't understand how they did it. :D

 

64kb, that's the size of an forum Avatar pic, how on earth... :D

Link to comment
Share on other sites

The "usual" method of programming is to write source code (which is vagually readible by even a non-coder, as it loosely follows english grammar) and have a compiler convert this to computer code (in which each command is converted into a seemingly abstract series of bits and bytes).

 

This process makes programming a lot easier but has the side effect of serious inefficiency. Commands the user enters are defined at length, and when converted to binary often drag along all sorts of miscellanous data that the program doesn't specifically need.

 

Furthermore the compiler will often add extra data in the form of error recovery code.

 

The method to making "really small programs" involves writing via opcodes, or assembly - Even directly with a hex editer. It takes a lot longer as you can't just say "shove this text on the screen" (as you would when writing source code, knowing that the computer will convert this instruction into the codes required to perform the operation). Instead you have to manually tell the computer how to do it, in terms it understands.

 

This means you can be precise in your instructions.

 

The next step is to condense your resources. You can usually trade file sizes for processing time, and vice versa. For example, when creating a 3D scene that uses textures, you can either create image files containing the textures, or you can provide alogarithms for making the images and let the computer generate the images themselves at run time. This slows the program down considerably, so in mainstream coding this is unpopular. It can shrink code down enourmously however.

 

The same principle is present with 3D graphics - Instead of storing a ton of sprites, you give details on a 3D model, and the computer can generate trillions of different images based on just a few kilobytes. In the case of this demo, they go a step further by making the models symetrical (meaning it's one smaller model duplicated and combined in order to create a larger end result).

 

A similar process can be applied to music, and is probably best described in terms of WAV, MP3, and MID files. WAVs contain a direct copy of a sound wave. They contain a recording of sound, including any irregularities in the stream (such as scratching noises or a car outside). You get near perfect playback of the original sound wave, but the file size is huge.

 

Then you have MP3 files. The most notable thing about these is that they disclude ten elevenths of the frequency ranges of WAV files (on the basis that humans can't hear the sounds in those ranges). Throw in a little compression, and you've got a far smaller file size.

 

MID files make either format look huge. They simply contain the instructions to play the music, no actual sounds. Because of this it's near impossible to create MID files with vocals, but the playback will always be perfect (as no sound is ever recorded and the music is created from scratch is time the file is played, no scratches ever get into it). MID files contain no sounds at all so it's up to the computer to work out how each instrument is to be played. Hence different systems will provide different results with the same files.

 

MOD files are a bit dated now (and have probably been replaced by a similar format) but are probably what this program uses. You include audio samples of each of the instruments you want to use, and then follow the MID formula. The file size is a bit larger then MIDs (as you've included audio samples), but you still don't have to go overboard - You only include one note for each instrument. The computer then resamples these notes to all the different tones it wants to use. You could even use another algorithm to generate the notes, forcing the computer to do yet more work in order to generate them, but reducing file sizes yet again.

 

The final - and probably hardest - trick is to double up on data storage. You use code you're going to execute as data code to store audio and video. As a primitive example, say you need to store a number (3734543 for example) in your program. Instead of putting it in there, you look for a set of instructions you've already coded which happen to be represented by 3734543 and point at that. If it's not in there, tough, but when you're really scrimping for space...

 

That little program is really impressive in how far it goes. It's 64kb due to forcing a massive amount of work on the system that executes it. Windows had to extend my virtual memory file near the end of the loading process, and I have 512mb of RAM. Frame rate was quite jerky on my 1.5ghz processor (AMD 1800).

 

Oh, and your avatar is about 2kb by the way. :D We have a limit of 20kb by memory, and usually only animating files (like my own) come close to that.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

96k! And to think most game companies need several CD/DVDs worth of data just to provide textures and over-produced and over-acted cutscenes/voiceovers for their incredibly simple games, then you get these little gems. Must be some real heavy run-time work to generate everything like that, but that's still mighty impressive!

 

- NKF

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...