MinecraftC - A Raytraced Minecraft Classic Port to C
Features:
- True to the original version (0.0.30a)
- Implemented fully in C using SDL2 and OpenGL 1.1
- Original music and sounds
- A modded and vanilla version
- Works on Windows, Linux, and MacOS
- CMake build system
Raytracing:
- Uses an 8-bit distance field as an acceleration structure
- In some cases, performance is better than the original
- 60+ fps at 1080p on the integrated graphics cards I've tested
- To enable raytracing, download the modded binary and enable it in the mods screen under options
Screenshots
Downloads
- There are two versions, modded and vanilla, where vanilla doesn't have the option to turn on mods
- Windows 32 bit
- Windows 64 bit
- MacOS x86_64
- MacOS ARM
Building
Note: if you would like to build the vanilla version, remove -DMINECRAFTC_MODS=1
from the cmake command
Requirements:
git
cmake
- A compiler of your choice
Windows instructions for Visual Studio:
- Run the following commands:
git clone --recursive https://github.com/johnpayne-dev/MinecraftC.git
cd MinecraftC
mkdir Build
cd Build
cmake -DMINECRAFTC_MODS=1 -G"Visual Studio 17" .. # replace "Visual Studio 17" with your version
- You should now have
MinecraftC.sln
in your directory that you can open with Visual Studio and build
MacOS instructions for Xcode:
- Run the following commands:
git clone --recursive https://github.com/johnpayne-dev/MinecraftC.git
cd MinecraftC
mkdir Build && cd Build
cmake -DMINECRAFTC_MODS -GXcode ..
-
You should now have
MinecraftC.xcodeproj
in your directory that you open with Xcode and build -
(optional) If you would like it in a .app format, you can run this command to convert your executable:
python3 Scripts/MacOS-App.py <path-to-executable> [developer-id]
Providing the developer id will sign the .app, which you can find by running security find-identity
Linux instructions (untested):
- If you don't have SDL2 already, run these commands:
sudo apt-get update
sudo apt-get install libsdl2-dev
- Run the following commands:
git clone --recursive https://github.com/johnpayne-dev/MinecraftC.git
cd MinecraftC
mkdir Build && cd Build
cmake -DMINECRAFTC_MODS=1 ..
make
Modifying Resources
If you're creating a mod and want to change or add any .png
or .ogg
resouces, then run this script to update the resource headers:
python3 Scripts/EmbedResources.py
It will recursively go through all .png
and .ogg
files in Resources/
, and convert them to .h
Known Issues
- There is no survival mode, it was removed for simplicity and compatibility with raytracing
- A few sounds have the incorrect pitch, I'm waiting for cute_sound.h to implement pitch shifting
- Load file and save file are not implemented
- If raytracing doesn't turn on, then something is going wrong with OpenCL, report an issue and I can help troubleshoot