Slashdot Mirror


First Person Shooter - Under 100KBs of Code

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)."

60 of 741 comments (clear)

  1. Anyone remember omniscent? by teejie · · Score: 5, Informative

    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.

  2. Other 64Ko 3D demos by wolruf · · Score: 4, Informative

    here: http://sebaplus.free.fr/prog3d/demoscene.html
    Thi s one is especially impressive: http://sebaplus.free.fr/prog3d/fr08v101.exe

    --
    wolruf@gmail.com
  3. Re:Wow by Anonymous Coward · · Score: 1, Informative

    doom came on four disks.

  4. Re:zipped doesn't count for size by br0ck · · Score: 5, Informative

    Informative?? It unzips to exactly 96k.

  5. Re:Amazing Screenshots by eddy · · Score: 5, Informative

    Google 'Perlin Noise'. Read 'Procedural' as 'described mathematically'.

    --
    Belief is the currency of delusion.
  6. the product: 64k by Anonymous Coward · · Score: 2, Informative

    http://theproduct.de/ was the first thing I thought of when reading this article. It was a demo in 64 that otherwise is as you described.

  7. the.produkkt. by faxe · · Score: 3, Informative

    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.

    --
    fx! kicking and screaming
  8. It crashes by gonvaled · · Score: 3, Informative

    The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read".

    In Windows 2000 Profesional

  9. Not as impressive as you think... by __aazuyo6398 · · Score: 4, Informative

    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

  10. Re:Wow by rmsousa · · Score: 2, Informative

    Doom won't fit in a floppy disk. I believe the shareware version takes two or three disks...

    Wolfenstein, maybe

  11. Re:Amazing Screenshots by pe1rxq · · Score: 2, Informative

    Simple, instead of an image you simply include a piece of code that generates it think of it like those small programs that create enormous fractal images.

    Jeroen

    --
    Secure messaging: http://quickmsg.vreeken.net/
  12. Re:Wow by Knight+Thrasher · · Score: 2, Informative

    Yeah, I guess a couple of floppies would be Doom. Wolfenstein is what I was thinking of, there we go. Sorry, my memory on the games I played when I was 6 is bad. ^_^

  13. Re:Wow by Welsh+Dwarf · · Score: 2, Informative

    5, first encounters (elite 3) was 3. I got both at the same time, and thought they were huge :)

    --
    Ask 8 slackers a question, get 10 awnsers (a citation, but I can't remember from who)
  14. Re:100KB, please by faxe · · Score: 5, Informative

    this guys ARE demo scene guys, also known as Farbrausch.

    --
    fx! kicking and screaming
  15. Procedural textures by raygundan · · Score: 4, Informative

    I don't know what generation procedures they used, but "the textures are procedural" means that there are no graphics files in there, and that an algorithm creates the textures at runtime. As a simple example, you could write an algorithm that made a checkerboard image in only a few lines of code. That code takes up only a handful of bytes, whereas the texture graphic itself would take up hundreds of kilobytes, even compressed. You could also look at it as the difference between an equation, and a graph of the equation.

    I'm curious to know if the maps are procedural, too.

  16. Re:Windows only? by G-funk · · Score: 2, Informative

    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*

    --
    Send lawyers, guns, and money!
  17. In case they go down... by Steamhead · · Score: 1, Informative

    Mirror... http://catsdorule.torpedobird.com/slash/

  18. Re:Very Cool But..... by Glonoinha · · Score: 2, Informative

    The 64kb was actually a limitation of early compilers that needed to keep the entire address space of a program inside of 64k. It was called the small memory model, I believe, and all the code and pre-allocated memory for variables needed to sit inside that 64k (but dynamic allocated variables could reside on the heap in excess of that 64k.)

    --
    Glonoinha the MebiByte Slayer
  19. Re:awesome... now only if they'd do this for linux by S3D · · Score: 4, Informative

    Would be about the same if we are talking about graphics. There is no noticable difference in code size for DirectX and OpenGL with appropriate driver with all extensions. Both Nvidia and ATI are shipping OpenGL drivers with all extensions realized in hardware, giving OpenGL about the same functionality as Direct3D. But there is no sound in the OpenGL. Don't know what are standart sound library for Linux...

  20. Mirrors by dbloodnok · · Score: 5, Informative

    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.

  21. Re:2K raytracer by Abcd1234 · · Score: 2, Informative

    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.

  22. Elite..? by Anonymous Coward · · Score: 3, Informative

    Are you serious?!

    Discover Elite now!! Check out this page, maintained by one of the original creators Ian Bell and this Elite resource

  23. Re:awesome... now only if they'd do this for linux by molarmass192 · · Score: 4, Informative

    Off the top of my head OpenAL, I know it's used by NWN and some of the old Loki games. Whether that makes it a standard or not is a whole other question.

    --

    Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
  24. Re:Instant review by Eshock · · Score: 3, Informative

    I think they were referring to the fact that it requires a "directx 8 class" graphics card, ie one with a pixel shader.

  25. Wonder how big the VB/.Net version would be? by caluml · · Score: 2, Informative

    It reminds me of this guy who wrote a snake game for Linux that compiles to under 1500 bytes. It really does work.

  26. Re:There's a book by Guy-Lecky-Thompson... by permaculture · · Score: 2, Informative
    I googled for 'elite trading game' and found it. Get it free here.

    There's a newsgroup too: alt.fan.elite. I can't find who wrote the game, though.

    --
    Environmentalism is the new Victorianism. Everyone ties on a green corset and pretends we're virtuous.
  27. Re:Amazing Screenshots by Funk_dat69 · · Score: 4, Informative

    Um, I'm hoping you're not suggesting procedural textures originated in the demo scene.

    Ever heard of Ken Perlin?

    Programmer who actually won an Academy Award for basically inventing this?

    Anyone?

    --
    FUNK!
  28. Re:You're right... by misleb · · Score: 4, Informative

    Using SDL may be "absurd" if you want to write a Windows-only game, but it isn't absurd if you want to make it crossplatform. Whether you will admit it or not, SDL/OpenGL is a standard that many (good and fast) Linux games have been based on.

    --
    "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
  29. You would be correct... by ThePyro · · Score: 3, Informative

    On my 2.8 GHz machine, the demo took a full minute to load.

  30. Sunplasma - Beautiful flight-sim for Linux, 76K by lobiusmoop · · Score: 1, Informative

    Check out:
    http://freshmeat.net/projects/sunplasma/
    It looks beautiful on an accelerated-X Linux box.
    76K compressed download, again textures (trees and landscape) fractal-generated at compile-time.

    --
    "I bless every day that I continue to live, for every day is pure profit."
  31. It runs like ass..!? by Anonymous Coward · · Score: 3, Informative

    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.

  32. Re:Sure would be nice by Quarters · · Score: 2, Informative

    In a word, "no". If I write a small tight efficient graphical effect routine (e.g. a glow effect) that runs on the CPU it is still going to be slower than a glow pixel shader that runs on the GPU. The GPU code doesn't even need to be as small and efficient in order to run faster. The GPU is a better solution to use in that instance. High performance games rely on proper use of machine resources; graphic effects and polygon T&L on the GPU, sound processing on the DSP on the sound card, etc.... Those decisions are equally, if not more, important than a highly optimized routine to accomplish something.

  33. Re:this is nice but.. by absurdhero · · Score: 2, Informative

    The half-life executable and client and server dlls puts it up at several megabytes. perhaps over 10 megabytes, but I don't have a copy of it around to check, atm. This is 100kilobytes including generated music and textures. It requires very skilled coders to save byte after byte in every inch of the code. These guys have been making great 64k demos for a long time. Just a couple weeks ago I was thinking, "gee, why doesn't someone stick some mouse control, a gun, and collision detection in one and let me shoot stuff?" And my wish has been granted.

  34. Shrug - Been there, done that. by superultra · · Score: 4, Informative

    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.

    1. Re:Shrug - Been there, done that. by otis+wildflower · · Score: 3, Informative

      Elite.

  35. Re:Why are they all set in dark machine rooms? by aliens · · Score: 4, Informative

    The answer to that would be FarCry.

    It'll make your box beg for mercy though.

    --
    -- taking over the world, we are.
  36. Re:Sure would be nice by tricops · · Score: 2, Informative

    Someone else mentioned goldenhawks, but another nice (and even smaller if you ignore the help file) cd burner is burnatonce. Nice, relatively simple, and small.

    --
    (\(\
    (^v^)
    (")")
    This is the cute vorpal bunny virus, copy to your sig or runaway, runaway in fear!
  37. Re:Misconception by ggambett · · Score: 2, Informative

    However, it does affect the size of the source code, which is what I was trying to minimize. Same thing with the #defines, which the preprocessor expands anyway...

  38. Re:awesome... now only if they'd do this for linux by drinkypoo · · Score: 4, Informative

    The standard sound library for Linux 2.6 is ALSA. Games usually talk to it through OpenAL (see sibling) or SDL, the simple directmedia layer. SDL basically provides all the functionality of DirectX except Direct3D, whose functionality is provided on Linux via OpenGL (as you know.)

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  39. Re:Why are they all set in dark machine rooms? by Milo+Fungus · · Score: 2, Informative

    Have you tried Jump N' Bump? It's not 3D or anything, but it sure is a lot of fun. And it matches your description perfectly.

  40. Re:Sure would be nice by russellh · · Score: 2, Informative

    Frankly, who cares?

    Hey, we care! After all, the blurb did, in fact, say For those of you old-timers who spent days & nights trying to get your code fit into 64Kb. That must not apply to you.

    --
    must... stay... awake...
  41. Re:awesome... now only if they'd do this for linux by KozmoStevnNaut · · Score: 2, Informative

    OpenAL is also used by UT2004.

    --
    Eat the rich.
  42. Two Words: by shachart · · Score: 3, Informative

    Serious Sam

    --
    Those who can, do. Those who can't, consult.
  43. OK by Christ-on-a-bike · · Score: 4, Informative

    America's Army
    Aliens vs. Predator
    Descent 3
    GLTron
    Heavy Metal
    Mutant Storm
    Neverwinter Nights
    Unreal Tournament
    Unreal Tournament 2003/2004
    Vega Strike

    These are all games that use both SDL and OpenGL. Many more use either one or the other.

  44. RTFR by Dachannien · · Score: 3, Informative

    Read the readme.txt, dude.

    "The concept of the texture/mesh generators was developed by fiver2. We do .not. want to claim that the techniques we used to develop .kkrieger are new inventions. Its rather a selection of useful operations and their parameters to optimise the results."

  45. 5k of code by Anonymous Coward · · Score: 1, Informative

    Here's a first person shooter in 5k of code
    www.wolf5k.com

  46. Explanations! by kb · · Score: 5, Informative
    Hi...

    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, http://www.farb-rausch.de).
    • 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 www.theproduct.de 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.
    1. Re:Explanations! by kb · · Score: 3, Informative

      The intro is supposed to be grey, for some unknown reason somebody here considered a postproc effect which uses the alpha blend unit to square (and thus solarize+half) the dest color good-looking ;)

      For the rest, well, a final will come ;)

  47. Re:You're right... by Qzukk · · Score: 2, Informative

    noiz2sa - SDL
    Aleph One - SDL/OpenGL
    BZ Flag - OpenGL
    Egoboo - SDL/OpenGL
    PoopemUp - SDL/OpenGL
    Neverwinter Nights - SDL/OpenGL
    Not to mention all the Loki titles that used SDL (heck, didn't they develop it in the first place?): Myth, Rune, Civ3,Sim City 3000, Tribes 2, Alpha Centauri, and so on
    Don't forget the billion or so Doom/Quake/Wolfenstein 3D ports/spinoffs.

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  48. comments! by Grendel+Drago · · Score: 4, Informative

    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)];
    memset(s,0,n);


    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

    --
    Laws do not persuade just because they threaten. --Seneca
  49. Re:Why are they all set in dark machine rooms? by rpillala · · Score: 3, Informative

    Get Serious Sam. Also, read the interview at Old Man Murray: http://www.oldmanmurray.com/features/73.html

    Ravi
    --
    When the axe came to the forest, the trees said, "Look out - the handle was once one of us."
  50. Re:Amazing by faxe · · Score: 2, Informative

    they are actually the same group of people.

    --
    fx! kicking and screaming
  51. Another interesting game by ynnaD · · Score: 5, Informative

    Noctis (http://anywherebb.com/noctis.html) 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.

  52. Re:2K raytracer by Lehk228 · · Score: 2, Informative

    funny thing is that without any knowledge of raytracing I was able to chop it down to 1,855 bytes, some of the variables that are #defined are only used once, (they are defining numbers to var names, good practice while coding, but bad if only used once or twice and you are going for small source, I also removed all the line breaks since the compiler only cares about ; except for preprocessor instructions.

    --
    Snowden and Manning are heroes.
  53. I just tried the game... by thx2001r · · Score: 2, Informative

    My hardware and software includes (I know, not the latest and greatest, but not a slouch either):

    • Windows XP Pro (all latest patches... this computer has not crashed in over 2 years... is not continously on, but does not crash when I use it for over 2 years)
    • AMD Athlon XP 1900+, MMX, 3DNow, ~1.6GHz
    • 512MB DDR 266 RAM
    • ATI Radeon 8500 128MB (DirectX 8 Support)
    • DirecX 9.0b (4.09.0000.0902)
    • Creative Soundblaster Live! 5.1 PCI

    Clearly, I meet the 'minimum requirements'... according to the game's accompanying readme.txt, the minumum requirements are:

    • 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

    These requirements were not kidding... the game runs extremely slowly on my hardware. It was chugging along at, I'd guess, 10-15 frames per second (I'm not sure what resolution it was running at or color depth, but I run Windows at 1024x768x32bpp). The game was ok looking, visually, in some aspects was better looking than the original Unreal game, in others, not as good. Gameplay was not particularly exciting... though, at 10-15 frames per second, it might not be anyhow, but I only played it for about 2 minutes.

    After 2 minutes, the game crashed and crashed Windows as well... Probably a result of it being 'beta' software, but nevertheless, a rare occurence on my particular Windows XP PC. As noted above, it's been over 2 years since anything caused Windows XP to crash on me! Not sure if my hardware was overwhelmed, the game being buggy, or if DirectX just killed it, but that's what happened. If you have a computer, less than 1 year old, with the latest hardware and loaded with RAM, this game will probably work for you. It doesn't work too well for the minimum requirements (in my experience, YMMV).

    Interesting that they can pull this off in such a small package and trying out to see how it works for you. My $0.02.

    --

    -Joe
    If we're all god's children, what's so special about Jesus? - Jimmy Carr

  54. Re:I would be more impressed... by null+etc. · · Score: 3, Informative

    I wonder if you're referring to an assembly program I wrote to generate Sierpinksi triangles in 76 bytes. But please note, those 76 bytes included calls to DOS interrupts, which is an API in the same fashion that DirectX is an API.

  55. Re:Torrent file by beegle · · Score: 2, Informative

    For the record, the torrent that I created was a whopping 188 bytes. Which is to say that the http overhead is probably larger than the file size. Hell, the TCP overhead is close.

    --
    --
  56. Linux is faster by Anonymous Coward · · Score: 2, Informative

    Also of note is that with linux you can set up a fullscreen game as one of your X Session managers (or even a runlevel), thus freeing up all the resources that would be taken up by window managers, desktop environments, etc. When logging in you can use the session menu (of many display managers) to tell it to run the game instead of KDE/Gnome.

  57. Re:Pfft by randyest · · Score: 2, Informative

    seems to be an awful lot of duplication of texture, geometry, and code going on here

    No, there is some procedural generation of all of the above going on here. Not much duplication I expect.

    It requires 512MB RAM and 128MB framebuffer because it procedurally generates geometry and textures that are that big.

    And the zipping does little. The executable is 97,280 bytes, the readme is 5,504 bytes. The zip archive is 100,185 bytes. The compression is negligible.

    Don't poo-poo it just because you don't get it. It's very cool, and very impressive, IMHO.

    --
    everything in moderation