I'm amazed you could fit this into 4k! I can hardly wrap my head around raycasting the way you did or like Notch in Prelude of the Chambered using a pixel array.

Thanks ! I love voxels and raycasting and I’m working on quite a long time ;)

Feb 6

Hello, I'd like to know how you did the lighting in "in the dark" it's really interesting, I see it around a lot. I just can't wrap my head around how it's done. Could you give any tips?

Hi psycho,
you can find some explanations somewhere in this post on JGO and the sourcecode is available at the bottom of the game’s page.
But finally, it’s just raycasting through the 3D voxelbox, from the point light to every visible voxel.

Feb 4

How to render a OpenGL shaded quad without artifact

To resolve this, you have to determine which diagonal of the quad has the smallest factor like that :


I’m agree with the fact that you will certainly be forced to modify your code to be able to control the vertices rendering order…

Jan 9

In The Dark 4K

The game has been submitted on Java4K there is now 7 days ago.

I’ve opened a post on with the youtube video,  to present the game and two 2 days later, the game has been available.

This is my first own analysis on the feedback :

  • The video has produced lots of positive reactions
    "The graphics have contributed to this"

  • The difficulty seems too hard
    "Speed of enemies has been a bit reduced.
    Aiming mode is certainly another cause of this.”

  • The aiming mode needs training or should be different
    "Aiming mode could have been different, but I like this one…
    Two other ways of doing it have been proposed on the forum :
         - Shooting in the direction of moving
         - Aiming and firing with mouse
    If I’m motivated in few days, I will make versions with the two other ways of aiming to see if the gameplay could be funnier”

  • Some technical explanations and sourcecode have been requested
    "I quickly explained the rendering algorithm and the sourcecode was posted."

So, in short, this is what I can retain for now :

  • Reactions and feedback of the JGO community were very interesting
  • Gameplay can only be estimated by players and not by the author
  • Giving explanations and sharing code have not killed me :D

A observation for this year :
there are fewer games than the past years for the same period…
Are people working more on their games to refine them to the time limit, or is there a little smell of death in the air about this contest ? (I hope it’s the first one because I love this contest !)


Just to see it in action : In The Dark 4K - First level - Gameplay


Finally got it in 4K !!!

The game’s called « In The Dark »

The story (updated)
After being captured by the ghosts of last year, our sorcerer has been locked in a jail in the basements of the witch’s castle. After several months, he decides to escape. He can still shoot fireballs. And, because of the darkness, he uses a spell which produces a light above him, but it runs out over time. To revive it, he needs to kill creatures. So pay attention to his intensity…

To go upstairs through the 5 levels, he has to collect the coins scattered all over each one.

The UI
 - green bar is for life level
 - white bar is for light intensity
 - on the right, the number of coins to collect in the current level

Game Controls
 - Move : Arrow keys
 - Jump : SPACE
 - Fire : W
 - Pause : P
 - Start/continue : ENTER

The player can move freely, but when you start shooting, the shooting direction locks until you release the fire key.

And now ?
In few days, I will post it on :
 - the Java4K Contest Site : to enter the contest and make it playable
 - (JGO) : to have feedbacks and play with other games.


After few weeks without news, I come back with a new little project.
Java4K is coming soon, and this is what I’m trying to put in 4K.

The story :
After being captured by the ghosts, our sorcerer has been locked in a jail in the basements of the witch’s castle. He can still shoot fireballs, For light in the darkness, he uses a spell which produce a light above him, but it runs out over time. To revive it, you need to kill creatures. So pay attention to his intensity…
To go to the next level, find the purple platform.
UI is very simple, the green bar is for life level and the white one is for light level.

The challenge :
So, this is where I am with this little game. For now it doesn’t fit in 4K, but I’m working on it !
Just like last year, I focus the 4K on the technique (realtime light and shadows rendering and the physics), so with so few content, the game probably will not be very fun and a bit repetitive… (Next step, learning how to make funny games with good gameplay and less technique :) But this is again the choice I made for this year, and that’s really what I like ! It reminds me a bit of old demoscene.

One more thing for this version, I chose a higher resolution, so the game is more blocky and less attractive than on the thumbnails… but this may still change !

Sep 5

I’ve ported the rendering to OpenGL (LWJGL) to reduce CPU usage. So I find the result nicer and easy to tune with GLSL.

The framerate is low, because for now I want to keep the ability to destruct the whole map. The bottleneck in the rendering process is the size of the frustum voxelbox (160x90x130) and the CPU loop used to browse it.

I’m also currently porting the voxel object editor I’ve made for the 4K Contest, to use this engine.

I think I will try another game style to see if with a smaller frustum box, it can be faster or if I will have to find another solution for the rendering loop.

Sorcerer3D [WIP] Playable

Game is available here (Java Applet version)

Gameplay is the same as Sorcerer4K (just kill ghosts along levels…), because the main goal was to update the rendering process to 3D. I hope that rendering is fast enough for the game to be playable.

Rendering process works like this :

  • Extract visible portion of the “World” VoxelBox in a “Frustum” VoxelBox
  • Add UI messages et informations in Frustum VoxelBox (life, ghosts left, messages…)
  • Create a shadow map of the Frustum VoxelBox
  • Check and render visible blocks of the Frustum VoxelBox

Rendering process calculates :

  • a shadow map from the Frustum VoxelBox


  • a diffuse color for each face


  • a shadow value per face and a ambient occlusion factor per vertex


  • Finally the combination of all these values gives the final picture


I’ve also added sounds just to test, it’s working, but I find them a bit boring during game (need a option to deactivate them !)

Now, I want to make a game engine from this version (lots of work…).

Next step, organizing source code in packages (Renderer, Scene, Entities, Model, Physics, Controller, Resources…)

Sorcerer3D 0.1 [WIP]
This is the game Sorcerer4K with a 3D software rendering engine.

Sorcerer3D 0.1 [WIP]

This is the game Sorcerer4K with a 3D software rendering engine.