Classicamiga Forum Retro Edition
Thread: 4KB intro - Demoscene
Tiago 15:17 27th April 2011
Yesterday i watched some demos from scene.org.
I pay attention to the awards at 4KB intro.

OMG

4KB ... 4Kbytes
so... 1KB=1024Bytes
4KB = 4096 bytes...

1 character from our keyboad is 1 byte correct?
So 4096 bytes is basicly keypress 4096 times.
How the hell they do those demos with 4096 bytes ????????

I know they use a lot of maths. If they want to put a tringle in screen they can use functions like sen and cos of an angle, if they want to move the triangle, they put maybe a function like do-while or while-until or other to give a variable many values along time, so the tringule will be draw in multiple positins on screen...
Using tecnics like sprites or any other stufff, 4096 is mad...

Are they all in assembler? Or they use "C" ?
I guess under Amiga they use Sprites a lot, and under windows they call funtions of direct x using the graphics card internal instructions....
anyone saw the code for one? not talking about opening the file, but looking at the code before compile?

I remember when i try to do basic draws in "C" it took 5 or 6 lines just to set the graphic mode... that would be more then 150 bytes just to set the screen...
[Reply]
Harrison 15:36 27th April 2011
Different groups use different languages and techniques, but most tend to use assembler I think.

The 4K intros can definitely blow you away with what they can fit into them, with the Amiga and PC ones deliver some amazing results to the strengths of their hardware. And if you watch the slightly larger releases like the 16K and even 64K ones they still leave you wondering how the hell they did it.

I do know that for any 3D stuff they use procedural textures, so no real image texture maps exist, it is all created from code, which helps make it much smaller. One great example of this is the FPS demo create by Farbrausch on the PC, which generated a full procedural textured 3D world that was playable just like any FPS, and it was 90KB total size. That was amazing.

This coding for the demoscene also shows how bloated today's Games and software has become. But it also allows coders to perfect techniques that can then be used on platforms that don't have the luxury of large storage spaces, such as mobile phones and handheld consoles. For these, having techniques developers in such small file sizes allows developers to fit huge games onto relatively small media or downloads. Quite amazing.
[Reply]
Stephen Coates 16:50 27th April 2011
Wisecracker showed us a demo for Windows on his laptop at LAG a couple of years ago. I can't remember how big it was but it was one of those tiny ones.

It was cool.

I'll have to have a look at some Amiga ones.
[Reply]
Tiago 17:16 27th April 2011
I allways like this kind of stuff, creating graphics with maths is something quite cool.
I guess in PC/windows they use functions that the graphic cards have in their chips, but not for the Amiga.

Example if you want to draw 3D in "C" without using direct x/opengl etc... you must calculate the Z axe, C only know what is X and Y, so
if you want to put a dot in x,y,z 10,10,00 you have to calculate the Z in terms of X,Y:

X,Y,Z will be tranformed in pure X,Y,

some time ago i try to draw a cube using this simple method,
to each Z i did:

sen30 = 0.5
cos30 = 0,86

So x,y,Z lets say 10,10,10
if you want to draw that on screen with a 30 perspective bottom/top and left/right



sen30=opp/hyp
cos30=add/hyp

then
opp (vertical) will be y
add (horizontal)will be x

then
zy = sen30 x hyp
hyp = 10
zy = 0,5*10 = 5

zx = cos30 x hyp
hyp = 10
zx = 0,86*10 = 8.6

so, 10,10,10
will be draw at:
x-zx , y-zy
10-8.6 , 10-5
1.4,5


If you want 45 perspective, it will be: (sin45=cos45)
7.07 , 7.07



But it will not work correctly, because the face near you will have the same size as the one far from you...
but the result is not bad...

anyone did anything similar with basic funcions to draw manualy?
[Reply]
Teho 19:19 27th April 2011
Originally Posted by Tiago:
1 character from our keyboad is 1 byte correct?
So 4096 bytes is basicly keypress 4096 times.
How the hell they do those demos with 4096 bytes ????????
Keep in mind that these are efficiently compressed and usually are around 16KB uncompressed. You'll often find releases with uncompressed "safe" executables alongside the competition version that meets the 4K criteria, because of unstability issues with the heavy compression routines used or just to shorten a long load-time on older systems. Not that that isn't still impressive.
[Reply]
Tags:Array
Up