Server-Client Multiplayer based game in C
Project Details
- Project Type: Programmation in C
- Tools: C, Debian, git
- Duration: 1 week
- Team: Duo project with Antoine Banchet
- Code: Github noebackert/ProjetPSE
- Report: Download report
Introduction
The goal of this project was to understand the basis of sockets, fork and threads in C programming.
The project aims to design, simulate, and test a simple console game to work with threads and sockets.
Project Overview
The project involves:
- Understanding the concept of forks and threads
- Understanding sockets and multiplayer management
- Designing a Server-Client application
- Using the GCC flags
-ansi -pedantic -Wallto write standard-compliant code
General Description of the Project
Multiplayer Client/Server Typing Speed Game
- The player who types the most words correctly wins
- Originality:
- Ability to start the game with a variable number of users (from 1 to
NB_CLIENT_MAXplayers, as long as everyone is ready) - Time management handled in a separate thread
- Score and ranking management with a variable number of clients
- Ability to start the game with a variable number of users (from 1 to
Code Structure
To maintain clarity in digital system design projects, it is essential to separate source code from test benches and compiled files:
Figure 3: Project directory structure
- appli: contains
client.c,serveur.c, andliste_francais.txt(word list) - include: contains the headers of the modules
- modules: contains the PSE modules used plus
words.c - lib: contains
libpse.a, the static library of the PSE modules
Server
The server is the central element of the game. It manages the game, the players, and the game statistics.

Figure 2: Server Flowchart
Client
The client is the player. It connects to the server and plays the game.

Figure 3: Client Flowchart