Simple Miner
Created using OpenGL and my personal C++ engine
Overview
This project is the first 3D project using my personal C++ engine, Green Engine. It focuses on replicating the voxel style of Minecraft. This project features:
As I mentioned above, this is the first project in the Green Engine that featured 3D rendering. Before this, the Green Engine was primarily a 2D engine which made the beginnings of this project a little difficult. I'd never worked with 3D before so this was definitely new for me. Once I began to delve a bit deeper in I definitely found it odd that it was the world that moved, not the camera when I was surveying my scene. This seriously blew my mind at first, and still does sometimes!
The primary goal of the Simple Miner project was to get 3D rendering into the Green Engine. As you can see from the pictures above, that was obviously a success. The secondary goal was to replicate the voxel style of Minecraft, which I would say was also pretty successful. To replicate this style I used Perlin Noise to determine the height of each stack of blocks. This allowed for the world to appear natural as the varying heights that the Perlin Noise returned created hills and valleys that flowed and looked great!
The project also featured saving and loading from a custom .Chunk file and this allowed for the placing and breaking of blocks within the different Chunks. By using Run-length Encoding, I was able to save blocks that left the custom render distance to a file and then load them back into the application when they came back into view. If a block had not been created yet, then it was generated on the spot using Perlin Noise! The functionality of the whole thing allowed for the player to wander the world for as long as they wanted, which is one of the things that I love about Minecraft.
In the end, I was able to add 3D rendering to the Green Engine for future use and get a pretty neat voxel style game out of it. I hope you enjoy it as much as I did. If you have any other questions, please contact me and let me know! I'd be glad to answer any questions.
- Custom Chunk save files
- 3D realtime rendering
- Run-length Encoding (RLE)
- Saving to, and loading from, a file
- Perlin Noise for consistent hills and valleys across Chunks
- Simple physics and collision
- Sound effects
As I mentioned above, this is the first project in the Green Engine that featured 3D rendering. Before this, the Green Engine was primarily a 2D engine which made the beginnings of this project a little difficult. I'd never worked with 3D before so this was definitely new for me. Once I began to delve a bit deeper in I definitely found it odd that it was the world that moved, not the camera when I was surveying my scene. This seriously blew my mind at first, and still does sometimes!
The primary goal of the Simple Miner project was to get 3D rendering into the Green Engine. As you can see from the pictures above, that was obviously a success. The secondary goal was to replicate the voxel style of Minecraft, which I would say was also pretty successful. To replicate this style I used Perlin Noise to determine the height of each stack of blocks. This allowed for the world to appear natural as the varying heights that the Perlin Noise returned created hills and valleys that flowed and looked great!
The project also featured saving and loading from a custom .Chunk file and this allowed for the placing and breaking of blocks within the different Chunks. By using Run-length Encoding, I was able to save blocks that left the custom render distance to a file and then load them back into the application when they came back into view. If a block had not been created yet, then it was generated on the spot using Perlin Noise! The functionality of the whole thing allowed for the player to wander the world for as long as they wanted, which is one of the things that I love about Minecraft.
In the end, I was able to add 3D rendering to the Green Engine for future use and get a pretty neat voxel style game out of it. I hope you enjoy it as much as I did. If you have any other questions, please contact me and let me know! I'd be glad to answer any questions.
If you would like to view the complete C++ code I wrote to handle the chunk functionality, then please click here!
(This link will take you to bitbucket)
(This link will take you to bitbucket)