2021-05-08 22:46:47 -04:00
2021-05-07 23:17:10 -04:00
2021-05-07 23:17:10 -04:00
2021-05-07 23:17:10 -04:00
2021-05-08 20:11:35 -04:00
2021-05-08 22:46:47 -04:00

M4KC

Grass block icon

Minecraft 4K - C Rewrite

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.

Being so small, the game proved somewhat easy to de-compile and edit. Multiple people have given this a go, including me.

This project is an attempt to translate the game into C in order to increase its performance, and to provide a platform upon which to add new features.

Bug list

  • "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)
  • More blocks
  • Perlin noise terrain generation (water, caves, etc)
  • Infinite worlds, possibly vertically too
  • 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.

Dependencies

Bare minimum to make this code run

  • SDL2
  • A C compiler

To get it down to a small size, you need

  • gcc (have not tried the flags with other compilers)
  • gzexe

Places

There is a forum thread for this project here

I will be uploading binaries here

Game info

Some extra info about the game.

All blocks by ID

ID Block
0 Air
1 Grass
2 Dirt
3 Stone
4 Bricks
5 Dirt
6 Wood
7 Leaves
8 Dirt
9 Dirt
10 Dirt
11 Dirt
12 Dirt
13 Dirt
14 Dirt
15 Dirt

Controls

How to play the game.

Keyboard

Key Action
W Move forward
S Move backward
A Strafe left
D Strafe right
Space Jump
ESC Pause

Mouse

  • Move mouse: Look around
  • Right click: Place block
  • Left click: Break block
Description
Port of M4KC game for KolibriOS: https://github.com/sashakoshka/m4kc/
Readme 6.7 MiB
Languages
C 98.5%
Objective-C 0.5%
M4 0.4%
Shell 0.3%
CMake 0.1%