Left 4k Dead - Ridiculously Compact Programming (mojang.com)
submitted 1 month ago by gnick
submitted on | 22 Dec 2008 |
---|---|
points | 787 |
up votes | 943 |
down votes | 156 |
Left 4k Dead - Ridiculously Compact Programming (mojang.com)
submitted 1 month ago by gnick
d-_-b 75 points 1 month ago[-]
I liked the bit where I was held up in a corner, fighting off hordes and hordes of zombies, until I reloaded, finished a few off and sat there, breathing heavily.
I then reloaded again. was just about to move off and
...
I advise you don't play this game in a crowded office, and if you do, try not to scream out like I did
intheoryiamworking 13 points 1 month ago[-]
Impressive, but it's only 4K if you don't count the many, many megabytes of JVM, web-browser, and operating system code that make it possible.
The super-tiny demoscene DOS programs of yore really were just about as small as they looked.
intheoryiamworking 1 point 1 month ago* [-]
I said it was "impressive." I may have my grumpy old man moments, but this wasn't one of them.
I'm not the one making a big deal about the small file size; they are.
procrastitron 2 points 1 month ago[-]
But all of those megabytes of supporting code just define the (virtual) machine that the game runs on. Including them in the size would be like including one of Intel's x86 chip layouts in the size of a DOS program.
intheoryiamworking 2 points 1 month ago[-]
But all of those megabytes of supporting code just define the (virtual) machine...
Some of it is the virtual machine. A lot of it is the Java runtime library, the desktop display libraries for your PC, the video drivers, etc. The old DOS demos didn't have any of those resources to help them out.
cdesignproponentsist 2 points 1 month ago[-]
WASD was used for directional control going back to the 1980s. It was the standard "left hand player" counterpart of IJKL for two-player games.
berlinbrown 81 points 1 month ago[-]
is that java?
wtf, I didnt even notice it.
seemed like javascript.
iofthestorm 45 points 1 month ago[-]
Seriously, the JVM normally seems to take forever to load. What's up with that? I wonder if JDK 6 Update 10/11 have anything to do with it?
kernelhappy 15 points 1 month ago[-]
I want to know why Java games in a web browser have to have a postage size window.
If you use Windows, check your task manager and look for "jqs.exe", that's "Java Quick Starter".
Java Quick Starter (JQS) improves the initial startup time of Java applets and applications by periodically prefetching some of the most heavily used Java Runtime Environment files into memory (occupying no more than 20Mb of RAM). Later, when Java is launched, much less disk I/O is required and as a result, startup is much faster.
iofthestorm 1 point 1 month ago[-]
That's been around since before update 10 though, and it never helped before.
berlinbrown 3 points 1 month ago[-]
It has to be the update.
That was my first though too.
I am running Ubuntu 8.10 and must have gotten the most recent Sun JVM.
almafa 20 points 1 month ago[-]
THIS is 4k too... though obviously not java :) Link to the executable (needs modern hardware)
almafa 5 points 1 month ago[-]
Indeed, this an artform, although a very technical one. There is whole subculture producing similar stuff, though this one is exceptionally good.
About 4k coding, there are a few (mostly independent) aspects. These intros are written in either assembly or C (in the latter case you need to discard the standard libraries). Personally I believe in asm, but not everybody agrees. They are compressed with executable compressors, the best one is crinkler. For the sound, you have to write a simple software synth; you can use different synthesis methods, for example the virtual analogue way (starting with harmonic-rich waveforms like the sawtooth, and sculpting them with filters) works very well. (There are people using general midi samples, but that's just lame :). For the graphics, they use either DirectX or OpenGL, though DX is definitely better in this case, since it will result in more compact code (the API is organized differently). The best 4ks today, including this one, typically runs almost entirely in the GPU, so it's just a tricky big fat shader; this again results in size reduction (at least with DX). All this apply to the recent years; the technologies change over time, and the whole 4k intro business got popular back around 1994. You can find most existing 4k-s on pouet.net.
There are a few tutorials and source codes on the net, but they are neither up-to-date nor very good, I'm afraid. But I found this wiki about the subject which seems to contain a wealth of information.
Keyframe 1 point 1 month ago[-]
thanks for informative reply. I've been aware of the demoscene all the way back in time when I had amiga as a kid, spaceballs and simillar demos. However I never actually got time/enough interest to look harder into procedural generation like that, seems like pure magic and lots of math.
lowtolerance 3 points 1 month ago[-]
I don't know which I liked more...Atrium starts out like a parody of some early DirectX intro, and then quickly proceeded to make me shit bricks.
astrosmash 35 points 1 month ago[-]
Neat.
Has anyone been able to find the plans and make it out of the castle yet? I could find nothing but schnapps, sauerkraut, and an SS uniform before I was captured.
LoompaOompa 1 point 1 month ago[-]
What is this s reference to?
dopewars22a 11 points 1 month ago[-]
What an awesome game! It's like you're Microsoft, and the green guys are customers who want Windows XP!
Jaquestrap 0 points 1 month ago[-]
Man, I actually laughed out loud when I read this.
bejitunksu 2 points 1 month ago[-]
Fucking game, I had 550 zombies killed and a huge horde following behind be ready to be gunned down and the game froze whenever I fired. Of course the game continued to work just fine when I stopped, whence I was promptly devoured by zombies. Damn it.
[deleted] 4 points 1 month ago[-]
If you have a programming language that translates small, simplistic code into a preformed character is it still incredibly amazing to make a small game? If you used DirectX to make a game, doesn't that give you a huge set of libraries to use?
If you have a programming language that translates small, simplistic code into a preformed character is it still incredibly amazing to make a small game?
Short answer: Yes. Longer answer: I wouldn't say "incredibly amazing", but it's still a feat.
If you used DirectX to make a game, doesn't that give you a huge set of libraries to use?
Usually, most of the space taken up by the 4K is not the code. Open any "big" game (e.g. Fallout 3, Unreal Tournament, etc.) and compare the size of the .exe and .dll files versus the size of the map, texture, art and music files.
Surely he could squish that down some more. Check out this obfuscated C version of Tetris, 1989 IOCCC Best Game winner.
Still mostly works for me under Debian GNU/Linux 4.0 using: cc -o tetris tetris.c
Shame, I couldn't get it to compile on my computer. And no I am NOT going to debug it.
Although, keep in mind, uncompiled that's still 1486/4096 bytes right there, or over 1/3rd the size (granted the compiled size should be less, but sadly I don't know this). But still, you're not working with much space here.
noiserr 6 points 1 month ago* [-]
When you mention compact programming only one thing comes to mind. 1K http://www.pouet.net/prod.php?which=32194
download and execute it or just watch a video of it. The guys who compete via The Scene are amazing programmers.
tluyben2 11 points 1 month ago[-]
For people without Java enabled browsers (like me);
$JAVA_HOME/bin/appletviewer http://www.mojang.com/notch/j4k/l4kd/index.html
gnick 10 points 1 month ago[-]
You have a rapid fire weapon until the right yellow bar (horizontal dashes) runs out. At that point you switch to a single fire handgun, which is infinite, but of course requires one click per fire.
And actually, in some situations, you might actually find it easier to survive just by relying on the handgun alone.
woogley 11 points 1 month ago[-]
This 4k contest has been going on for a few years now.. check out the other games at http://java4k.com/
Also the guy that wrote this has also written some other really interesting stuff.. check out Miners4K and Infinite Mario Bros from his webpage: http://mojang.com/notch/
ak_avenger 10 points 1 month ago[-]
I'd like to see the source code for this.
The source for Miners4k seems to have almost the entire game in one main() procedure.
Sikul 6 points 1 month ago* [-]
The .jar is located here: http://www.mojang.com/notch/j4k/l4kd/G.jar
Download, extract, and use a decompiler.
Here's the best java decompiler I know of: http://www.download.com/DJ-Java-Decompiler/3000-2213_4-10046809.html?cdlPid=10811495
I'd do it myself but my trial on DJ Java Decompiler has run out, and none of the other Java decompilers I tried got the source correctly.
[deleted] 4 points 1 month ago[-]
Very fun for something so simple. I love the persistent blood spatter effects, and the 'grainy' look.
FurryMoistAvenger 7 points 1 month ago[-]
I keep dying :(
williamager 2 points 1 month ago* [-]
Is the ammo supposed to be unlimited when clicking repeatedly, or is that a bug?
It does seem to make the game a bit easier.
spuur 62 points 1 month ago* [-]
KKrieger 96K pic1
KKrieger 96K pic2
KKrieger 96K pic3
KKrieger 96K pic4
KKrieger 96K pic5
Download from: http://www.theprodukkt.com/kkrieger
AirRaven 13 points 1 month ago[-]
Getting on a bit now, but still by far the finest thing ever to come out of the demoscene.
Wish they'd finished it.
S7evyn 2 points 1 month ago[-]
From memory, they ended up working on Spore.
shujaa 7 points 1 month ago[-]
what a waste of talent