GithubHelp home page GithubHelp logo

officialpixelbrush / betrock Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 22.99 MB

C++ Application for exploring Minecraft Beta 1.7.3 Worlds

CMake 3.27% C++ 65.64% C 0.61% GLSL 5.10% Makefile 21.65% Python 3.72%

betrock's Introduction

Betrock

C++ Application for exploring Minecraft Beta 1.7.3 Worlds

Screenshot

Betrock Screenshot

Background

This project was an idea I had around the middle of 2023 but due to various factors, mainly me being busy with school and work, I was unable to realize it. As I'm unemployed right now, I figured I may as well get busy and learn some proper C++ and finally delve into OpenGL. This project is the result of that.

As a first step, I decided to see how far I could get with Python, to see how difficult it'd be to decypher Minecraft Beta's McRegion file format. Soon enough, I was able to extract the raw block data and dump it into a binary file. I reused the code of an old voxel world gen attempt I made in Godot, and reworked it to accept said binary files. Lo and behold, a chunk was loaded.

The next day I rewrote that code directly in GDScript to load whole McRegion files entirely in Godot, now allowing arbitrary regions to be loaded. However, due to each cube being rendered individually, the performance was rather abysmal. As a result, I figured I'd challenge myself and recreate something like it from scratch in C++ and OpenGL.

The Python and Godot experiments of this project are linked here.

Code Style

I'm new to C++!

This is moreso a disclaimer. I'm new to C++, so there'll be lots of C-isms as I try to get a proper grip on how C++ works and how to properly work with various OOP-isms. If there's code that looks out of place or outright bad, feel free to give tips as to how to improve it. I'd love to learn more!

Never Nesting Rules

In an attempt to keep this Code somewhat readable for other people (and for me in the future), I've chosen to employ the Never Nest design pattern.

Please refer to the following video as to why: "Why You Shouldn't Nest Your Code" by CodeAesthetic

Progress

  • Import Beta 1.7.3 compliant Minecraft worlds
    • Decode Chunk Offset
    • Decompress Chunk Data
      • Gzip
      • Zlib
    • Decode NBT Data
    • Turn NBT Data into C++ Objects
    • Extract Block Data
  • Render Block Data (via OpenGL)
    • Render something
    • Render a Texture
    • Render a Cube
    • Have a Camera that's keyboard and mouse controlled
    • Add Lighting
    • Model Importing
      • OBJ
      • [ ] glTF
    • Render a Chunk
    • Render a Region
    • Render Multiple Regions
    • Render per-face Block lighting
      • Render Sky Lighting
      • Render Block Lighting
    • Fog
  • Dynamic Chunk Loading
  • Windows Version - stb causing issues here

Resources

Minecraft Wiki

wiki.vg

YouTube

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.