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)."
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.
here: http://sebaplus.free.fr/prog3d/demoscene.htmli s one is especially impressive: http://sebaplus.free.fr/prog3d/fr08v101.exe
Th
wolruf@gmail.com
doom came on four disks.
Informative?? It unzips to exactly 96k.
Google 'Perlin Noise'. Read 'Procedural' as 'described mathematically'.
Belief is the currency of delusion.
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.
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
The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read".
In Windows 2000 Profesional
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
Doom won't fit in a floppy disk. I believe the shareware version takes two or three disks...
Wolfenstein, maybe
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/
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. ^_^
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)
this guys ARE demo scene guys, also known as Farbrausch.
fx! kicking and screaming
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.
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!
Mirror... http://catsdorule.torpedobird.com/slash/
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
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...
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.
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.
Are you serious?!
Discover Elite now!! Check out this page, maintained by one of the original creators Ian Bell and this Elite resource
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
I think they were referring to the fact that it requires a "directx 8 class" graphics card, ie one with a pixel shader.
It reminds me of this guy who wrote a snake game for Linux that compiles to under 1500 bytes. It really does work.
Get your own free personal location tracker
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.
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!
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
On my 2.8 GHz machine, the demo took a full minute to load.
Check out:t looks beautiful on an accelerated-X Linux box.
http://freshmeat.net/projects/sunplasma/
I
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."
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.
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.
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.
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.
The answer to that would be FarCry.
It'll make your box beg for mercy though.
-- taking over the world, we are.
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!
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...
My website
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.'"
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.
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...
OpenAL is also used by UT2004.
Eat the rich.
Serious Sam
Those who can, do. Those who can't, consult.
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.
http://www.angelfire.com/games/ultimateblaster/
Lasers Controlled Games!
Read the readme.txt, dude.
.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."
"The concept of the texture/mesh generators was developed by fiver2. We do
Here's a first person shooter in 5k of code
www.wolf5k.com
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
Then, a few clarifications:
Hope that clears up a few things...
Tammo "kb" Hinrichs
Farbrausch Consumer Consulting
freelance audio programming guy for
shocked that our server is still alive.
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.
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...
// Read screen width and height // Read number of lights and spheres
// For each light // Read position
// For each sphere // Center // Radius // Color // Reflection // Allocate the frame buffer. Init to zero to perform antialiasing.
// For
// i-th sphere // i-th light
// Read a float from stdin
// Read a point
int main (void)
{
char b[99];
int W=GN,H=GN,i,n;
nl=GN;ns=GN;
_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)];
memset(s,0,n);
Some weird macros are used:
#define F(T) for(i=0;i<T;i++)
#define FV(V,T) for(V=0;V<T;V++)
#define SI sp[i]
#define LI lt[i]
#define GN atof(gets(b))
#define RP(P) {P.x=GN;P.y=GN;P.z=GN;}
It's not really that bad.
--grendel drago
Laws do not persuade just because they threaten. --Seneca
Get Serious Sam. Also, read the interview at Old Man Murray: http://www.oldmanmurray.com/features/73.html
RaviWhen the axe came to the forest, the trees said, "Look out - the handle was once one of us."
they are actually the same group of people.
fx! kicking and screaming
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.
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.
My hardware and software includes (I know, not the latest and greatest, but not a slouch either):
Clearly, I meet the 'minimum requirements'... according to the game's accompanying readme.txt, the minumum requirements are:
supporting pixel shaders 1.3, preferably with 128MB or more of VRAM.
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
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.
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.
--
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.
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