LyraGameStarter
LyraGameStarter is a sample project from Epic Games that we've adapted as a complex demo to showcase inter-server communication and player migration in a clustered environment.
Key Features:
- Replication
- Enable inter-server RPC for the AbilitySystemComponent.
- Support for static actors like
LyraWeaponSpawner
. - Use a synchronization actor (
AGameStateSync
) to maintain consistent Game State across servers. - Modify both blueprint and C++ implementations to support clustering.
- Player Migration
- Migrate
FFastTArray
properties. - Save/Restore not-replicated property for migration. For example, how to migrate UCharacterMovementComponent data.
- Migrate
Building the Project
Before trying this example, ensure you follow the Installation guide to compile Unreal Engine.
- Clone the project from (LyraStarterGame)[https://github.com/git-clustech/LyraStarterGame]. Ensure that the submodules are also downloaded.
- Unzip the file
Content/Effects/Textures/Flipbooks/SmokeSwirl_3_Flipbook_CHANNELPACK.uasset.7z.*
. - Compile the project.
Topology
The demo utilizes the following server setup:
- 1 Level Server (required for managing the level)
- 1 NPC Server to host static actors
- 1 Visibility Server
- 2 Load Servers (for handling players)
Features
This demo illustrates how to get the Gameplay Ability System (GAS) working across multiple servers. It is still a work in progress (WIP), so please refer to the project issues for more details.
Setup
Before launching the servers, you'll need to configure the account settings and server configuration files.
Configure Account Settings
Follow the Configure NetCluster section to set up your account information.
Configure Servers
You can take most of the configuration from NetClusterStarter. For the NPC server configuration, use the following settings:
{
"ServerUID": "Luna-npc",
"LevelServerUID": "Luna-LevelServer",
"DomainID": "LyraNetClusterTest1",
"ServerFlags": "HostStaticActors",
"RegionID": 6
}
You can launch the servers using the run_editor_server.bat included in the project. Be sure to update UNREAL_ENGINE_PATH
and CONFIG_FILES_PATH
before using this script.
After launching the client, navigate to the menu and select Play Lyra -> Join Server
to log in.