Project Horizon is a Unity-based multiplayer aerial combat game where players pilot jets to engage in thrilling dogfights over an infinite, procedurally generated terrain. The game combines the traditional Unity GameObject structure for map generation with ECS (Entity Component System) + DOTS (Data-Oriented Technology Stack) for optimized player input and multiplayer networking.
- Infinite Terrain Generation: Procedurally generated environments using GameObject-based systems inspired by traditional Unity workflows.
- ECS + DOTS Optimization: Smooth and efficient player movement and networking powered by Unity's ECS and DOTS.
- Multiplayer Gameplay: Host public or private games, or join a dedicated server for an engaging multiplayer experience.
- Single-Player Mode: Explore the terrain and practice your piloting skills in a private game.
- Main Project Repository: Project Horizon (This Repository)
- Build Repository for Testing: Project Horizon Builds
This project was inspired and built upon ideas from the following creators:
- Map Generation: Check out Sebastian Lague's excellent tutorials on Procedural Map Generation.
- ECS Player Input: Learn ECS fundamentals and player input integration from Turbo Makes Games’ ECS Tutorials.
To build and run Project Horizon, follow these steps:
- Unity Version: Unity 6000.0.28f1 or newer (URP-compatible).
- Development Environment: Git, Visual Studio, and Unity Hub.
- Clone the Repository:
git clone https://github.com/jbledua/Project-Horizon.git
- Open the Project in Unity:
- Launch Unity Hub.
- Click
Add
and select theProject-Horizon
folder.
- Set Build Target:
- Go to
File > Build Profiles
. - Select your platform
- Client Build (Windows, macOS, Linux)
- Server Builds (Windows Server, macOS Server, Linux Server)
- Click
Switch Platform
.
- Go to
- Build the Game:
- Click
Build
.- For client builds you will have options to: - Create a Private game. - Join Muliplayer games where you specify Host IP Address and Port Number - Host muliplayer games where you specify the listening Port Number for others to join
- For server builds: - It will automatically host on Port 7979 but will not create the client interface
- Click
- Run the Game:
- Hosting Options:
- Launch the client build and host a game directly from your instance. This option includes a client interface for gameplay while acting as the host.
- Alternatively, start the server build to run a dedicated hosting instance. Share the server's public IP address (or Tailscale/VPN address) and port with players.
- For advanced hosting, follow the Optional AWS EC2 Deployment steps to run the server in a cloud environment.
- Joining a Game:
- Use the client build to connect to a hosted game by entering the host's IP address and port.
- If hosting locally, you can connect to the server instance on the same machine or network by using
localhost
or the local IP address.
- Hosting Options:
-
Launch an EC2 Instance:
- Choose an Ubuntu or Windows Server AMI based on your platform needs.
- Select an instance type suitable for hosting (e.g.,
t2.medium
or higher is recommended). - Configure security group settings (see step 4).
-
Upload the Server Build:
- Use an SCP client (e.g.,
scp
or FileZilla) to transfer the server build to your EC2 instance. - Or you can clone the Build Repo to your EC2 instance.
- Use an SCP client (e.g.,
-
Run the Server:
- SSH into your instance and navigate to the uploaded server directory.
- Ensure the server binary has executable permissions. If not, make it executable by running:
chmod +x ProjectHorizonServer.x86_64
- Execute the server binary:
./ProjectHorizonServer.x86_64
-
Open a Port for Multiplayer:
- In the AWS Management Console, go to the Security Groups section.
- Edit the Inbound Rules to allow traffic on Port 7979 (or your specified port):
- Protocol: TCP
- Port Range: 7979
- Source: 0.0.0.0/0 (for public access) or your specific IP range.
-
Connect to the Server:
- Share your EC2 instance's public IP address with players.
- Players can join by entering the IP address and port in the game client.
- Make sure to terminate the EC2 instance or pause hosting when not in use to avoid unnecessary charges.
- Adjust the security group rules carefully to ensure your server is secure while accessible.
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to the Unity community and the creators of ECS and map generation tutorials for their incredible resources and inspiration.