A simple voxel engine written in C with OpenGL that renders directly in your terminal.
This project is a block-based game implementation in C. The project uses OpenGL and offscreen rendering, taking the pixels from the GPU and building an optimized buffer. Tree shaking (aka buffer diffing) is yet not fully supported, but the game already groups by colors and write to the terminal in only one single syscall per frame.
Note: Make sure your terminal is big enough or the screen will be very weird
- WASD/Arrows Moves the character
- Q and E breaks and create blocks
- IJKL moves the camera
- Z exits
- Why that weird inputs? Because termios and the Unix api only provides the access to the terminal emulator sent bytes. Almost every only sends keys and not mouse input
The game may not render correctly depending on your terminal resolution or your terminal text-transfer rate. Even by optimizing the scape codes, the game is not able to render correctly, for example, on terminals with limmited I/O like the VS code integrated terminal. The recomendation is to use gpu-powered ones like Kitty.
- OpenGL Rendering
- Termios Unix API
- Optimized screen rendering
- TrueColors (24-bit colors escape codes)
- Infinite chunk generation
- C
- OpenGL
- Ansi escape Codes
Note: Requires CMAKE and a C compiler. UNIX-ONLY
- Clone the repository with
git clone https://github.com/Renan-G-projec/MineAscii.git- Build the game with CMAKE. All the dependencies are packed toguether and cmake will download them.
cmake -B build
cmake --build build- Run the game! (make sure you run thje command in the project root!)
./build/MineAscii- The project still don't have a version for windows. Though, the defined macros will make more easy to port between Operating Systems.
- Input is still weird by terminal emulation variations. Another library is needed to take user input.
- Clock is still not implemented. Nor deltatime. So the game speed shall be inconsistent by now.
You can watch some previews and the development of the game in here
