Skip to content

Matribuk/Personal-tekoskart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TekosKart 🏎️

A Mario Kart-like racing game server written in C.

License:  MIT

📋 Overview

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.

🏛️ Schema Preview

TekosKart Gameplay

✨ Features

  • 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

🏗️ Project Structure

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

🚀 Getting Started

Prerequisites

  • GCC compiler
  • Make
  • Math library (libm)

Building

Build the server:

make

This will compile the server executable in the root directory.

Configuration

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

Running the Server

./server

The server will:

  1. Load configuration from server.cfg
  2. Parse the map file specified in the configuration
  3. Generate interpolated track points using Bézier curves
  4. Start listening for client connections

🗺️ Map Format

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

🛠️ Build Commands

make          # Build the server
make clean    # Remove object files
make fclean   # Remove all build artifacts
make re       # Rebuild from scratch

📝 Technical Details

Track Generation

The 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.

Platform Support

The Makefile includes platform-specific configurations:

  • macOS: Disables certain warnings (int-conversion, deprecated-declarations)
  • Linux/Other: Standard warning flags

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🎓 About

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.

About

Mario kart like

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published