Skip to content

WioN780/abalone-dp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abalone Multiplayer (Distributed Processing Project)

🎮 Game Description

Abalone is a 2-player turn-based strategy board game played on a hexagonal board. Each player controls a set of marbles and the objective is to push six of the opponent's marbles off the board.

Players take turns moving 1–3 of their own marbles in a straight line or side-step, provided the move follows game rules. If a player has more marbles in line than the opponent (e.g. 2 vs. 1), they can push the opponent’s pieces backward — potentially off the board.

This project recreates Abalone as a console-based multiplayer game. It uses TCP sockets to allow two players to connect to a shared game server. The server handles game state and enforces the rules, while each client manages input/output.


👨‍💻 How to Build

Requirements

  • C++ compiler (Visual Studio or g++)
  • Windows

Building with Visual Studio (Windows)

  1. Open the abalone-dp.sln file in Visual Studio.
  2. Set the build mode to Release or Debug.
  3. Build the Server, Client, and Engine projects.

▶️ How to Run

Step 1: Start Server

./server

Wait for clients to connect.

Step 2: Start Clients (two separate terminals)

./client

Each player connects and takes turns.


🎯 Game Overview

Abalone is a 2-player strategy game where the goal is to push your opponent’s marbles off the board.

Basic rules implemented:

  • Players alternate turns.
  • You can select 1–3 adjacent marbles to move.
  • Moves are validated server-side.
  • Game ends when a player loses 6 marbles.

📁 Project Structure

/Client         → Client logic, UI, socket code
/Server         → Server-side logic, handles connections & game state
/Engine         → Core game logic (Abalone rules)
design.txt      → Dev notes and plans
README.md       → This file

abalone-dp/
├── Client/                        # Client application (UI, input, networking)
│   ├── src/
│   │   ├── main.cpp              # Entry point for client
│   │   ├── UI.cpp / UI.h         # UI rendering and menu logic
│   │   ├── networkClient.cpp/h   # Client-side networking (connect/send/receive)
│   │   ├── uiUtils.cpp / .h      # UI utility helpers (console output, cursor control)
│   └── Client.vcxproj            # Visual Studio project file
│
├── Server/                        # Server application (game state management, networking)
│   ├── src/
│   │   ├── main.cpp              # Entry point for server
│   └── Server.vcxproj
│
├── Engine/                        # Core game logic (Abalone rules, game state)
│   ├── src/
│   │   ├── game.cpp / game.h            # Core game rules and state transitions
│   │   ├── networkObjects.cpp / .h      # Common data objects used in networking
│   │   ├── networkProtocol.cpp / .h     # Game protocol (message types, serialization)
│   │   ├── networkServer.cpp  /.h       # Server logic
│   │   ├── utils.cpp / utils.h          # Utility functions (validation, math, etc.)
│   └── Engine.vcxproj
│
├── design.txt                     # Developer notes, planning
├── abalone-dp.sln                 # Visual Studio solution file
└── README.md                      # Project overview (this file)

🔁 Concurrent Programming Techniques

The following concurrency techniques were used in the project:

  • std::thread: Used in the server to handle multiple client connections simultaneously.
  • mutex (from <mutex>): Used to safely access shared game state between threads.
  • Basic thread lifecycle management: Ensuring clean exit, join, and client disconnect handling.

📚 External Libraries & Frameworks

  • Standard C++ libraries:
    • <thread> for multithreading
    • <mutex> <winsock> <conio>
    • <iostream>, <vector>, <string> for I/O and data management

No external or third-party frameworks were used; the entire project relies on native C++ and system sockets.


👥 Authors

  • Mark Slipenkyi — engine logic, socket handling, core game flow
  • Fatkhullakh Turakhonov — network setup, UI feedback, documentation

photo_2025-06-03_08-24-18


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages