Ghost Replay Plugin logo Ghost Replay Plugin

This tutorial walks you through setting up the Bloodstain Replay system in a multiplayer environment.

Prerequisite: Before proceeding, we recommend that you first complete the Quick Start guide. This tutorial is based on the Third-Person Template in Unreal Engine.

Step 1: Change Player Controller Inheritance

First, you must modify the inheritance structure of your project’s Player Controller to enable the plugin’s network features.

  1. Check Your GameMode: Open your project’s default GameMode (e.g., BP_ThirdPersonGameMode) and identify which class is set as the Player Controller Class.

  2. Add Module Dependency (C++ Projects Only)

    Before modifying code, you must add the BloodStainSystem module to the dependency list in your project’s .Build.cs file (e.g., YourProject.Build.cs). This allows the compiler to locate the AGhostPlayerController class.

    Multiplay (1).png

    Note: After modifying the .Build.cs file, if the changes are applied correctly, you should be able to include the header file without a full path. If not, it is recommended that you right-click the .uproject file, select “Generate Visual Studio project files,” and then Rebuild the project in Visual Studio.

    Multiplay (2).png

    Important: If your classes are inherited across multiple modules (e.g., A -> B -> C), you must add the BloodStainSystem dependency to the .Build.cs file of every module in the inheritance chain.

  3. Change the Parent Class:

    Now, open the Player Controller you identified and change its parent class. The key is to alter the existing inheritance structure from (... -> APlayerController) to (... -> AGhostPlayerController -> APlayerController).

    In other words, instead of having your Player Controller inherit directly from APlayerController, modify it to inherit from the plugin’s AGhostPlayerController.

    Multiplay (3).png

Step 2: Optimize Network Settings

For stable multiplayer performance, we strongly recommend configuring a few key options.

  1. Set Up Variable Replication: In your character Blueprint (e.g., BP_ThirdPersonCharacter), select the BloodStainActor variable created during the Quick Start guide. In the Details panel, change its Replication option to Replicated. This ensures that information about which bloodstain the player is interacting with is passed from the server to clients, allowing you to synchronize UI logic.

    Multiplay (4).png

  2. Configure Data Quantization:

    Reducing the size of data sent over the network is crucial. In the Bloodstain Subsystem’s file save options, setting the Quantization Option to a lower value can significantly reduce network load. For more details, please refer to the Configuring Options section.

    Known Limitations: The system’s replay data transfer is based on Unreal Engine’s RPC (Remote Procedure Call) system. While this method is stable, it can have speed limitations when transferring large amounts of data at once. Therefore, recording and transmitting numerous replays simultaneously may lead to performance degradation. Please consider this system load during your project planning.

Results

After completing the setup, you can see the system working correctly in a multiplayer environment, as shown below.

Result in Multiplayer

Advanced Tutorial: Applying to the Lyra Starter Game

This section provides an example of how to integrate the system into Epic Games’ Lyra Starter Game (based on Lyra version 5.6).

  1. Character and Plugin Setup

    First, find B_hero_shooter, the primary character class used in the Lyra Starter Game.

    Lyra (1).png

    Next, connect the Blueprint nodes as you did in the basic template example. It is also recommended to set the Quantization option to Low in B_LyraGameMode or a similar GameMode class.

    Lyra (3).png Lyra (4).png

  2. Modify Player Controller Inheritance

    Search for LyraPlayerController, the controller used in Lyra.

    Lyra (5).png

    By tracing its inheritance, you’ll find that AModularPlayerController inherits from APlayerController. You must change this parent class to AGhostPlayerController. To do so, add the BloodStainSystem dependency to the .Build.cs files of all modules in the inheritance chain (ModularGameplayActors.cs, CommonGame.cs, and LyraGame.cs).

    If the dependencies are added correctly, you should be able to include the header file without a full path.

    Lyra (6).png

    Now, change the parent class of AModularPlayerController to AGhostPlayerController.

    Lyra (7).png

  3. Final Result and Important Note

    The setup is now complete. You can now see multiple players viewing a Ghost together in a multiplayer session.

    Lyra (9).png

    Note: You will encounter an error if you try to apply the DefaultGhost Material. This is because the SkeletalMeshAsset used in Lyra Game uses Nanite, which does not support translucent materials. To use our material or any other translucent material, you must first disable the Nanite setting for the mesh.

    Lyra (10).png