Skip to content

N1borg/Zappy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zappy

Build and Test server Build and Test GUI Build and Test AI

Welcome to Zappy, the 2nd end-year Epitech project! Zappy is a networked game featuring a server coded in C, a GUI client in C++, and AI clients written in Python. This project showcases a comprehensive blend of network programming, game development, and artificial intelligence.

Click here for the technical subjects.

Table of Contents

Overview

Zappy is a multiplayer game where players compete in a virtual world. The project is divided into three main components:

  1. Server (C): Handles game logic, player interactions, and networking.
  2. GUI (C++): Provides a graphical interface for players to interact with the game.
  3. AI Clients (Python): Autonomous agents that play the game.

Example of GUI game

Features

  • Multiplayer Support: Host games with multiple players.
  • Real-time Communication: Fast and efficient networking for seamless gameplay.
  • Graphical Interface: Intuitive and interactive GUI for players.
  • AI Integration: Intelligent AI clients to play against or with human players.
  • Cross-platform: Runs on various operating systems.

Installation

Prerequisites

  • C Compiler: gcc or any compatible C compiler.
  • C++ Compiler: g++ or any compatible C++ compiler.
  • Python: Version 3.x.
  • CMake: For building the project.
  • Make: Build automation tool.
  • Raylib: Required for the GUI.

Installing raylib on Fedora

To install raylib on Fedora, follow these steps:

  1. Install the required libraries:

    sudo dnf install alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel libatomic
  2. Install the raylib development package:

    sudo dnf install raylib-devel
  3. (Optional) To install only the runtime library:

    sudo dnf install raylib

Clone the Repository

git clone https://github.com/EpitechPromo2027/Zappy.git Zappy
cd Zappy

Build all

make

Build the Server only

make zappy_server

option description -p port port number -x width width of the world -y height height of the world -n name1 name2 . . . name of the team -c clientsNb number of authorized clients per team -f freq reciprocal of time unit for execution of actions

Build the GUI only

make zappy_gui

Build the AI Client only

make zappy_ai

Usage

Starting the Server

To start the server, run the following command:

./zappy_server -p [port] -x [width] -y [height] -n [name1] [name2] [...] -c [clientsNb] -f [freq]
Option Description
-p [port] port number
-x [width] width of the world
-y [height] height of the world
-n [name1] [name2] [...] name of the team
-c [clientsNb] number of authorized clients per team
-f [freq] reciprocal of time unit for execution of actions

Connecting the GUI

To connect the GUI to the server, run the following command:

./zappy_gui -p [port] -h [machine]
Option Description
-p [port] port number
-h [machine] name of the machine

Running the AI

To start an AI client, run the following command:

./zappy_ai -p [port] -n [name] -h [machine]
Option Description
-p [port] port number
-n [name] name of the team
-h [machine] name of the machine; localhost by default

Architecture

Server

The server is the core of Zappy. It manages:

  • Player connections and interactions
  • Game state and logic
  • Communication with the GUI and AI clients

GUI

The GUI provides a visual representation of the game. It is built using C++ and Raylib, offering:

  • Real-time game visualization
  • Player controls and interactions
  • Network communication with the server

AI Clients

The AI clients are autonomous agents written in Python. They connect to the server and perform actions based on the game state. The AI logic can be customized and extended for different strategies.

Thank you for checking out Zappy! We hope you enjoy playing and developing it as much as we did creating it.

About

A network multiplayer game with AI

Topics

Resources

Stars

Watchers

Forks

Contributors 7