A blazing-fast, experimental ASCII game engine from inside a Windows CMD. Render 3D wireframes and dynamic visuals directly in to your console using only ANSI escape codes and pure C.
- Zero dependencies: No libraries, no frameworks, no runtime bloat. Just raw C and your Windows console.
- Instant install & run: Download, build, and playโno setup, no package managers, no headaches.
- ASCII based graphics costume face, edge, dot Graphics and Shader, real-time camera, smooth animation and simple texture managment.
- Install GCC (UCRT64 MSYS2 recommended).
- Open the UCRT64 MSYS2 terminal, navigate to project
rootdirectory. - Run:
This builds everythingโno libraries, no extra steps.
./install.bat - Run the engine:
./engine.exe
Thatโs it! No libraries, no dependencies, no Python, no CMake, no makefiles. Just raw C and Windows.
W/A/S/Dโ Move camera forward/left/back/right.SPACE/CTRLโ Move camera up/down.Q/Eโ Turn camera left/right.R/Fโ Look up/down.- Mouse โ Look around (if supported).
Shiftโ Move faster.Escโ Exit.
- Dynamic FPS display.
- Optimized buffer output for smooth animation.
- Minimal dependencies (just GCC and Windows).
- Realtime zoom in and out (Change resolution on fly).
- Costume Shader, Textures, Animations.
The engine uses a simple but effective "shader" based system for clock, angle and depth ASCII rendering:
- ASCII-Color Shader Characters and their Color change, based on distance, angle, speed of the camera.
You can customize shaders in SHADER.c or use the provided edge_shader and dot_shader helpers.
The engine supports rendering individual points (dots) in 3D space. This is useful for creating stars, particles, or other single-point visuals.
Example:
// Create a dot at (x, y, z)
dot d = dot_shader((vertex){x, y, z});
// Add to your dot array and pass to draw_unified()The engine supports rendering edges (lines) between two points in 3D space. This is the foundation of wireframe rendering.
How to Add Edges:
// Create an edge between two vertices
edge e = create_edge_with_shader((vertex){x1, y1, z1}, (vertex){x2, y2, z2});
// Add to your edge array and pass to draw_unified()Faces are triangles or quads defined by 3 or 4 vertices. They can be flat-colored or textured.
Example:
// Create face examples
face test_faces[2];
// Triangle face example
faces[0].vertex_count = 3;
faces[0].vertices[0] = (vertex){.0f, .0f, .0f};
faces[0].vertices[1] = (vertex){-50.0f, .0f, .0f};
faces[0].vertices[2] = (vertex){.0f, 50.0f, 0.0f};
faces[0].texture = simple_texture;
faces[0].texture_width = 8;
faces[0].texture_height = 8;
faces[0].color = 93; // Bright yellow fallback
faces[0].ascii = '#';
// Quad face example
faces[1].vertex_count = 4;
faces[1].vertices[0] = (vertex){30.0f, 10.0f, 60.0f};
faces[1].vertices[1] = (vertex){20.0f, 10.0f, 50.0f};
faces[1].vertices[2] = (vertex){30.0f, 30.0f, 60.0f};
faces[1].vertices[3] = (vertex){30.0f, 20.0f, 40.0f};
faces[1].texture = simple_texture;
faces[1].texture_width = 8;
faces[1].texture_height = 8;
faces[1].color = 96; // Bright cyan fallback
faces[1].ascii = '@';Meshes are collections of edges, dots, and faces. To render a mesh, collect its primitives and call the unified renderer.
How to Add Meshes:
// Prepare arrays of edges, dots, and faces
edge edges[] = { ... };
dot dots[] = { ... };
face faces[] = { ... };
// Call the unified draw function
draw_unified(edges, edge_count, dots, dot_count, faces, face_count);The engine now supports advanced shading for faces based on their depth and rotation relative to the camera. This enhances the 3D effect and provides more dynamic visuals.
- ASCII Characters: Characters change based on the distance of the face from the camera.
- Color Shading: Colors are selected dynamically based on depth, using ANSI color codes.
- Dynamic Characters: Characters change based on the angle between the face's normal and the camera's view direction.
- Enhanced Realism: Provides a sense of orientation and depth for each face.
// Create a triangle face
vertex vertices[3] = {
{0.0f, 0.0f, 0.0f},
{-50.0f, 0.0f, 0.0f},
{0.0f, 50.0f, 0.0f}
};
face shaded_face = create_face_with_shader(vertices, 3, test_texture, 8, 8);
// Create a quad face
vertex central_vertices[4] = {
{-5.0f, -5.0f, 0.0f},
{5.0f, -5.0f, 0.0f},
{5.0f, 5.0f, 0.0f},
{-5.0f, 5.0f, 0.0f}
};
faces[0] = create_face_with_shader(central_vertices, 4, test_texture, 8, 8);These shaders are implemented in SHADER.c and can be customized further to suit your needs.
- Prepare geometry: Fill arrays of
edge,dot, andfacestructs. - Call
draw_unified(...): This handles depth sorting, Z-buffering, and efficient redraw. - The engine projects, sorts, and draws everything with correct depth, color and ascii.
ASCIILATOR/
โ
โโโ bin/ // Compiled binaries and executables (NOT USED)
โโโ engine/ // Core engine source code
โ โโโ camera/ // Camera system for 3D navigation
โ โ โโโ CAMERA.c
โ โ โโโ CAMERA.h
โ โโโ input/ // Input handling (keyboard/mouse)
โ โ โโโ INPUT.c
โ โ โโโ INPUT.h
โ โโโ rasterizer/ // Rasterization and rendering logic
โ โ โโโ RASTERIZER.c
โ โ โโโ RASTERIZER.h
โ โโโ render/ // Frame buffer and output system
โ โ โโโ DOT_ANIMATION.h
โ โ โโโ EDGE_ANIMATION.h
โ โ โโโ EDGE_DRAWER.h
โ โ โโโ FACE_DRAWER.h
โ โ โโโ FACE_TEXTURE.h
โ โ โโโ RENDER.c
โ โ โโโ RENDER.h
โ โโโ shader/ // ASCII and color shader logic
โ โ โโโ SHADER.c
โ โ โโโ SHADER.h
โ โโโ ENGINE.c // Main engine entry point
โโโ resource/ // Resources like textures and animations
โ โโโ plane.png
โ โโโ render.gif
โโโ install.bat // Build script
โโโ engine.exe // Compiled executable
โโโ LICENSE // MIT license
โโโ README.md // Project documentation
Here is an example of the engine rendering a grid of dots with depth-based ASCII and color shading:
The screenshot above demonstrates the engine's depth-based ASCII and color shading system:
- ASCII Shader: Characters change based on their distance from the camera, providing a sense of depth. For example, closer dots use characters like
#or@, while farther dots use lighter characters like.or:. - Color Shader: Colors are selected based on depth, using ANSI color codes. Closer objects use brighter colors (e.g., red or green), while farther objects use dimmer colors (e.g., blue or cyan).
This dynamic shading system enhances the 3D effect and makes the visuals more engaging.
Below is a showcase of the engine's rendering capabilities:
- Inspired by the Vectrex console and classic wireframe games.
- Developed by Nikita Konkov.
This project is licensed under the MIT License - see the LICENSE file for details.


