For those who don't know, Minecraft 4K was a stripped down version of Minecraft submitted by Notch to the Java 4K Game Programming Contest, where each submission had to be under 4 kilobytes in size. Its wiki page can be found here.
Some things I realized while working with the game's cryptic code:
It uses a 3D voxel raycaster
Textures are generated with an algorithm
Due to the 4 KB size constraint, the code is very inefficient.
I thought I could improve the performance of the code, and create a platform for improving upon it if I rewrote it in C, using SDL as a graphics library. C offers far more low level capabilities than java does, which lends itself to far better performance and efficiency. Fortunately, Java has very similar syntax to C and I was able to straight up copy and paste large chunks of code (albeit with heavy edits and debugging).
Some things I've managed to improve:
Movement controls now work properly.
Less system resource usage.
Some bugs I'm still trying to work out:
"Sticky" block collision - this behavior is present in the original version and I have been trying to work out ways to fix it for a while.
Block outline cuts off at mouse x position.
Goals for this project:
Maintaining the original look and feel as closely as possible.
Keeping the final executable under 10 KB (on Linux, with the system I have set up in the makefile)
Mobs and multiplayer (this would require changing the rendering engine to some degree)
Day/night??? I don't know whether or not this would change the look or feel too much.
This program has been successfully compiled many times on my Pop OS machine with gcc, strip, gzexe, and SDL2. I may look into producing windows specific binaries in the future, but for now the code should compile on windows as is as long as you have SDL2 installed.
Version 0.2 posted, download links have been updated.
Placing and breaking blocks now works
Classic style terrain generation has been fixed
The game can now generate either the original terrain, or new perlin noise terrain using an algorithm I found here. It is possible to get the old terrain by changing line 53 to be genMap(SEED, 0, world);
I am eventually going to make some sort of in game option to pick which terrain style to generate.