Skip to content

kingkururu/quoridor_3D_2P

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

2 Player 3D Quoridor Simulation

A simulated 3D implementation of the classic strategic board game Quoridor, built with C++ and SFML. Features multiplayer networking capabilities. Players race to reach the opposite side of the board while placing walls to block their opponent.

Image Image Image

Features

  • Real-time Networking: Berkeley sockets implementation for seamless multiplayer experience
  • 2.5D Graphics: 3D-like board visualization with SFML-powered rendering using raycasting
  • Interactive UI: Intuitive controls for piece movement and wall placement

Game Rules

Quoridor is a strategic race game where:

  • Objective: Be the first player to reach the opposite side of the 9x9 board
  • Movement: Move your pawn one square per turn (orthogonally)
  • Wall Placement: Alternatively, place a wall to block your opponent's path
  • Wall Restrictions: Each player has 10 walls; walls cannot completely block a path to the goal
  • Victory Condition: First player to reach any square on the opposite side wins

Controls

  • Click: Place walls (horizontal/vertical)
  • W: Move forward
  • S: Move backward
  • A: Rotate camera left / turn player left
  • D: Rotate camera right / turn player right

Networking Features

The game implements Berkeley sockets (BSD sockets/POSIX sockets) for multiplayer functionality:

  • Cross-Platform Compatibility: Native socket API support on Unix-like systems
  • Real-time Communication: Low-latency game state synchronization
  • Connection Management: Automatic handling of client-server connections
  • Game State Sync: Seamless board updates across networked players
  • Error Handling: Robust network error detection and recovery

Project Structure

/quoridor_3D_2P
│
├── 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/            # SFML 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/               # Sprites 
│
├── network/                   # Networking system
│   └── network/               # network files
│
├── libs/                      # External libraries
│   └── logging/               # Logging system
│
├── Makefile                   # Build instructions
└── README.md                  # Project documentation

Building & Running

Prerequisites

  • Compiler: Requires clang++ (or g++) with C++17 support
  • SFML: Simple and Fast Multimedia Library for graphics and windowing
  • Network Support: POSIX-compliant system for Berkeley sockets
  • Custom Game Framework: Built on top of the SFML Game Framework

Installation

  1. Clone the Repository:

    git clone https://github.com/kingkururu/quoridor_3D_2P
    cd quoridor_3D_2P
  2. Build and Run the Game:

    make test
  3. 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

  • Game Logic Implementation: Complex rule validation and game state management
  • Network Programming: Berkeley sockets implementation for real-time multiplayer
  • 2.5D Graphics Programming: Raycasting techniques for 2.5D visualization
  • Event-Driven Architecture: Responsive UI and game state management

Assets Credits

  • Music: Game Background from Pixabay
  • Graphics: Custom artwork created using Canva
  • Backgrounds: Original board textures and visual designs using Canva
  • Framework: Built using the Custom SFML Game Framework

Tools Used

Game Strategy Tips

  • Early Game: Focus on advancing your pawn while conserving walls
  • Mid Game: Use walls strategically to create longer paths for your opponent
  • Late Game: Balance between advancing and defensive wall placement
  • Wall Efficiency: Place walls to maximize your opponent's path length
  • Path Awareness: Always ensure you maintain a clear route to your goal

About

3D quaridor simulation game built with SFML and C++ in custom game template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •