Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
First Person Shooters (Games) Entertainment Games

First Person Shooter - Under 100KBs of Code 741

Cariad Ilmara writes "For those of you old-timers who spent days & nights trying to get your code fit into 64Kb, here's the first beta of .the .produkkt's next FPS: .kkrieger. Moderately beautiful, what's impressive is it can fit inside the UT2004 readme. The demo is 96Kb zipped. All textures are procedural and generated at startup. Screenshots available here, here, here, here, and here. You still need a relatively recent computer (~1.4Ghz, 512MB RAM) and a DirectX8 GPU (Windows required)."
This discussion has been archived. No new comments can be posted.

First Person Shooter - Under 100KBs of Code

Comments Filter:
  • wow (Score:3, Insightful)

    by Anonymous Coward on Thursday April 15, 2004 @09:59AM (#8868430)
  • 2K raytracer (Score:5, Interesting)

    by ggambett ( 611421 ) on Thursday April 15, 2004 @10:00AM (#8868444) Homepage
    Not as impressive, but there's a software raytracer with shadows and recursive reflection which generates .PBM images - in 2K of C source, with no libraries required. []
    • Re:2K raytracer (Score:3, Informative)

      by Abcd1234 ( 188840 )
      Not to belittle the man's efforts, but a raytracer is *incredibly* simple, algorithmically... hell, I could (and did) write a basic one that renders the classic reflective sphere on a checkerboard (with shadows) in an afternoon. Sure, making it small requires a few tricks, but, honestly, I've seen much more impressive things.
    • Re:2K raytracer (Score:5, Insightful)

      by Kombat ( 93720 ) <> on Thursday April 15, 2004 @10:32AM (#8868810) Homepage
      Have you actually read the source code to that thing? I downloaded it out of curiousity, here's a tidbit of the main() function:

      int main (void) {
      char b[99];
      int W=GN,H=GN,i,n;
      _f x,y;
      F(nl) RP(LI)
      F(ns) {RP(SI.c) SI.r=GN; RP(SI.l) SI.f=GN;}
      char* s = new char[(n=W*H*3)];
      PT p={0,0,CZ},q={0,0,0},c; ...

      Skipped the class on "meaningful variable names," did we?

      While a 2K raytracer is marginally impressive, a 5K raytracer with readable source code would be far MORE impressive, IMHO.
      • comments! (Score:5, Informative)

        by Grendel Drago ( 41496 ) on Thursday April 15, 2004 @12:04PM (#8870245) Homepage
        Did you notice minrt_comments.cpp in the zip file? Same file, but with actual comments. Variable names are explained. The snipped you pasted becomes...

        int main (void)
        char b[99];
        int W=GN,H=GN,i,n; // Read screen width and height
        nl=GN;ns=GN; // Read number of lights and spheres
        _f x,y;

        F(nl) // For each light
        RP(LI) // Read position

        F(ns) // For each sphere
        RP(SI.c) // Center
        SI.r=GN; // Radius
        RP(SI.l) // Color
        SI.f=GN; // Reflection
        } // Allocate the frame buffer. Init to zero to perform antialiasing.
        char* s = new char[(n=W*H*3)];

        Some weird macros are used:

        #define F(T) for(i=0;i<T;i++) // For
        #define FV(V,T) for(V=0;V<T;V++)

        #define SI sp[i] // i-th sphere
        #define LI lt[i] // i-th light

        #define GN atof(gets(b)) // Read a float from stdin

        #define RP(P) {P.x=GN;P.y=GN;P.z=GN;} // Read a point

        It's not really that bad.

        --grendel drago
  • Sure would be nice (Score:4, Insightful)

    by Heem ( 448667 ) on Thursday April 15, 2004 @10:00AM (#8868447) Homepage Journal
    Sure would be nice if programmers around the world would at least follow this guys lead a little bit. I'm so sick of bloated software. For example - CD Writing software for windows. Does anyone need or even want all the dang crap that comes in those?
    • Heh. It's unlikely that anyone needs all "the dang crap" that comes with [fill in the blank] program for Windows. It is very likely, however, that some subset of the software company's paying customers wants each one of the features that you consider bloat. Removing the bloat would be turning down money on the part of the program's authors. Presumably, it would entail turning down more money than they're driving away by producing software that you consider "bloated". Especially since most people just buy th
  • by elid ( 672471 ) <> on Thursday April 15, 2004 @10:00AM (#8868449)
    A produkt made by .the .produkkt won't run in KDE!?
    • Re:Windows only? (Score:3, Informative)

      by G-funk ( 22712 )
      Not to mention the other requirements:

      A 1.5GHz Pentium3/Athlon or faster.
      - 512MB of RAM (or more)
      - A Geforce4Ti (or higher) or ATI Radeon8500 (or higher) graphics card
      supporting pixel shaders 1.3, preferably with 128MB or more of VRAM.
      - Some kind of sound hardware
      - DirectX 9.0b

      And I can assure you, a GF4Ti does _not_ cut it unless you call 2-5fps acceptable. *sigh*
  • by Anonymous Coward on Thursday April 15, 2004 @10:01AM (#8868460)
    I was about to make a torrent for the game, but then i realized the torrent would probably be bigger than the file itself ;)
    • It's an obvious ploy to keep their server load down - the next step is trying to make it small enough that it can fit in an IP header.
  • 96k (Score:5, Funny)

    by bubkus_jones ( 561139 ) on Thursday April 15, 2004 @10:01AM (#8868463)
    And it's still too much for my computer.
  • No Directx 8.1? (Score:5, Interesting)

    by RichM ( 754883 ) on Thursday April 15, 2004 @10:02AM (#8868478) Homepage
    For those of you who don't have a GPU with pixelshaders, you can try the original which started the whole thing, the 64kb fr-08: []
  • Amazing Screenshots (Score:3, Interesting)

    by william_lorenz ( 703263 ) on Thursday April 15, 2004 @10:03AM (#8868481) Homepage
    These screenshots are amazing. Does anyone know more about the fact that "textures are procedural" and how they're able to use this method to compact things down into such a little distribution?
  • ...Infinite Game Universe: Mathematical Techniques [] that talks a lot about how to have a varied game universe while keeping size requirements under control.

    One of the techniques he discusses is using a psuedorandom number generator to create game objects and attributes and such, and shipping the game with a couple of pregenerated seeds to start up the generators. He uses the game Elite a lot in his examples, and anyone who's played that game knows what a good job they did in that regard.

    It's an interesting approach, especially when contrasted with WAD files [].
  • by teejie ( 97299 ) on Thursday April 15, 2004 @10:03AM (#8868487)
    Omniscent [], is the first level of Descent (you remember, the first 360degrees shooter) in 4kb (4096 bytes) with music and textures. Non-playable, but still really cool. It was released in 1997.
  • Great Compression (Score:4, Interesting)

    by DrugCheese ( 266151 ) on Thursday April 15, 2004 @10:04AM (#8868489)
    I remember a friend of mine showing me the winner of this compression contest, it was like an 24kb download and it was 12 minutes of good music and graphics scrolling around the screen. Blew my mind.

    Anyone know what I'm talking about? Cause I've searched and can't find it anymore.

  • Other 64Ko 3D demos (Score:5, Informative)

    by wolruf ( 30926 ) on Thursday April 15, 2004 @10:04AM (#8868501)
    Thi s one is especially impressive:
  • by SealTit ( 606480 ) on Thursday April 15, 2004 @10:06AM (#8868525) Homepage
    Can someone post a link to a torrent?

    It's taking forever to download . . .
  • the.produkkt. (Score:3, Informative)

    by faxe ( 13735 ) on Thursday April 15, 2004 @10:08AM (#8868551) Homepage Journal
    these guys are actually a part of the demoscene []. They have done quite a lot of spectacular demos and intros. They can be found here []. This was a release from the 96k game competition of this years breakpoint []demoparty held last weekend in Bingen, Germany.
  • It crashes (Score:3, Informative)

    by gonvaled ( 584635 ) on Thursday April 15, 2004 @10:08AM (#8868552) Journal
    The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read".

    In Windows 2000 Profesional
  • by __aazuyo6398 ( 769626 ) on Thursday April 15, 2004 @10:08AM (#8868554)
    Ok, I'm not saying this isn't impressive, but since it's using everything included in DX8.0, it's not really fair to say it's that small. I mean, look at it another way...If you built a mod for UT2K4 that was 150k would you be jumping up and down? No, because it requires > 1GB worth of stuff to be downloaded first. In the end though, that's still some pretty tight programming
  • by Jason Straight ( 58248 ) on Thursday April 15, 2004 @10:08AM (#8868556) Homepage
    I thought we were all nearly extinct from the Visual Armageddon!
  • 100KB, please (Score:4, Insightful)

    by Repugnant_Shit ( 263651 ) on Thursday April 15, 2004 @10:08AM (#8868562)
    This game is dynamically linked to DirectX, which is a large program library. 3D Winamp visualizations are also small, because they don't have much rendering code in them either, but they're also not optimized very well (like a *real* engine such as Quake 3 or UT2004). Just because *your* "hello, world" is statically linked to the C++ library and mine isn't, doesn't make mine better because it's smaller.

    And procedural textures? The demo scene guys have been doing this for ages.

    This has left me underwhelmed.
  • by PingKing ( 758573 ) on Thursday April 15, 2004 @10:12AM (#8868607)
    According to the readme, the texture-maps are generated in real-time:

    We do .not. have some kind of magical data compression machine that is able to squeeze hundreds of megabytes of mesh/texture and sound data into 96k. We merely store the individual steps employed by the artists to produce their textures and meshes, in a very compact way. This allows us to get .much. higher data density than is achievable with normal data compression techniques, at some expense in artistic freedom and loading times.

    The problem with this, of course, is that it requires major computational power, and you're limited with the type of textures you can produce. It's probably a case of this program specifying 'bumpy metallic texture' or 'smooth stone texture' on the fly.
    I remember the old flight-sim 'Strike Commander' would generate the game's maps during installation based on fractals. It used take AGES... this program generates many more megabytes of graphics on the fly... very impressive.
  • by ites ( 600337 ) on Thursday April 15, 2004 @10:12AM (#8868612) Journal
    1. Downloading... very fast, as you'd expect. 2. Installation... very simple, just unpacks to one readme file and one executable. 3. Documentation... brief, note that DirectX 9.0 is required (not 8.1 as mentioned in the story). 4. Running... brief: "Instruction at 0x000000000 referenced memory at 0x000000000". Conclusion: I can make the same functionality in an even smaller package.
    • Re:Instant review (Score:3, Informative)

      by Eshock ( 646544 )
      I think they were referring to the fact that it requires a "directx 8 class" graphics card, ie one with a pixel shader.
  • Mirrors (Score:5, Informative)

    by dbloodnok ( 100625 ) on Thursday April 15, 2004 @10:25AM (#8868738)
    Trust slashdot to kill a website hosting a 96k file.

    try here [] and here [] or for a complete list here []

    Farb-Rausch do some nice demos... worth checking out.
  • by Anonymous Coward on Thursday April 15, 2004 @10:26AM (#8868754)
    What the hell is it with the tradition of dark foreboding metal enhanced settings?

    I want a FPS game set in a sunlit mountain meadow with birds & butterflies flitting about.

    So I can see the blood....

  • by Anonymous Coward on Thursday April 15, 2004 @10:29AM (#8868785)
    So the game requires a PC with:

    1.4 GHz Processor
    512 MB Ram
    96 kb HD Space

    Well at least my computer meets one of those requirements!
  • It reminds me of this guy [] who wrote a snake game [] for Linux that compiles to under 1500 bytes. It really does work.
  • Elegance (Score:3, Interesting)

    by PhotoGuy ( 189467 ) on Thursday April 15, 2004 @10:36AM (#8868853) Homepage
    Wow, flashback to when elegance in programming was far more common, and bloat was far less programming.

    I worry about newer generations of coders, never having known elegant, lean, efficient, and useful code, from the major bloat that comprises most software projects today.

    Items like this, are truly things of beauty, and only becoming more rare.

  • It runs like ass..!? (Score:3, Informative)

    by Anonymous Coward on Thursday April 15, 2004 @10:53AM (#8869121)
    I am running an optimized XP Pro system with the latest patches, 2.4 GHz, 1 gig of ram, ATI Radeon 9700, and it runs like dogshit. It crashed my computer and I am not going to try it again.
  • by superultra ( 670002 ) on Thursday April 15, 2004 @11:00AM (#8869239) Homepage
    So I guess this is impressive, especially if it's taken more as a contribution to the demoscene than to gaming. But what I think is far more impressive is that a game like Starflight [] which included hundreds of planets, dozens and dozens of hours of gameplay, an equal number of conversations and text and hundreds of objects, all fit into 2 5 1/4 disks (360K x 2). In 1986. And while exceptional, Starflight is merely representative of the amount of efficient coding that had to go into early game creation. Kkrieger, and more so older classics like Starflight, should serve as examples to modern developers who seem to be bloating [] their code [].
  • by fritter ( 27792 ) on Thursday April 15, 2004 @11:50AM (#8870035)
    Looks like we all owe Bill Gates an apology. 640K is enough for anybody!
  • Explanations! (Score:5, Informative)

    by kb ( 43460 ) on Thursday April 15, 2004 @11:53AM (#8870077) Homepage Journal

    As I'm one of the guys responsible for this game, let me explain a few things.

    First, to all the people saying this is senseless etc.: Please watch every second story posted on /. - most of them are about people doing something nobody in their right mind would ever try. So come on ;)

    Then, a few clarifications:

    • Yes, we are the same guys who are responsible for FR-08: .the .product and all the follow-ups (which you can find at our home page, []).
    • We don't use any hidden texture/sound or game generators in Windows. .kkrieger requires DirectX 9, but only to gain access to the graphics and sound hardware. OpenGL and whatever audio API would also work, we just chose to use DirectX. Maybe we will even release a Linux version in the future (which should be about the same size using X and ALSA), but as all this is done in our spare time and none of us has a linux desktop PC, it's rather improbable. So, the only thing where we "cheated" and used ressources from Windows are the Arial and Times New Roman fonts which we use as base material for our fonts (heavily processed tho). This and all Windows DLLs that are essential for running. We don't even use any external libc.
    • All content, that is: the textures, the models, the map and part of the animations is generated procedurally. The basic concept is a modular graphics synthesizer which only stores the steps needed to opbain a certain image or mesh with their parameters. On [] you'll find a short explanation. .kkrieger uses the very same concepts, only in a really evolved and refined way.
    • Also the sound is created procedurally by a virtual-analog software synthesizer processing heavily compressed MIDI data. It runs in real-time (for the music) as well as as pre-processing step (for the sound effects). Actual sound output is done via simplest DirectSound programming.
    • The graphics engine is made for Doom3-style graphics, that means full Phong lighting model with various light sources and normal mapping everywhere, and of course stencil based shadows. It requires a PS1.3 level graphics card such as a GeForce4Ti or a Radeon8500 or better, though it's only fun on at least a Radeon 9600 or a GeforceFX 5700, we know.
    • We also know about the insane hardware and memory requirements and all the bugs as well as the mostly missing gameplay, but we worked on it (partly) for about two years and we definitely wanted to get it out at the Breakpoint party [] on Easter. This meant lots of things we had to cut, this meant lots of thigs we didn't test, and we know this beta is far from perfect. But expect a final version in a few months (we'll definitely take some rest now) which will be about 128k and not only feature less bugs, hangs and fsckups but only vastly more content and hopefully an improved engine capable of real vs/ps2.0 support for more speed and quality. Oh, and gameplay. And monsters that actually DIE instead of just being turned off :)

    Hope that clears up a few things...

    Tammo "kb" Hinrichs
    Farbrausch Consumer Consulting
    freelance audio programming guy for .kkrieger
    shocked that our server is still alive.
  • by ynnaD ( 700908 ) on Thursday April 15, 2004 @12:24PM (#8870584)
    Noctis ( is less than 1mb but lets the player explore a whole galaxy. It's an interesting game where you have total freedom to fly anywhere and do anything. No fighting, just exploration.

"Say yur prayers, yuh flea-pickin' varmint!" -- Yosemite Sam