overview
Mini Minecraft is a miniature version of the popular game Minecraft, taking many base elements of the game and replicating them using C++ and OpenGL. This is the final project of my graduate-level graphics course CIS 5600: Interactive Computer Graphics, which I took in the spring of 2022, and is a collaboration with two other teammates, Sherry Li and Gabby Gu. The final result is an amalgamation of many features, including caves, tons of biomes, shadow mapping, a beautiful day/night cycle, weather, block/item interactivity, and more.
details
Although I helped with other features, my main contributions were player physics, multi-threaded chunk generation and unloading, L-system rivers, block and special item interactions, and an inventory, crafting, and chest system.
Player Physics: Player physics entails simple walking, running, jumping, and flying, as well as collision detection. Collision detection is accomplished using a grid-marching algorithm which calculates the distance a player is from a boundary, separately on all 3 axes. This also allows for sliding against surfaces. Jumping is accomplished with a simple gravity simulation.
Multi-threaded Chunk Generation & Unloading: Chunk generation had to be split into 2 halves for this process: the terrain height data, or FBM data, and terrain coloring data, or VBO data. Firstly, a function is called in each tick to determine if new chunks need to be loaded (if the player is in a new position). If so, FBM workers instantiate new chunks to be loaded and fill them with block data using expensive FBM noise functions, then VBO workers draw the textures on the chunks with block data. This massive new quantity of data is stored as a set of vectors to be generated concurrently through multi-threading. Finally, all the new data is sent to the GPU to be rendered.
2D L-Systems: To create randomly generated rivers, I used 2D L-systems, which draws rivers by forming a tree-like structure represented by a random, meaningful string of characters.
Block and Special Item Interactions: Breaking and placing blocks is easily accomplished with the same grid-marching algorithm used for collision detection. GUI for face outlines and center pointer are included here. Special blocks and items I added include TNT blocks, fishing blocks, and gift blocks that spawn in the winter biome.
Inventory, Crafting, and Chest System: GUIs for all of these screens from the original Minecraft game were recreated in C++, and logic for relationships of items, item quantities, and item arrangements is built on many array systems. Splitting stacks of items, dragging items to the crafting menu, and storing multiple chests with specific item position data are examples of mechanics I engineered in this phase.