Wizard Duel supports real-time multiplayer battles between two players using the ENet networking library. One player hosts the game while another joins, and position data is synchronized in real-time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/korrykatti/game/llms.txt
Use this file to discover all available pages before exploring further.
Features
- 1v1 battles: Supports two players in direct combat
- Real-time synchronization: Player positions are transmitted and updated every frame
- Low-latency networking: Built on ENet for reliable UDP networking
- Ping display: Shows round-trip time to monitor connection quality
Network configuration
The game uses the following network settings:main.cpp
By default, the server runs on localhost (127.0.0.1) on port 7777. For LAN play, the host should replace
SERVER_IP with their local network IP address.Connection states
The game tracks connection status using four states:- DISCONNECTED: No active connection, initial state
- HOSTING: Server is running and waiting for a client to join
- JOINING: Client is attempting to connect to a server
- CONNECTED: Connection established, game is active
main.cpp
Position synchronization
Player positions are synchronized using thePositionPacket structure:
main.cpp
main.cpp
ENet initialization
Before any networking can occur, ENet must be initialized:main.cpp
Network cleanup
When the game exits, network resources are properly released:main.cpp
Ping monitoring
The game displays real-time ping to help players monitor connection quality:main.cpp