Caution
Horizon is still in early development and is not meant to be used in any production environments.
- π Table Of Contents
- π Introduction
- π§ Installation
- βοΈ Configuration
- π Usage
- π» Development
- π Additional Resources
- π Troubleshooting
- π Stargazers
Horizon is a custom game server software designed to facilitate seamless interaction between Unreal Engine 5 (UE5) and client applications through socket.io. It provides a scalable and customizable solution for hosting multiplayer games and managing real-time communication between players and a limitless number of game servers or "Hosts".
Horizon utilizes a sophisticated Parent-Child socket synchronization mechanism to ensure seamless coordination between multiple Horizon instances, effectively creating a unified game server environment with minimal latency. This innovative approach enhances the overall performance and reliability of multiplayer gaming experiences by providing efficient and reliable synchronization across distributed server instances.
In the Horizon architecture, one instance acts as the Parent node, while others serve as Child nodes. The Parent node orchestrates and synchronizes actions across all Child nodes, ensuring that all game-related events and states are consistently and accurately propagated throughout the network of servers.
Horizon employs socket.io for real-time communication between Parent and Child nodes. This allows for near-instantaneous data transmission, crucial for maintaining synchronization in fast-paced multiplayer games. Socket.io provides a robust and flexible framework for handling bi-directional event-based communication, enabling the seamless exchange of data between servers.
The Parent node continuously sends updates to Child nodes regarding game state, player actions, and other relevant information. Conversely, Child nodes report back to the Parent node, ensuring bidirectional communication for accurate synchronization. This protocol ensures that all nodes are kept up-to-date with the latest game events, reducing the likelihood of discrepancies or inconsistencies in the game state.
To achieve near-zero latency, Horizon optimizes data transmission by minimizing overhead and prioritizing critical updates. This ensures that actions performed on one Child node propagate swiftly to all others, maintaining a cohesive game experience for all players. Techniques such as data compression, efficient serialization, and prioritization of critical packets are employed to reduce latency and enhance performance.
The system dynamically adjusts the load across Child nodes based on current server performance and player distribution. This load balancing mechanism helps prevent any single node from becoming a bottleneck, thereby enhancing the overall scalability and reliability of the server network.
Each event generated within the game is timestamped and ordered to ensure consistency. The Parent node manages a global event timeline, allowing all Child nodes to process events in the correct sequence, maintaining a consistent game state across the entire network.
The Parent-Child architecture allows Horizon to scale effortlessly, accommodating a growing player base without sacrificing performance. New Child nodes can be added to the network to handle increased load, and the Parent node can manage these additions seamlessly.
In the event of node failure, the Parent node seamlessly redistributes responsibilities to remaining Child nodes, ensuring uninterrupted gameplay for players. This fault tolerance mechanism enhances the reliability and availability of the game server network, reducing the impact of hardware or software failures on the gaming experience.
By synchronizing game state across all instances, Horizon guarantees a consistent experience for all players, regardless of their geographical location or server proximity. This consistency is crucial for maintaining fair and balanced gameplay, as all players interact with the same game state and events.
The low-latency and high-consistency nature of the Parent-Child synchronization model significantly enhances the user experience. Players benefit from faster response times, smoother gameplay, and reduced instances of lag or desynchronization.
The centralized coordination provided by the Parent node simplifies the management of the game server network. Administrators can monitor and control the entire network from a single point, making it easier to deploy updates, manage resources, and troubleshoot issues.
Administrators can customize synchronization parameters, such as update frequency and data prioritization, to optimize performance based on specific game requirements. This flexibility allows Horizon to be tailored to a wide range of game types and player behaviors.
Administrators can fine-tune synchronization parameters via the server-config.json
file, adjusting settings such as synchronization frequency and data prioritization to suit specific requirements.
Horizon provides built-in monitoring tools to track synchronization performance, allowing administrators to identify and address any potential bottlenecks or issues promptly.
Horizon implements a robust event propagation mechanism to facilitate communication between servers based on spatial proximity and event origin.
Events are multicast from the Parent node to Child nodes based on their geographical proximity and relevance to the event origin. This ensures that only necessary servers receive and process the events, optimizing network bandwidth and computational resources.
Each event carries a propagation distance parameter, allowing servers to determine whether they should propagate the event further or handle it locally based on their position relative to the event origin.
Horizon uses a 64-bit floating-point coordinate system to manage server positions within a simulated universe. Each server instance covers a cubic light year, and coordinates are stored relativistically to avoid overflow issues.
Servers are organized into a grid-based region map, where each region corresponds to a specific set of spatial coordinates. This mapping enables efficient routing of events between servers, as servers can quickly determine which neighboring servers should receive specific events based on their region coordinates.
Before installing Horizon, ensure that you have the following prerequisites:
- Docker installed on your system.
- Git for cloning the Horizon repository.
- Basic understanding of Docker and containerized applications.
-
Clone the Horizon repository from GitHub:
git clone https://github.com/AstroVerse-Studios/Horizon.git
-
Navigate to the project directory:
cd Horizon
-
Build and deploy the horizon service via docker-compose:
docker-compose up --build
-
Follow the prompts to configure any necessary settings in the
server-config.json
file.
For more detailed instructions and troubleshooting tips, refer to the Installation Guide.
Horizon's configuration revolves around Docker and environment variables. Here's an overview of key configuration files:
compose.yaml
: Defines the Docker services, networks, and volumes for running Horizon.Dockerfile
: Specifies the environment and dependencies for the Horizon server container.start.sh
: Contains startup commands for launching the server.server-config.json
: Contains Horizon server configurations.
To customize Horizon for your specific needs, modify these files according to your requirements. Refer to the Configuration Guide for detailed instructions and best practices.
To start the Horizon server, execute the following command (This assumes you have already Built the Horizon server):
./start.sh
This script initializes the Docker containers and launches the server. Once started, you can connect to the server using socket.io clients or integrate it with your Unreal Engine 5 project.
You can manage your server directly via docker-compose:
- Use
docker-compose
commands to manage the server lifecycle (e.g.,docker-compose up
,docker-compose down
). - Monitor server logs for debugging and performance analysis.
For more usage instructions and advanced features, see the Usage Guide.
Contributors help shape the future of Horizon Server. To start contributing you have to fork this repository and open a pull request.
The Horizon project directory consists of several key components:
src/
: Contains source code for the Horizon server.horizon-physics-engine/
: Additional modules or plugins for extended functionality.BuntDB/
: Database-related files and configurations.- Other configuration files and scripts for Docker and environment setup.
- Follow the project's coding standards and conventions.
- Submit pull requests for proposed changes or enhancements.
- Collaborate with the community on GitHub issues and discussions.
For detailed development instructions and guidelines, refer to the Development Guide.
- Join our Discord server or community forums for support and collaboration.
- Follow us on social media for updates and announcements.
- Explore the official Horizon documentation for in-depth guides and tutorials.
- Check out our GitHub repository for code samples and examples.
For more resources and helpful links, visit the Additional Resources section.
- Connection Errors: Ensure that the server is running and accessible from client applications.
- Dependency Problems: Check Docker logs for any issues during container initialization.
- Performance Bottlenecks: Monitor server performance and optimize resource usage if necessary.
For troubleshooting tips and solutions to common problems, consult the Troubleshooting Guide.