| Language: | C |
| Category: | Multimedia |
| Date: | 2008-08-29 |
| Author: | Automatic tester for WEB vulnerabilities |
Most of demos are created by teams, because nowadays it is very difficult, if not impossible, to create an impressive demo all on one's own. A demo creation process requires at least three professionals: a programmer, an graphic artist and a musician.
All these definitions of the demoscene, however, cannot be enough to convey the whole meaning of the concept, which extends way beyond such simple definitions. To fully understand it requires immersing into the history to see how this culture originated and has been subsequently developing. Only then you will be able to get the spirit of this really unique culture.
The modern demoscene has a lot in common with the game industry. This has to do with the fact that some programmers who started with creating demos are developing games in present time. The opposite also takes place: a game programmer may start as a demo developer or a demo developer start as a game developer. Game developer may start developing demos to realize himself or himself in a new area, give the brains a good workout be thinking graphics algorithms and optimizing code, or to promote their games.
The first demos for the PC platform were produced in the 1980s and contained video effects only. They had no audio, because back then not all PC were equipment with an audio card. Manufactures installed into their computers only a small speaker whose audio capabilities were limited to issuing beeps of different tones. Later, audio became an integral part of demos, and programmers created masterpiece even on the build-in speaker. When most of computers became equipped with an audio card, the audio quality improved dramatically.
Here, I can be accused of misrepresenting the facts, for even back in the 1980s there were computers capable of producing audio sufficiently good quality, far better then squeaking by the built-in speaker. These computers, however, were of the Amiga platform. Even though they had an important influence on the demoscene.
The first demos were usually created by software crackers or professional programmers. Demos created by crackers contained information information about cracker or the cracker group. Crackers inserted these demos into the cracked programs so that everyone could see who made the given piece of software available free-of-charge. These demos were extremely simple, because their requirement was to produce the greatest effect in terms of performance and aesthetics while taking up the least amount of memory. Crackers are considered the founders of the demoscene, at least for the PC platform.
Hackers expanded on the idea and started to create more complex demos as separate programs. The purpose of such demos is to impress the viewer and to demonstrate the singular power of the PC.
In the mid-1990s, I saw the Second Reality demo by Future Crew, created in 1993. Viewing it left me with a feeling of enchantment that could not be expressed in mere words. A 40-MHz 386 computer showed impressive effects and excellent audio. This was a whole video clip, with the graphics and audio harmoniously combined. The thing that really impressed me, however, was that such complex scenes could be calculated and rendered on such a low-power computer in real time.
Second Reality demo by Future Crew
I cannot say that Future Crew introduced a new generation of demos, but for me and many others this was the demo that changed our lives. Since then I have been taking keen interest in the demoscene in general and in graphics and graphics effects programming in particular. Now a demo clip is an opportunity for programmers not just to show their abilities but also to demonstrate to others the extraordinary capabilities of computers. The Second Reality demo combined 2D and 3D graphics that were astounding for those time with magnificent music; moreover, all this was achieved without using graphics accelerators.
From 1993 to 1995, the demoscene entered a new spiral in the 3D effects race. The introduction of the Pentium processor made it possible to produce more complex graphics and create new, real-time-calculated effects. Moreover, no graphics accelerators were used, without which any modern graphical game or graphics program cannot function.
I must admit that those demo clips played at rather low screen resolution, thereby saving lots of processors time. Nevertheless, creating even those effects required knowledge, skills, and efforts on the programmer's part. Even at low resolution, demos were spectacular because at that time 14-inch monitors were the standard, with most users being able only to dream of expensive 15-inch or 17-inch. Nowadays, many people can afford to enjoy 17-inch LCD which has much more bigger resolution. Viewing demos at 320x200 resolution on such displays will look like rough mosaics.
Most programmers (I’m too), cannot draw or make music; thus, artists and musician are required into the process of creating demo clips. To impress viewers, not to mention to win a competition, graphic effects, textures, audio, and video sequence must harmoniously combine. This is why creating demos ceased to be a part of lone talents and started require team efforts.
A computer performance has been increasing, so has the complexity of demos. Graphic libraries such as DirectX or OpenGL, make graphics programming easier. The appearance of graphics accelerators contributed to this development. Demos increasingly moved from the 2D into the 3D realm.
Some programmers kept pace with progress and continued perfecting their knowledge, skills and techniques. Others resisted. Thus, the demoscene broke into the following main areas:
In my opinion, demos of the first are the most difficult to create. It is very difficult to create a demo with a good and fit it into 64 kb executable file. The task is not easy even under MS-DOS, and it becomes even more difficult if the demo is to run under Windows. Nevertheless, programming hackers produce works of art. For example, a demo rather a graphic effect, called fr026 can be found on the www.scene.org site. The executable COM file is only 34 bytes, and the assembler source code fits on one page:
; fr-026: 34b mul+cycle (uc 6.22 size optimizing compo entry)
; 1st place
; code: ryg (original concept) & kb (additional opcode crunching)
;
; rules were to write a "colorcycling" (no real colorcycling was
; required, only colorcycling-like animation) effect that display
; a x * y-ish pattern somewhere on the screen. the palette was
; required to look like the original version.
org 256
mov al, 13h ; ...load al with 13h (mode number)
int 10h ; set mode 13h
mov bp, 320 ; screen is 320 pixels wide
x les ax, [bx] ; es = end of mem (9fffh), ax = 20cdh
cwd ; => dx = 0 (for idiv)
mov ax, di ; get dest address
idiv bp ; div by width => ax=y coord, dx=x coord
imul dx ; mul x by y
stosb ; store color in vram
mov dx, 3c9h ; dac data
bt cx, 6 ; bit 6 of cx => carry flag
salc ; set al from carry flag
xor ax, cx ;=> all this is functionally equivalent
; to something like
; "test al, 64" / "jz skip" / "not al" / "skip: blah"
; which should be somewhat easier understandable,
; but bigger.
out dx, al ; write grayscale pixel values
out dx, al
out dx, al
loop x ; pixel loop.
loop x ; skip cx = 0 to get the cycling effect!
; that's all there is to it.
; this is the 7th (or 8th) version; the first try was
; 49 bytes, from then on we successively made it smaller.
The listing shows the entire source code, but deleting the comments will reduce its size almost a half.
Demos using graphics accelerator can also be divided into several categories, with or without the limit on the size of the executable file. Nowadays, there are numerous types of demos: Flash, 3D Max, computer-generated digital images, or digital music.
It may seem that demo is just a video clip on a certain subject accompanied by a certain type of music. Taking the word clip to mean those pieces shown on MTV, only few of these can be considered demos. A demo is more than music-accompanied animation: it is a reflection of the author’s soul, mood, and state of mind. The person’s music preferences alone can tell you a lot about the soul and reveal character.
The most difficult aspect in creating demos is the programming, because to impress the viewer something incredibly stunning and wondrous must be created. For classic demos, you have to produce effects on a low-power computer that are only being announced by video accelerator manufacturers and won’t become hardware supported for a few years. Naturally, to do this, must have a good grasp of mathematics, especially of geometry, trigonometry, and matrix algebra.
Many people ask why graphics in demos are better than graphics in games. The answer is simple: demos and games are different. Demos do not require AI, and graphics in them displayed in a linier plot, which makes programming easier. Thus demos require less operating overhead and can perform more graphics calculations; games must process the AI of monsters and AI of the game.
Further information about demoscene may be found at the www.scene.org, which is probably largest demoscene site. This server has links to home pages of various demo groups, where they present their latest works. Work of most formerly and currently famous crews and lone demo authors can be found in ftp.scene.org ftp server. And if you are interested in checking works of professional crews, I recommend visiting ftp.scene.org/pub/demos/groups WEB site.
For a taste of professional demo, I suggest running the .kkriger program from the www.theprodukkt.com. This is a Quake style 3D game whose size, with all resources is less then 95 kb. The game is small and you can finish it in one day, but its graphics are of a quite acceptable quality and the size is impressive. See if you can create something similar to this demo.
.kkriger game
The developers of .kkriger spent a lot of time to optimize the code. I don’t have the source code and could not examine it with a debugger; thus; I cannot tell you what exact optimization techniques were used. I can, however, make a guess that the executable file was compressed with a tool similar to PECompact; that raster textures are generated programmatically on the fly, because the code for this method is shorter then store real textures; and that the lowest-quality audio was used in the sound effects.
Nevertheless, taking into account the demo’s size and its relative high quality, the demo is masterpiece that has the potential of making more than one splash in the demoscene, unless the developers abandon their brainchild. On the other hand, if the developers start improving the graphics and audio quality, the size of program will bloat and it will lose its main strong point. Thus, they ought to keep the demo the way it is now; because small size makes it a real gem and its creators are true hackers.
Nathan : Pretty good summary, im just getting into the demoscene myself. There's a really cool seminar on demoscene.tv about the .kkriger game where one of the makers explains a little more about the 'game'.
Jaeden : Interested.Hi.I don't know a lot about demoscenes, and the only programming I know is that of Visual Basic, and even there it is minimal. I was wondering what kind of programming language programmers use (C++? C+). And also, where do they compile the information? Is it done in notepad to start off with? I really don't know much, and would love to know more.
You can email me at jaeden3@hotmail.com
Flenov : What to useIn my opinion the most demo scene developers use C++ and Visual Studio from Microsoft.