WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

kingkururu/maze_3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

3D Maze Game

A 3D maze game built with C++ and SFML, featuring pathfinding algorithms and automated navigation systems. This is built on the raycasting algorithm from the previous project.

Image Image Image

Features

  • Procedural Maze Generation: Random maze creation using Depth-First Search and Prim's algorithms
  • 3D Raycasting Rendering: Immersive 3D perspective from 2D maze data
  • Auto-Navigation: Computer-guided movement with "Navigate Maze" functionality via A* algorithm
  • Real-time Path Visualization: Visual representation of calculated paths
  • Performance Optimized: Efficient maze generation and pathfinding algorithms
  • File I/O Integration: Save and load maze configurations

Controls

  • W: Move forward
  • S: Move backward
  • A: Rotate camera left / turn player left
  • D: Rotate camera right / turn player right

Project Structure

/maze_3D
│
├── src/                      # Source files
│   ├── main.cpp              # Main entry point of the game
│   └── game/                 # Core engine functionalities
│       ├── globals/          # Constants and flags
│       ├── core/             # Game loop and state management
│       ├── physics/          # Physics and collision detection
│       ├── camera/           # Window and view management
│       ├── utils/            # Utility functions
│       └── scenes/           # Scene management
│
├── assets/                   # Game assets
│   ├── fonts/                # Text files and sources
│   ├── sound/                # Sound effects
│   ├── tiles/                # Tiles and tilemaps
│   └── sprites/              # Sprite images
│
├── libs/                      # External libraries
│   └── logging/               # Logging system
│
├── Makefile                   # Build instructions
└── README.md                  # Project documentation

Prerequisites

  • Compiler: Requires clang++ (or g++) with C++17 support
  • SFML: Simple and Fast Multimedia Library for graphics
  • Custom Game Framework: Built on top of the SFML Game Framework

Building & Running

Installation

  1. Clone the Repository:

    git clone https://github.com/kingkururu/maze_3D
    cd maze_3D (location will be different)
  2. Build the Project:

    make test
  3. How to Clean the Build:

    make clean

Alternative Setup (macOS with Homebrew)

  1. Install SFML:

    # Install Homebrew if not already installed
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    # Install SFML
    brew install sfml@2
    brew install .... (other missing libraries)
  2. Configure PATH (add to ~/.zshrc or ~/.bash_profile):

    export PATH="/opt/homebrew/bin:$PATH"
    export PATH="/opt/homebrew/opt/sfml@2/bin:$PATH"
    export PATH="path to other libraries if any of them is missing)

Key Learning Outcomes

  • Algorithm Implementation: Understanding maze generation and pathfinding algorithms
  • Graph Theory Applications: Practical application of DFS, Prim's, and A* algorithms
  • Performance Optimization: Efficient algorithms for real-time maze generation and pathfinding
  • Data Structures: Advanced use of graphs, priority queues, and spatial data structures
  • File I/O Operations: C++ file handling for maze persistence and configuration
  • Game AI Development: Creating intelligent navigation systems for enhanced gameplay

Maze Generation Process

The game implements a sophisticated maze generation system that:

  1. Algorithm Selection: Choose between DFS and Prim's algorithms for different maze characteristics
  2. Procedural Generation: Create unique maze layouts using selected algorithms
  3. Path Optimization: Calculate optimal routes using A* pathfinding
  4. File Operations: Save generated mazes and load configurations
  5. Visual Rendering: Display maze in 3D using raycasting techniques

Assets Credits

Tools Used

About

3D Maze simulation game made with SFML and C++ in custom game template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published