submitted on22 Dec 2008
points787
up votes943
down votes156

programming

(80081 subscribers)

a community for 2 years

spuur 62 points 1 month ago* [-]

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

1917777 150 points 1 month ago* [-]

I guess at 4k the graphics are...

Puts on sunglasses...

pretty tightened up.

ffn 111 points 1 month ago[-]

YEEEEAAAAAAAAAAAHHHHHHHH!!!

hardnutz 13 points 1 month ago[-]

And my mom said i would never get anywhere with these games

amatriain 44 points 1 month ago[-]

Your mother was pretty tight herself.

dimensional_dan 39 points 1 month ago[-]

was

aedes 25 points 1 month ago[-]

YEEEEAAAAAAAAAAAHHHHHHHH!!!

GuigzForAll 2 points 1 month ago[-]

</Caruso>

No one ever closes the damned tag.

ed19 1 point 1 month ago[-]

No one opened it.

almkglor 2 points 1 month ago[-]

And my mom said i would never get anywhere with these tags

ehird 2 points 1 month ago[-]

YEEEEAAAAAAAAAAAHHHHHHHH!!!

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

OH FUCK WHAT THE FUCK THIS IS INSANE HOW MANY FUCKING ZOMBIES?? DIE DIE DIE YOU FUCKERS YOU FUCKERS YOU ALL DIE YOU'LL NEVER TAKE ME A FUCKING LIVE AAAAGHGA AGAGAGAGAGHAHGA GAAAAAAAAAAAAAAAAAAAAAAAAAAAH

...

I advise you don't play this game in a crowded office, and if you do, try not to scream out like I did

Verroq 21 points 1 month ago* [-]

Zombie zerg rush.

500million bastards stormed me...

eaturbrainz 28 points 1 month ago[-]

Yeah, we do that.

sam512 20 points 1 month ago[-]

You realise you're perpetuating a negative stereotype?

blufr0g 2 points 1 month ago[-]

Zombie zerg rush a negative? When have 500million humans ever organized themselves behind a common cause?

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.

Alexd007 17 points 1 month ago[-]

Uphill! Both ways! On our knees! Backwards!

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.

quink 80 points 1 month ago[-]

I use Dvorak, you insensitive clods!

ep_ 27 points 1 month ago[-]

I played using an azerty keyboard, that added a lot to the stress.

an_idiot 10 points 1 month ago[-]

Yeah . There are arrow keys on all keyboards but for some reason they go with WASD .

ziegfried 26 points 1 month ago[-]

I think it's because the arrow keys are by the right hand, while most of us also use the right hand for the mouse button you use to fire.

Moving with the left hand and aiming and firing with the right seems like the right call, as far as I can tell.

MyrddinE 2 points 1 month ago[-]

Indeed. I'm just sad that id (the guys that popularized WASD) didn't use ESDF instead. There's no good reason to have your hand not be on the home row...

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.

ziegfried 1 point 1 month ago[-]

You're absolutely right.

Especially with the fact that your hand can slip, and then there's no way to find the "r" since you don't know where your hand is.

the home row always has the little dots on the F and J so that you can always find them by feel.

tjay 6 points 1 month ago[-]

Or you could just move your left hand over to the right ;) (And have the reload key be something else..)

Poromenos 15 points 1 month ago[-]

It's wasd because you can use Q, R, E, ctrl, space, tab and shift with one hand that way.

xzxzzx 8 points 1 month ago* [-]

Alt, F, C, Z, X, V, T, G, 1, 2, 3 and 4 are within easy reach too.

Poromenos 15 points 1 month ago[-]

That whole general area, I guess!

enauv 1 point 1 month ago[-]

It's for right handed gamers, so they can use the mouse as well as move.

d-_-b 0 points 1 month ago[-]

Moving from arrow keys to WASD is like puberty / rite of passage for mouse / keyboard shooting games.

They should allow you to remap - but eh.

ddelrio 12 points 1 month ago[-]

Where's all the Java bashing? Who are you all and what have you done with the reddit community?

hiffy 9 points 1 month ago[-]

They're all still playing the game.

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?

cdesignproponentsist 1 point 1 month ago[-]

And what's the deal with airport checkin lines?

kernelhappy 15 points 1 month ago[-]

I want to know why Java games in a web browser have to have a postage size window.

ido 2 points 1 month ago* [-]

It is a fixed size window, one that was probably designed for lower resolutions than your monitor.

Seemed like the right height for me (although still much narrower than necessary) at 1152x864.

mazing 1 point 1 month ago[-]

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.

blinks 2 points 1 month ago[-]

I'd bet that it has more to do with the program being so small -- less time to pull it down than the normal Java cruft.

casta 1 point 1 month ago[-]

Eventually, the new JVM doesn't take minutes to start up :)

almafa 20 points 1 month ago[-]

THIS is 4k too... though obviously not java :) Link to the executable (needs modern hardware)

Keyframe 2 points 1 month ago[-]

This is art. Would love to see code of one of these, or an essay about how these things are programmed.

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.

spuur 4 points 1 month ago[-]

Was Receptor released before or after Atrium?

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.

almafa 2 points 1 month ago[-]

After. Atrium was at Breakpoint, in march. Receptor at NVScene, august.

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.

d-_-b 10 points 1 month ago[-]

Wow, fucking amazing memories!!

LoompaOompa 1 point 1 month ago[-]

What is this s reference to?

ILeftDiggforReddit 3 points 1 month ago[-]

and now the second item is the parent comment.

semafor 2 points 1 month ago[-]

the first, actually

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.

Nwallins 2 points 1 month ago[-]

Man, I actually laughed out loud when I read this.

LOL

50:3 ratio. Beat that, Hamming.

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.

knome 3 points 1 month ago[-]

Beating a level means the game gets harder,

You can win? :o

ed19 2 points 1 month ago[-]

I haven't figured out how to pass a level yet.

knome 1 point 1 month ago[-]

Shortly after commenting I found a room that moved me to the next level. Perhaps I am just slow. I killed my first eleven hundred zombies or so without noticing I had a machine gun at my disposal. :|

[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?

Nebu 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?

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.

badjoke33 32 points 1 month ago[-]

The flashlight effect is great. It almost gives a 3D illusion sometimes.

Skofo 16 points 1 month ago[-]

Actually, even "3D games" are a 3D illusion.

ryangoff 1 point 1 month ago[-]

Wolfenstein ftw!

Skofo 1 point 1 month ago* [-]

Plus every single FPS, for that matter.

All 3D games are simply 2D images curved, angled and rotated in fancy ways to give the illusion of 3D.

dallen 0 points 1 month ago[-]

For realz?

MrTJC 2 points 1 month ago[-]

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

gnick 1 point 1 month ago[-]

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.

plouj 1 point 1 month ago[-]

Down-modded for "Please don't reuse any of this code in other projects."

UK-sHaDoW 1 point 1 month ago* [-]

Its probabbly because its terrible style code in the java sense.

Its a huge function. Proabbly because of size limits.

plouj 1 point 1 month ago[-]

It looks more like a license/copyright restriction to me.

ralf_ 10 points 1 month ago[-]

Can you win this game?

misterB1138 52 points 1 month ago[-]

No. The only winning move is not to play

Haroshia 11 points 1 month ago[-]

Unless you're Captain Kirk.

estacado 3 points 1 month ago[-]

How do I get to level 2?

curtdrury 1 point 1 month ago[-]

The red room (thanks cconnett) for level 1 is due north.

I can get there with full health only killing about 30 zombies.

I'm now looking for the red room in level 2.

curtdrury 1 point 1 month ago[-]

Level 2 go down a bit and right.

Level 3 seems to be to 'refuel' as the exit is right next to the entrance.

Level 4 is insane.

cconnett 2 points 1 month ago[-]

Find the red room (safe room).

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

Cpt2Slow 15 points 1 month ago[-]

Jeez I just clicked the link and played for 30 minutes!

Nwallins 1 point 1 month ago[-]

I just lost the game.

officemonkey 1 point 1 month ago* [-]

I just lost the game. FYVM.

japhet 10 points 1 month ago[-]

What makes this great is the POV darkness.

sajae80 1 point 1 month ago[-]

this game would be cooler if it was easier to navigate through the board. He should have had the arrows helps move you around. Grrrr

curtdrury 1 point 1 month ago[-]

Can you beat this level? Do the zombies respawn, or is there a finite number of them? HELP!

jspam 5 points 1 month ago* [-]

What, no melee!

LightShadow 5 points 1 month ago[-]

Confirmed: hard to play on a laptop...but still awesome.

Purp 1 point 1 month ago[-]

I could see all the zombies standing there motionless before they saw me and I killed them all before they moved

gwern 11 points 1 month ago[-]

Is it just me, or does one never need to reload?

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.

salgat 14 points 1 month ago[-]

Crap I was just clicking the whole damn time...

curtdrury 5 points 1 month ago[-]

Me too. I thought I had to get a yellow clip to reload the damn thing, somehow. I saw R for reload, and thought that would reload the game.

gwern 1 point 1 month ago[-]

Ah, I see. Rapid-fire is left-click and holding it. It never occurred to me to try that.

Eso 3 points 1 month ago[-]

Short controlled bursts!

vade 14 points 1 month ago[-]

awesome!

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/

Tulenian 2 points 1 month ago[-]

I'd actually be interested in the same style of contest, but in C / C++ with everything statically compiled, that way you really do have to made it ridiculously compact, since you couldn't use standard libraries / classes without it adding to your binary size.

EtherCJ 1 point 1 month ago[-]

So pretty much demoscene?

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.

ido 4 points 1 month ago[-]

He put a link to the source code on his site.

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.

woogley 20 points 1 month ago[-]

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.

FYI, DJ Java Decompiler is just a front-end for JAD, which is free to run from the command line

[deleted] 1 month ago[-]

[deleted]

JC513 12 points 1 month ago[-]

Nice and claustrophobic.

bitobaco 1 point 1 month ago[-]

its like a spooky robotron 2084

[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 :(

freeloadr 5 points 1 month ago[-]

Don't worry, you'll get better.

d-_-b 1 point 1 month ago[-]

Don't worry, F5, and forget getting better.

timmaxw 5 points 1 month ago[-]

Level 2, 2112 points. I bet a lot of people did better...

apostleofhustle 4 points 1 month ago[-]

at least you made it to the temples of syrinx.

dharmatech 2 points 1 month ago[-]

Must have been the way he held his gun in a Caress of Steel.

OMouse 1 point 1 month ago[-]

Level 2, 2604 points. Only because I got stuck in a few spots and had no idea where else to go!

gnotredditor 1 point 1 month ago[-]

amazing programming job

dawnerd 3 points 1 month ago[-]

Absolutely amazing. I thought it was going to be crappy at first, but I was completely wrong. Good job. Nice example of what can be done with little space.

parla 2 points 1 month ago[-]

A bit weird that wasd does not move the character according to the direction he's facing, but awesome none the less.

Clothos 9 points 1 month ago[-]

You can always tell the Resident Evil fans, huh?

DetpackJump 2 points 1 month ago[-]

And people who can't walk backwards

Clothos 1 point 1 month ago[-]

Well, in this case, you're always facing the cursor, so you can in fact walk backwards.

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.

Verroq 7 points 1 month ago* [-]

You have an automatic weapon first, if that runs out, you have a hand gun with infinate ammo.

roxxe 1 point 1 month ago[-]

cool

lybrel 2 points 1 month ago[-]

In a way, it's a shame there's no sound.

awag22 3 points 1 month ago[-]

I want someone to add sound + creepy music to this. Also I wish I could close the doors.

recursive 0 points 1 month ago[-]

That's a pretty sweet grey square.

I didn't find the zombies yet though.

ComcastRapesPuppies 1 point 1 month ago[-]

You need to install JRE or something.

mr_dbr -4 points 1 month ago[-]

..not 4096x3112 (4K) Left For Dead, I assume?