A Mario Kart-like racing game server written in C.
TekosKart is a racing game server that simulates Mario Kart-style gameplay. The server handles race track generation using Bézier curves, supports multiple game modes, and manages player connections for multiplayer racing experiences.
- 3D Track Generation: Uses Bézier curve interpolation to create smooth racing tracks from control points
- Multiple Game Modes:
- Grand Prix (mode 0)
- Versus (mode 1)
- Arcade (mode 2)
- Multiplayer Support: Configurable max connections and racer limits
- Password Protection: Secure server access
- Custom Maps: Load custom track layouts from configuration files
- Configurable Resolution: Adjustable track smoothness via resolution settings
tekoskart/
├── lib/
│ ├── client/ # Client-side code
│ └── server/ # Server-side code
│ ├── src/
│ │ ├── main.c # Server entry point
│ │ ├── game/ # Game logic
│ │ └── misc/ # Utility functions
│ ├── include/ # Header files
│ └── Makefile # Server build configuration
├── map.txt # Default race track definition
├── server.cfg # Server configuration file
├── Makefile # Root build configuration
└── LICENSE # MIT License
- GCC compiler
- Make
- Math library (libm)
Build the server:
makeThis will compile the server executable in the root directory.
Edit server.cfg to customize server settings:
# Port number on which the server will listen
port = 42042
# Password required to join the server
password = Epitech_stronger_than_42
# Maximum number of connections allowed
max_connection = 16
# Number of racers in the race
racers = 12
# Gamemode settings
# 0 = grandprix, 1 = versus, 2 = arcade
mode = 0
# Map name
map = map. txt
# Resolution between each point from Map file
resolution = 50./serverThe server will:
- Load configuration from
server.cfg - Parse the map file specified in the configuration
- Generate interpolated track points using Bézier curves
- Start listening for client connections
Maps are defined in text files with the following format:
x, y, z | tangent_x, tangent_y, tangent_z | angle_x, angle_y, angle_z
Each line represents a control point with:
- Position: x, y, z coordinates
- Tangent: Direction vector for Bézier curve interpolation
- Angles: Rotation angles in degrees
Example:
13, 1, 15 | 0, 0, -10 | 0, 90, 0
18, 4, 10 | 10, 0, 0 | 0, 90, 0
24, 4, 15 | 0, 0, 10 | 0, 90, 0
make # Build the server
make clean # Remove object files
make fclean # Remove all build artifacts
make re # Rebuild from scratchThe server uses Bézier curve interpolation to create smooth racing tracks. Control points from the map file are used to generate intermediate points based on the configured resolution, creating a fluid racing experience.
The Makefile includes platform-specific configurations:
- macOS: Disables certain warnings (int-conversion, deprecated-declarations)
- Linux/Other: Standard warning flags
This project is licensed under the MIT License - see the LICENSE file for details.
Created as a first personal project in 2024, inspired by the Mario Kart racing game series.
Note: This is a server-side implementation. A client application is required to connect and play the game.