Skip to content

Latest commit

 

History

120 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MineAscii

A simple voxel engine written in C with OpenGL that renders directly in your terminal.

Check the gif!

Description

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.

Controls

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

Notes about performance

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.

Features

  • OpenGL Rendering
  • Termios Unix API
  • Optimized screen rendering
  • TrueColors (24-bit colors escape codes)
  • Infinite chunk generation

Tecnologies

  • C
  • OpenGL
  • Ansi escape Codes

Compiling

Note: Requires CMAKE and a C compiler. UNIX-ONLY

  1. Clone the repository with
git clone https://github.com/Renan-G-projec/MineAscii.git
  1. Build the game with CMAKE. All the dependencies are packed toguether and cmake will download them.
cmake -B build
cmake --build build
  1. Run the game! (make sure you run thje command in the project root!)
./build/MineAscii

Future Plans

  • 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.

What if i don't wanna compile the game?

You can watch some previews and the development of the game in here

About

A minecraft-based game in C that runs on the terminal. Uses 24-bit colors and the GPU + OpenGL for pixel processing by Offscreen rendering.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages