GithubHelp home page GithubHelp logo

johnpayne-dev / minecraftc Goto Github PK

View Code? Open in Web Editor NEW
295.0 20.0 21.0 23.08 MB

A Raytraced Minecraft Classic 0.0.30a port to C

License: MIT License

C 99.96% Python 0.01% CMake 0.03%
minecraft classic game cross-platform port c mod macos creative raytracing

minecraftc's Introduction

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

Screen Shot 2022-07-31 at 12 57 49 PM

Screen Shot 2022-07-31 at 12 57 54 PM

Screen Shot 2022-07-31 at 12 43 33 PM

Screen Shot 2022-07-31 at 12 43 39 PM

Downloads

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:

  1. 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
  1. You should now have MinecraftC.sln in your directory that you can open with Visual Studio and build

MacOS instructions for Xcode:

  1. Run the following commands:
git clone --recursive https://github.com/johnpayne-dev/MinecraftC.git
cd MinecraftC
mkdir Build && cd Build
cmake -DMINECRAFTC_MODS -GXcode ..
  1. You should now have MinecraftC.xcodeproj in your directory that you open with Xcode and build

  2. (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):

  1. If you don't have SDL2 already, run these commands:
sudo apt-get update
sudo apt-get install libsdl2-dev
  1. 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

minecraftc's People

Contributors

biolunar avatar johnpayne-dev avatar lionkor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minecraftc's Issues

a personal question

Hello
I pay my respects to your work
I'd like to ask you a question

  1. How long has it been since you started programming? (Because my dream is to be a game programmer. I wonder how long it takes to have skills like you)

  2. Did you develop the logic of Minecraft C by yourself? Or is it based on other references?

I shouldn't write this here, but I was curious about your work
I'd appreciate it if you could answer

P.S. If you answer, I'll delete this post right away

Fix for Linux

Compiling fails on Linux (at least on Debian)

You can fix this by adding set(FLAGS ${FLAGS} "-I/usr/include/SDL2" "-D_GNU_SOURCE=1" "-D_REENTRANT") to the UNIX section.

Can't build: fatal error: icd_cmake_config.h: No such file or directory

├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── inc
│   └── README.txt
├── LICENSE
├── loader
│   ├── icd.c
│   ├── icd_cmake_config.h.in
│   ├── icd_dispatch.c
│   ├── icd_dispatch_generated.c
│   ├── icd_dispatch.h
│   ├── icd_envvars.h
│   ├── icd.h
│   ├── icd_platform.h
│   ├── linux
│   │   ├── icd_exports.map
│   │   ├── icd_linux.c
│   │   └── icd_linux_envvars.c
│   └── windows
│   ├── adapter.h
│   ├── icd_windows_apppackage.c
│   ├── icd_windows_apppackage.h
│   ├── icd_windows.c
│   ├── icd_windows_dxgk.c
│   ├── icd_windows_dxgk.h
│   ├── icd_windows_envvars.c
│   ├── icd_windows.h
│   ├── icd_windows_hkr.c
│   ├── icd_windows_hkr.h
│   ├── OpenCL.def
│   ├── OpenCL-mingw-i686.def
│   └── OpenCL.rc
├── README.md
├── scripts
│   ├── gen
│   │   └── init.py
│   ├── gen_loader.py
│   ├── gen_print_layer.py
│   ├── icd_dispatch_generated.c.mako
│   ├── icd_print_layer_generated.c.mako
│   └── README.md
└── test
├── CMakeLists.txt
├── driver_stub
│   ├── cl.c
│   ├── cl_ext.c
│   ├── cl_gl.c
│   ├── CMakeLists.txt
│   ├── driver_stub.def
│   ├── icd.c
│   ├── icd_driver_exports.map
│   ├── icd_structs.h
│   └── rename_api.h
├── inc
│   └── platform
│   └── icd_test_log.h
├── layer
│   ├── CMakeLists.txt
│   ├── icd_print_layer.c
│   ├── icd_print_layer.def
│   ├── icd_print_layer_generated.c
│   ├── icd_print_layer.h
│   └── icd_print_layer.map
├── loader_test
│   ├── callbacks.c
│   ├── CMakeLists.txt
│   ├── icd_test_match.c
│   ├── main.c
│   ├── param_struct.h
│   ├── test_buffer_object.c
│   ├── test_clgl.c
│   ├── test_cl_runtime.c
│   ├── test_create_calls.c
│   ├── test_image_objects.c
│   ├── test_kernel.c
│   ├── test_platforms.c
│   ├── test_program_objects.c
│   └── test_sampler_objects.c
├── log
│   ├── CMakeLists.txt
│   └── icd_test_log.c
└── pkgconfig
├── bare
│   └── CMakeLists.txt
├── pkgconfig.c
└── sdk
└── CMakeLists.txt

No Supported GPU found but I have an RTX series card...

Hello, When trying to run the game with raytracing enabled i get the error Raytracer.c:33 ERROR: No supported GPU found. The weird thing about this is that my card officially supports ray tracing since its an Nvidia RTX 3060. I have the mesa-opencl-icd package installed and am running kernel 5.13.0. This should be working according to the README but i suspect that either a dependency is missing or there is an issue with the GPU detection. Any help on this issue would be useful.

Can't launch or build

So, i tried building, that did not work(i will say something about that), and then I've thought "you know what, lets get the prebuilt", i downloaded the prebuilt one, and this is the error i get(after getting every dll for it): The application could not start properly (0xc000007b). Click OK to close the application.

The building for me just fails with these errors:
image

source dir and exe name are the same

the source folder and the executable name are the same, meaning

  • if you try building it fails because it can't create a file over a directory
  • if you make clean it wipes the source folder

Flowing water crashes the game on MacOS

Attempting to update a water block (whether with TNT or just by punching a block next to it) causes the game to crash, and gives a "segmentation fault" error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.