In The Dark 4K

Hi all,

My game for this year is the next chapter to Sorcerer4K.

In The Dark 4K

Story and controls will be found on the Java4K detail page or on this post on my Tumblr.
I hope gameplay is a bit better than last year !?!

Feedback are welcome now the game is available :wink:

Here’s a short video to show you the game.


I can’t believe you managed to fit that into 4K.

Well done.

I love it, brilliant graphics for such a small file

Indeed very nice! has a Gauntlet feel to it which I think is a good thing :slight_smile:

Amazing! It looks very detailed and “complete” for a 4K game.

Will you release the source code? I’m curious how you’re rendering, calculating lighting, particle effects, and collisions all under 4K.

:o Wow :o

Wow too !
Thank you for feedback and medals !
The link’s coming, but I just hope that after playing the game, you will say the same :wink:
About the source code, I can post it, but I find it ugly with illogical things, it’s structured for compression, not readability.

Ok, now game is available, so real verdict !
I’ve updated the first post and I hope it will work fine for everyone, because the game is a bit cpu expensive :stuck_out_tongue:

Very impressive, though I can’t help thinking free look/aim with the mouse would make it a lot more playable.

Agh! IcedTea is not letting me play the game! I need to know how you make those light effects in 4K! ;D

Thanks for playing (and trying to ;)) it !

Abuse, about the aiming mode, I’m agree with you, the game would be easier with mouse control,
but different, with only 5 levels it would take 2 minutes to finish it.
The actual mode needs a bit of training, but if other people want a modification for this part, there’s still time… 8)

Oskuro, if problem only occurs with my game, perhaps shoud I try to fixe it…

Quickly, the lightning works on 3D raycasting through the voxelBox :
The ray starts at light position and moves down, step by step, to each illuminated block, accumulating a shadow factor based on neighbors blocks along the ray, and finally adding a appoximated ambient occlusion factor.
Initially, the first idea was to make it work with no idea if it will be speed enough, but finally, with a bit of optimisations (fixed int, rendering loop…) it works !

Sourcecode is coming soon, but I need to comment it more before posting it.

Wow… Amazing! I´ve recently been thinking about how to make a game like this and now you´ve done it. And it´s a 4k game?! If that´s not worth a medal I don´t know what is! Well done!!:smiley: I´m reeeally looking forward to source for this one!

Nah, it’s a problem with the IcedTea plugin in my browser. When enabled, all pages that contain an applet kind of die, so don’t worry about it :slight_smile:

I’ve been tinkering with normal maps to get a similar effect on my project, but performance is very poor, hence why seeing yours work so well has me amazed. If I recall correctly, Notch’s Left4kDead also used raycasting for its lighting. I’ll have to look it up, maybe treat normal map pixels as voxels…

Amazing cool game! And very hard. So the trick with the aiming is to hold the firing control and then you can move sideways. But I still haven’t been able to pass the first level! :smiley: Will have to try some more. Not sure if it is too hard or not.

This is why I love java4k. That looks spectacularly breathtaking for a 4k game.

I loved Sorcerer4K and I love this game even more. Simply brilliant!

The voxel/lighting effects are beautiful. Quite something for 4K!
My only grumble is the direction of fire, sometimes I really have to work hard to be firing in the right direction (especially when enemies appear beside or behind me) - couldn’t I just fire the way I’m movng? I guess you’ve done it this way it is for a reason?

Very impressive though! How many voxels are you juggling?

Awesome. No idea how you fit that into 4k lol. Waiting for the sauce code :smiley:

Thanks again ;D

The sourcecode is now available on Java4K !!! I Hope it works fine and can help !

This style of game and the aiming mode is inspired by the game named Voxatron from Lexaloffle.
But yes, it needs training. Perhaps the difficulty is also due to the speed of enemies ?

A little explanation on the rendering pass :
The size of the voxelbox is 1024291024, but the frustum fits in 16829168.
Actually, there are not so much voxels in the lighting pass.
The culling works like this :

  • For each 2D screen column (168)
    • Find all visible voxels for this column (2D raycasting through Y-- and Z++ axis for each row of this column)
    • Sort the result list back-bottom to front-top
    • for each voxel in the sorted list
      • If the voxel is in the light (distance to light)
        • Process lighting (illumination - shadow (3D raycasting) - ambient occlusion)
        • Render the voxel
      • If not do nothing
        The rest is in the sourcecode 8)

About the way of fitting all this in 4K, it was the job of a script applying :
JARG + Proguard + pack200 + finding the best final gz between gzip and BJWFlate + DeflOpt (2 minutes each time I wanted to verify the result) :wink:

Et voilà !

The speed of enemies has been reduced a little.
I hope it’s easier and more playable now.