Warning
Horizon is still in early development and is not meant to be used in any production environments.
Note
Our installation methods have recently changed, please review them if you are experiencing difficulty with the installation process
- π 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 offers two distinct architectural models for game server synchronization:
In the Community Edition, Horizon utilizes a peer-to-peer model for synchronizing multiple game server instances. This approach allows for efficient communication and coordination between servers without the need for a central authority.
- Each Horizon server instance operates as an equal peer in the network.
- Servers communicate directly with each other to share game state updates, player actions, and other relevant information.
- The peer-to-peer model enables horizontal scalability, allowing new server instances to be added seamlessly to the network.
- Decentralized architecture, reducing single points of failure.
- Lower operational complexity, ideal for smaller deployments or community-driven projects.
- Efficient resource utilization across all participating servers.
For larger-scale deployments and enterprise use cases, Horizon offers an advanced Parent-Child-Master architecture. This model provides enhanced control, scalability, and management capabilities.
- Master Node: Oversees the entire network, managing global state and coordination.
- Parent Nodes: Act as regional coordinators, managing a subset of Child nodes.
- Child Nodes: Handle individual game instances or regions, reporting to their Parent node.
This hierarchical structure allows for more sophisticated load balancing, fault tolerance, and centralized management as well as limitless scalability.
Server image was created by Freepik
- Highly scalable architecture suitable for massive multiplayer environments.
- Advanced load balancing and resource allocation capabilities.
- Centralized monitoring and management through the Master node.
- Enhanced fault tolerance and redundancy options.
- The Peer-to-Peer model (Community Edition) is ideal for smaller projects, community servers, or deployments that prioritize simplicity and decentralization.
- The Parent-Child-Master architecture (Enterprise Edition) is designed for large-scale commercial games, MMOs, or any project requiring advanced management and scalability features.
Both architectures leverage Horizon's core strengths in real-time synchronization and efficient data propagation, ensuring a consistent and responsive gaming experience regardless of the chosen model.
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/Far-Beyond-Dev/Horizon-Community-Edition.git
-
Navigate to the project directory:
cd Horizon-Community-Edition/
-
Enter WSL or open the project in a VSCode Devcontainer
wsl
-
Run the following command to install the dependencies, this script only works with Ubuntu, Arch & Alpine Linux
./installer-linux.sh
-
Use cargo to compile and run Horizon
cargo run
-
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.