F***ing Learn To Code Again

Published in the scene disk magazine Hugi, Issue 14

Back to articles page

While reading Hugi 13, I ran across many articles rumouring about whether the scene dies, whether people become inactive, why they do and how much innovation is lacking in demos. But, despite all this, even the TECHNICAL quality of demos is becoming steadily worse. Lately, I downloaded tons of productions from demo.cat.hu, looked through all of them, and almost started to cry and think of whether it wouldn't be better if I quitted this mess calling itself "scene" nowadays.

What I had to see were first of all many demos which didn't even start, but crash or fail for this and that reason (and I don't think a 72meg machine with GUS and SB and a Trio64V+ in it (yes, UniVBE is loaded) doesn't cover enough standards to have at least one of them supported) - and the rest was mainly reincarnation of Mode 13h with effects I saw many times before and BETTER. So what's up? Have people entirely forgot that apart from all that design-hype nowadays coding should be still kind of an art? Or does just nobody care anymore? I don't know.

The most astonishing thing about it is, that in former times, people were actually ABLE to produce elegant code and good-looking fast demos - and all this with PCs we would just laugh at today. And look at all those Amiga and C64 sceners still producing stuff which some of "us" PC guys 'n grrrls just envy. And do you know what? It's friggin' easy. Just CARE about what you code and don't lean back once your desired effect shows the first correctly looking still picture on your screen.

On the other hand, most of that 'leet underground knowledge how to code demos is lost. There is no tutorial at all how to code demo effects in a way that they look good, work on more than your machine and maybe run the same overall speed (not frame rate of course) independent of the watcher's cpu. And sadly, nobody seems to be able to find out how all this worked and still works (ok, maybe, as said, people don't care).

So, i'll just state a set of rules or proposals now how to make better demos (or demos at all)...

--- HOW TO BECOME AN ELITE DEMO CODER - PART I - BASIC PRINCIPLES AND PRACTICE OF DEMO CODING ---

... and i'll start right with the thing noone of you seems to want to hear:

1. OPTIMIZE YOUR CODE

["Optimize? Are you NUTS? We have Pentium IIs, we don't need to optimize!"]

Yes, I admit it, if you have a P2 machine with at least 300MHz, completely losing the overview of what you do is a permanently imminent danger. What ever mess you type into your favourite editor or IDE, the result will be most probably what is called "fucking fast". One good example for this is that thread about rotozoomers on news.scene.org's coders newsgroup where a guy posted a rotozoomer which was about 10 times slower than a rotozoomer (which is a 1992 effect, just by the way) should normally be. And you know what? He didn't even recognize. No, in fact, he considered the rotozoomer I send him back (1 hour of coding, some not-so-well-optimized written-down asm inner loops, rest C++, ran 70fps on a P60 (instead of HIS 10fps)) buggy - and another guy even dared to answer me things like "your ASM code will lead you nowhere". Nowhere.

In fact, "nowhere" is exactly where I want to be if THIS attitude towards DEMO CODING (let's repeat this : DEMO CODING) is the common one. We have so powerful machines nowadays, capable of displaying ten thousands of particles, thousands of triangles and an unmeasurable number of shadebobs per video frame (read: 70fps) and trying to actually DO something with this power instead of repeating the same old effects again and again (just worse each time) leads me or any other person doing this NOWHERE? Get a life.

Now, how does one write optimized code? Well, it's easy if you think of a few things.

Many of you will now probably realize that this problem would not exist without optimization, as optimised routines aren't really open to changes if you want to reuse them and recognize you have to change them here and there. But this is (at least in my completely unhumble opinion) the fate of every "true" demo coder and this is the point where you HAVE to care and HAVE to put MUCH work into your productions. Or you can just stay what people like me call lame. It's up to you.

INCOMING MESSAGE: Hello Java coders. Thanks again for showing me that the definition of platform independence is that the code won't run at all, independent of the platform. EOT.

2. MAKE YOUR CODE RUN ON MORE THAN YOUR PC

["It doesn't work? That's strange, HERE it does... maybe you should buy a better PC!"]

A common practice is that demos nowadays run on exactly two computers:

1. The computer of the coder
2. The compo machine (needs to reboot after the end)

Sometimes the demo will even run on one or two other group members' pcs, but this is rather rare. Some good examples of this were that Windows 3DFX demo at Evoke (which didn't even run on ANY machine in it's "final" version) and of course "Perfect Drug" by Elitegroup which was a brilliant example of code and design, but is known to run on almost no pc people have, for which reason ever (I was in the lucky situation to watch it at Dominator/Elitegroup's PC once, but it never worked for me either).

Anyway, what causes this dilemma? There is only one answer for this - and it's an answer we know: LAZINESS. You know Second Reality, don't you? Of course you do. And I can surely say you watched it, if not several times. How come that demo works on every pc from 386SX16 to the latest Xeon machines and nowadays' demos DON'T? Isn't there anything wrong with it?

Definitely there is. People code something which SEEMS to work on their own pc, call it "demo" and send it out into the world without having tested it on ONE other computer of even realizing that their hardware dependant DOS code is what it is called: hardware dependant.

So what are the reasons why a demo only works on specific machines? And what can be done about it?

(hm, maybe I should consider wearing one of those neato "Hello - are YOU the PC scene?" shirts at parties, too)

To come to the end, I'll finally ask you one question: Is all this really too hard or too much work? What's the problem with optimizing code or making your demo run on other computers than yours? Face it - it's only your own laziness. Nothing of all this is impossible, many groups showed us that it works. So why doesn't it work on you? Don't you feel ashamed? You better do.

If i ever write a next issue of this article, its content will most probably be "how to make your demo look good", covering topics from how to query the escape key ["escape key? Isn't the reset key enough?"] to DOS related ones like how to synch your effects to the retrace ["you mean, those stripes aren't necessary?"] and maybe some Win95 coding issues. We'll see.

Tammo "KB" "Ja, ich BIN arrogant" Hinrichs
kb@ms.demo.org

Back to articles page