Skip to content

Latest commit

ย 

History

377 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฐ Dungeon Co-op โ€” Two-Player Console Adventure Engine

A fully-featured cooperative dungeon crawler built from scratch in C++17 โ€” no game frameworks, no libraries, just raw systems programming.

C++17 ยท 8,000+ Lines ยท 40+ Source Files ยท Cross-Platform ยท macOS / Linux / Windows


Main Menu

Main menu โ€” running in an 80ร—25 terminal window with color mode


Dark Zone & Torch
Fog-of-war with torch illumination
Bomb Explosion
Bomb explosion with LOS blast radius
Pushable Obstacles
Physics-based pushable obstacles
Riddle Popup
Animated riddle popup system

โšก Why This Project Stands Out

This isn't a homework submission โ€” it's an engine. Two players share a keyboard and cooperate in real-time across multi-room dungeons, solving puzzles, dodging explosions, and navigating fog-of-war darkness. Every system โ€” rendering, physics, input, recording โ€” was hand-built.

What I Built Why It Matters
๐Ÿงช Deterministic replay & silent testing framework Record gameplay โ†’ replay with seeded RNG โ†’ verify events automatically. This is, fundamentally, an automated game QA pipeline โ€” the exact problem space Duzz.ai operates in.
๐Ÿ—๏ธ 4-level OOP hierarchy with polymorphic dispatch GameObject โ†’ StaticObject/PickableObject/InteractableObject โ†’ 10+ concrete types. Factory pattern, virtual clone, clean separation of concerns.
๐ŸŒ‘ Fog-of-war visibility engine Dark zones with ray-traced line-of-sight, torch illumination radius, 4-level visibility states (DARK โ†’ EDGE โ†’ INNER โ†’ CLOSE).
๐Ÿงฒ Custom physics system Momentum-based spring launchers, Bresenham line traversal for multi-step movement, force-based pushable obstacles.
๐Ÿ’ฃ Explosion system with LOS calculation Bombs with fuse timers, circular blast radius, wall occlusion via line-of-sight checks, chain destruction of breakable objects.
๐Ÿ–ฅ๏ธ Cross-platform console abstraction Single codebase renders to Windows (conio.h), macOS, and Linux (termios) โ€” clean #ifdef separation, ANSI escape codes, non-blocking I/O.

๐Ÿงช The Testing Framework โ€” Built for QA

This is the system most relevant to Duzz.ai's mission of autonomous game testing.

The game has a built-in record โ†’ replay โ†’ verify pipeline โ€” a miniature version of the automated QA systems that Duzz.ai builds at scale:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  SAVE MODE  โ”‚ โ”€โ”€โ”€โ–ถ โ”‚  LOAD MODE   โ”‚ โ”€โ”€โ”€โ–ถ โ”‚  SILENT MODE   โ”‚
โ”‚ Records all โ”‚      โ”‚ Replays from โ”‚      โ”‚ Headless run,  โ”‚
โ”‚ player I/O  โ”‚      โ”‚ steps file   โ”‚      โ”‚ diffs results  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Deterministic seeded RNG ensures identical riddle assignment across record and replay.
  • Screen file checksums at replay time catch level-file drift between sessions.
  • Event-level verification โ€” screen changes, life losses, riddle outcomes are diffed line-by-line.
  • Factory pattern (Game::createFromArgs()) instantiates NormalGame or LoadedGame from CLI args โ€” zero coupling between play and test modes.
# Record a session
./game -save

# Replay it visually
./game -load

# Run headless verification (CI-friendly)
./game -load -silent
# โ†’ "Test passed" or "Test not passed"

๐Ÿ—๏ธ Architecture

                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”‚  GameObject  โ”‚  โ† abstract base (virtual clone, draw, update)
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ                โ–ผ                โ–ผ
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ”‚ StaticObject โ”‚  โ”‚PickableObjectโ”‚  โ”‚InteractableObj โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚                 โ”‚                  โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”
    โ”‚    โ”‚       โ”‚   โ”‚     โ”‚   โ”‚    โ”‚       โ”‚     โ”‚     โ”‚
  Wall Break- Switch Air  Key Torch Bomb   Door Switch Riddle
        able   Wall          
        Wall

              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   Game   โ”‚  โ† abstract base (Factory pattern)
              โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
           โ–ผ               โ–ผ
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚NormalGame โ”‚  โ”‚ LoadedGame โ”‚  โ† replay/silent testing
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key design patterns: Factory Method ยท Polymorphism ยท Virtual Clone ยท Template Method ยท Composition (Room โ†” GameObject) ยท Singleton-style static instance (Game::currentInstance)


๐ŸŽฎ Game Features

๐Ÿ—๏ธ Cooperative Puzzle Rooms

Both players must work together โ€” collecting keys, activating switches, navigating doors, and solving multiple-choice riddles โ€” to reach the final room. Each room is an 80ร—25 ASCII map loaded from .screen.txt files with metadata.

๐ŸŒ‘ Darkness & Torches

Rooms can define rectangular dark zones. Without a torch, these areas are completely hidden. Picking up a torch creates a real-time illumination radius with graduated visibility.

Dark Zone Demo

๐Ÿ’ฃ Bombs & Explosions

Placeable bombs with a 50-tick fuse and a 5-cell blast radius. Explosions check line-of-sight to avoid blasting through walls, can destroy breakable obstacles, trigger switches, and eliminate keys (causing game-over if critical items are lost). Includes a blinking fuse animation and post-explosion visual effect.

Bomb Explosion Demo

๐Ÿงฒ Springs & Physics

Multi-cell spring objects compressed by player movement. When fully compressed, they launch the player using a momentum system with Bresenham-based multi-step traversal โ€” the player slides across the room until hitting a wall or obstacle.

๐Ÿงฑ Pushable Obstacles

Multi-block obstacles with computed edge detection and weight-based force requirements. Players push them by walking into them โ€” heavier obstacles need more force (or springs).

Obstacle Push Demo

โ“ Riddle Popups

Walking into a ? triggers an animated popup overlay with a multiple-choice question. Correct answers clear the path; wrong answers deduct a life.

Riddle Popup Demo


๐Ÿ•น๏ธ Controls

Both players share one keyboard. Input is case-insensitive. Characters auto-move and will keep going until they hit a wall or press STAY.

Action Player 1 ($) Player 2 (&)
โ†‘ UP W I
โ†“ DOWN X M
โ† LEFT A J
โ†’ RIGHT D L
โ–  STAY S K
โฌ‡ DISPOSE E O

ESC โ†’ Pause ยท H (from pause) โ†’ Main Menu

๐Ÿ“‹ Instructions Screen

Instructions Screen


๐Ÿ› ๏ธ Build & Run

# Clone
git clone https://github.com/Etayde/Cpp_Adv_World_Game_Engine.git
cd cpp_project_2025

# Build (requires g++ with C++17 support)
make

# Play
./game

# Play with color mode
# โ†’ Press [2] in the main menu to toggle color mode

# Record a session for testing
./game -save

# Replay
./game adv-world.steps.txt

# Silent verification (headless, CI-ready)
./game adv-world.steps.txt -silent

Requirements: Any C++17-capable compiler (g++, clang++). No external dependencies.


๐Ÿ—บ๏ธ Level Editor

Create custom rooms by adding adv-worldXX.screen.txt files (auto-discovered via std::filesystem). Each file is an 80ร—25 ASCII map followed by a metadata block:

Symbol Object Behavior
W Wall Indestructible
w Breakable Wall Destroyed by bombs
# Spring Launches players
* Obstacle Pushable block
Z Switch Wall Removed when switches activate
K Key Unlocks doors
! Torch Illuminates dark zones
@ Bomb Pickup โ†’ place โ†’ explode
\ / Switch Toggles obstacles/doors
? Riddle Multiple-choice puzzle
0-9 Door Requires keys/switches to pass
L Legend Anchor HUD placement marker
---METADATA---
SPAWN 3 10                     # Player spawn point
SPAWN_PREV 75 17               # Spawn when returning from next room
NEXT_ROOM 1                    # Next room ID (-1 = final room)
PREV_ROOM -1                   # Previous room ID (-1 = first room)
DOOR 1 2 0                     # Door 1 needs 2 keys, 0 switches
DARK_ZONE 20 5 46 14           # Dark rectangle (top-left โ†’ bottom-right)

๐Ÿ“‚ Project Structure

.
โ”œโ”€โ”€ main.cpp                    # Entry point
โ”œโ”€โ”€ Game.h/cpp                  # Abstract base โ€” state machine, room management
โ”œโ”€โ”€ NormalGame.h/cpp            # Live gameplay + recording mode
โ”œโ”€โ”€ LoadedGame.h/cpp            # Replay + silent verification mode
โ”œโ”€โ”€ Player.h/cpp                # Movement, physics, inventory, collisions
โ”œโ”€โ”€ Room.h/cpp                  # Room state, visibility, object management
โ”œโ”€โ”€ GameObject.h/cpp            # Abstract game object base class
โ”œโ”€โ”€ Bomb.h/cpp                  # Explosive with fuse timer + LOS blast
โ”œโ”€โ”€ Spring.h/cpp                # Compressible launcher with momentum
โ”œโ”€โ”€ Obstacle.h/cpp              # Multi-block pushable physics objects
โ”œโ”€โ”€ Riddle.h/cpp                # Animated popup quiz system
โ”œโ”€โ”€ Recorder.h/cpp              # Action serialization / deserialization
โ”œโ”€โ”€ LevelLoader.h/cpp           # Map parser + std::filesystem discovery
โ”œโ”€โ”€ Console.h                   # Cross-platform terminal abstraction
โ”œโ”€โ”€ Renderer.h                  # Silent-mode-aware rendering proxy
โ”œโ”€โ”€ Momentum.h/cpp              # Velocity / launch frame tracking
โ”œโ”€โ”€ Makefile                    # Build configuration
โ”œโ”€โ”€ riddle.txt                  # Riddle question database
โ””โ”€โ”€ adv-world*.screen.txt       # Level files (3 included)

๐Ÿ‘ค Author

Etay De Beer , LinkedIn: www.linkedin.com/in/etaydebeer

Built as a C++ collage course project โ€” evolved into a full game engine with QA automation, physics, fog-of-war, and extensible level design.


Built with โค๏ธ, raw C++, and zero game frameworks.

About

A cross-platform C++17 console game engine with zero dependencies, featuring 2-player co-op, custom physics, LOS explosions, and a built-in automated QA testing pipeline.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages