FieldWalker
FieldWalker Verification Steps
Table of Contents
Sample Overview
This project is a sample project (
FieldWalker
) using the UnrealEngineDiarkis UnrealEngine Plugin
.You can check the
Field
function ofDiarkis
.By launching multiple
FieldWalker
, you can confirm the synchronization of character positions that are being moved by other client devices.You can observe the synchronization of character positions using the
UDP
protocol.Compatible operating environments include
Windows10/11, Mac, iOS, Android, Nintendo Switch, PS4, PS5, Xbox Series X|S
.Verified on UE4.27.2 and UE5.0.3.
Verification Steps
Windows Verification Steps
Right-click on FieldWalker.uproject and select "Generate Visual Studio project files."
Open FiedlWaker.sln in Visual Studio.
Specify the Diarkis server connection destination as follows, matching the connection information.
(FieldWalker/Source/FieldWalker/Diarkis/DiarkisPluginBase.cpp)
If a client key is not required, specify
clientKey = ""
.If
uid = 0
is set for the user ID, a random ID will be assigned upon startup.
Build & Execute
For Windows: Select
DebugGame_Editor
Win64
in Visual Studio, build, and run.
Mac Verification Steps
Right-click on FieldWalker.uproject and select "Generate XCode Project."
If it fails, execute the shell command below to create FieldWalker.xcworkspace.
For UE4.27
For UE5.0
Open FieldWalker.xcworkspace with
XCode 12.5.1 (for UE4.27)
/XCode 13.3 (for UE5.0)
.Specify the Diarkis server connection destination similar to the Windows section.
Build & Execute
Selected Viewport
After launching UE4Editor, press the toolbar's
Play
button.Select
Selected Viewport
/Multiplayer Options
and chooseNumber of players: 1
.
Explanation of Each Screen
MainMenu Screen
Diarkis Server Designation
HostName: Specify the URL of the Diarkis HTTP server.
ClientKey: If the Diarkis server has set a ClientKey, specify that Key. Leave it blank if not set.
UID: Specify a unique UID different from other clients. Note that synchronization cannot be achieved if the same ID as other clients is specified.
Synchronization Method Designation
SyncMethod: Synchronization method (join within 1 minute required)
Field: Synchronization using Field. The number of Pods used (number of UDP / TCP servers) splits the Field into Grids.
By default, the UDP server is started with 1 Pod, and 1 Map is divided into 4 Grids.
Moving across Grids means position information is not sent between characters in different Grids, making them not visible.
Show Stat: Displays frame rate, etc.
Fix FPS: Fixes FPS.
FPS: Switch the fixed FPS to 30 FPS / 60 FPS.
InGame Screen
Grid Size Slider: Slider to change the size of the Grid.
Server Count Slider: Number of connected UDP servers (this affects the number of Grids).
Application operation
Functionality Check (Multiplayer Option)
After launching UE4Editor, press the toolbar's
Play
button.Select
Standalone Game
.Select
Number of players: 2-4
inMultiplayer Options
.
Multiple Windows display, and pressing the game's
Start
button is necessary.Make sure that UIDs are not the same; having identical UIDs results in unintended behavior.
Increasing Players can result in a delay in character synchronization, depending on the PC's specs.
Log Output
Log Output
Log files are output to the following folder.
FieldWalker/logs/OOOO/ (where OOOO is the user ID)
Logs output only during the debug-build.
To output logs even in Development builds, adjust
bOutputLog = true
in the DiarkisInterfaceBase constructor.LogOutType can switch between file output and debug output in the DiarkisInterfaceBase constructor.
Changing Log Levels
The log output level can be changed in the LoggerFactory constructor.
The client library's log output level can be set by function (UDP, TCP, Socket, Room, P2P, MatchMaker, Runtime, etc.).
Logs set in the Base class can specify output levels at Runtime.
For example, setting the severity to DiarkisLoggerSeverity::Warning will result in Warning and below output in the following order.
About the Code
Main Code of FieldWalker (Sample Using Diarkis Plugin)
FieldWalker/Source/FieldWalker
FieldWalkerGameMode.h / FieldWalkerGameMode.cpp
: Main class managing the Game (AGameModeBase)FieldWalkerCharacter.h / FieldWalkerCharacter.cpp
: Class for one's own character (ADiakisCharacter)
FieldWalker/Source/FieldWalker\Diarkis
DiarkisPluginBase.h / DiarkisPluginBase.cpp
: Basic class utilizing the Diarkis PluginDiarkisPluginIntterface.h / DiarkisPluginIntterface.cpp
: Interface class utilizing the Diarkis PluginDiarkisPluginSample.h / DiarkisPluginBase.cpp
: Sample class utilizing the Diarkis Plugin
Main Code of Diarkis Plugin
Method | Functionality |
---|---|
Client | Parent classes interface for controlling the Diarkis Library |
Extension | Child classes interface for controlling the Diarkis Library |
DiarkisNetwork | Interface class group for Diarkis Plugin |
libDiarkis | Diarkis library |
About the Client Code
Overview of Functionality
Parent class interface for controlling the Diarkis Library
Code Location
FieldWalker/Plugins/Diarkis/Source/Diarkis/Client
Each Class
DiarkisInterfaceBase.h / DiarkisInterfaceBase.cpp
: Interface class controlling Diarkis from UE4 (controls libDiarkis)DiarkisRoomBase.h / DiarkisRoomBase.cpp
: Parent class for Room functionality (controls libDiarkis)DiarkisGroupBase.h / DiarkisGroupBase.cpp
: Parent class for Group functionality (controls libDiarkis)DiarkisFieldBase.h / DiarkisFieldBase.cpp
: Parent class for Field functionality (controls libDiarkis)DiarkisTcpBase.h / DiarkisTcpBase.cpp
: Parent class for TCP functionality (controls libDiarkis)DiarkisUdpBase.h / DiarkisUdpBase.cpp
: Parent class for UDP functionality (controls libDiarkis)DiarkisP2PBase.h / DiarkisP2PBase.cpp
: Parent class for P2P functionality (controls libDiarkis)DiarkisMatchMakerBase.h / DiarkisMatchMakerBase.cpp
: Parent class for MatchMaker functionality (controls libDiarkis)DiarkisRPCBase.h / DiarkisRPCBase.cpp
: Parent class for RPC functionality (controls libDiarkis)
About the Extension Code
Overview of Functionality
Child class group interface for controlling the Diarkis Library
Code Location
FieldWalker/Plugins/Diarkis/Source/Diarkis/Extension
Each Class
Character
(Data Synchronization Class for Character)DiarkisCharacter.h / DiarkisCharacter.cpp
: Character synchronization class for DiarkisCharacterSyncData.h / CharacterSyncData.cpp
: Class for serializing/deserializing character position dataCharacterMoveData.h / CharacterMoveData.cpp
: Initial position class for character synchronizationCharacterStateData.h / CharacterStateData.cpp
: Class for position data with frame-by-frame differences
Component
(Component Class for Diarkis Position Synchronization)DiarkisSyncComponent.h / DiarkisSyncComponent.cpp
: Component class for Diarkis position synchronizationDiarkisCharacterSyncComponent.h / DiarkisCharacterSyncComponent.cpp
: Sample implementation component class for custom data reception/transmission during Actor creation
Movement
(Class for Diarkis Position Synchronization)DiarkisMovementController.h
: Interface class for position synchronization ComponentDiarkisLocalMovementSync.h / DiarkisLocalMovementSync.cpp
: Local use position synchronization Component classDiarkisRemoteMovementSync.h / DiarkisRemoteMovementSync.cpp
: Remote use position synchronization Component class
Diarkis/Utils
(Utility Classes)DiarkisUtils.h / DiarkisUtils.cpp
Interface Classes for Controlling the Library (Derived Classes of XXXBase)
DiarkisInterface.h / DiarkisInterface.cpp
DiarkisRoom.h / DiarkisRoom.cpp
: Class controlling the Room functionalityDiarkisGroup.h / DiarkisGroup.cpp
: Class controlling the Group functionalityDiarkisField.h / DiarkisField.cpp
: Class controlling the Field functionalityDiarkisTcp.h / DiarkisTcp.cpp
: Class controlling the TCP functionalityDiarkisUdp.h / DiarkisUdp.cpp
: Class controlling the UDP functionalityDiarkisP2P.h / DiarkisP2P.cpp
: Class controlling the P2P functionalityDiarkisMatchMaker.h / DiarkisMatchMaker.cpp
: Class controlling the MatchMaker functionalityDiarkisRPC.h / DiarkisRPC.cpp
: Class controlling the RPC functionalityDiarkisSyncData.h / DiarkisSyncData.cpp
: Class processing Diarkis position synchronizationDiarkisReplication.h / DiarkisReplication.cpp
: Class for Replication using the Room's PropertyDiarkisActorManagement.h / DiarkisActorManagement.cpp
: ID to identify Actors managed by Diarkis
About the DiarkisNetwork Code
Overview of Functionality
Interface class group for Diarkis Plugin
Code Location
FieldWalker/Plugins/Diarkis/Source/Diarkis/DiarkisNetwork
Each Class
Event/Interfaces
(Interface classes receiving callbacks of Room functionalities from Diarkis Plugin)DiarkisNetworkCoreEvent.h
: Interface representing Core events of Diarkis PluginDiarkisNetworkRoomEvent.h
: Interface representing Room events of Diarkis PluginDiarkisNetworkGroupEvent.h
: Interface representing Group events of Diarkis PluginDiarkisNetworkFieldEvent.h
: Class receiving callbacks of Field functionalities from Diarkis PluginDiarkisNetworkP2PEvent.h
: Interface representing P2P events of Diarkis PluginDiarkisNetworkMatchMakerEvent.h
: Interface representing MatchMaker events of Diarkis Plugin
Event/Emitters
(Classes queueing Room events from Diarkis)DiarkisNetworkCoreEventEmitter.h / DiarkisNetworkCoreEventEmitter.cpp
: Class for queueing Core events from DiarkisDiarkisNetworkEventEmitterBase.h / DiarkisNetworkEventEmitterBase.cpp
: Base class for generating various eventsDiarkisNetworkRoomEventEmitter.h / DiarkisNetworkRoomEventEmitter.cpp
: Class for queueing Room events from DiarkisDiarkisNetworkGroupEventEmitter.h / DiarkisNetworkGroupEventEmitter.cpp
: Class for queueing Group events from DiarkisDiarkisNetworkFieldEventEmitter.h / DiarkisNetworkFieldEventEmitter.cpp
: Class for queueing Field events from DiarkisDiarkisNetworkP2PEventEmitter.h / DiarkisNetworkP2PEventEmitter.cpp
: Class for queueing P2P events from DiarkisDiarkisNetworkMatchMakerEventEmitter.h / DiarkisNetworkMatchMakerEventEmitter.cpp
: Class for queueing MatchMaker events from Diarkis
Modules
(Classes that check the state of Room functionalities of Diarkis and queue callback events)DiarkisNetworkModuleBase.h / DiarkisNetworkModuleBase.cpp
DiarkisNetworkRoom.h / DiarkisNetworkRoom.cpp
: Class checking the state of Room functionalities and queueing callback eventsDiarkisNetworkGroup.h / DiarkisNetworkGroup.cpp
: Class checking the state of Group functionalities and queueing callback eventsDiarkisNetworkField.h / DiarkisNetworkField.cpp
: Class checking the state of Field functionalities and queueing callback eventsDiarkisNetworkP2P.h / DiarkisNetworkP2P.cpp
: Class checking the state of P2P functionalities and queueing callback eventsDiarkisNetworkMatchMaker.h / DiarkisNetworkMatchMaker.cpp
: Class checking the state of MatchMaker functionalities and queueing callback events
DiarkisNetworkBlueprintLibrary.h / DiarkisNetworkBlueprintLibrary.cpp
: Class registering callback events of Diarkis Plugin as Blueprint functionsDiarkisNetworkManager.h / DiarkisNetworkManager.cpp
: Class managing Diarkis PluginDiarkisNetworkSubsystem.h / DiarkisNetworkSubsystem.cpp
: Class holding the UDiarkisNetworkManager instance
About the libDiarkis Code
Overview of Functionality
C++ library of Diarkis
Code Location
FieldWalker/Plugins/Diarkis/Source/ThirdParty/libDiarkis/prebuilt
Files of Each Library
Library used in win-x64
(win-x64\bin\diarkis.dll)
Library used in macos-x64
(macos-x64\lib\diarkis.dylib)
Library used in android
(android\libs\arm64-v8a\diarkis.so)
Library used in iOS
(iOS\lib_static\libdiarkis.lib)
Library used in switch
(nx64\Libraries\NX-NXFP2-a64\Release\libdiarkis.a)
Library used in ps4
(ps4\lib_staic\libdiarkis.a)
Library used in ps5
(ps5\lib_staic\libdiarkis.a)
Library used in xbox
(xbox-series\lib_staic\diarkis.a)
Class Diagram
Class Diagram for Diarkis Plugin
To customize the Diarkis Plugin
Prepare a derived class from the class controlling the Diarkis library's interface (the red box at the bottom of the diagram) and customize the process.
Refer to
ADiarkisPluginSample
for customizing processing.
Class Diagram for Character Synchronization
To customize the synchronization method
Prepare derived classes of
DiarkisLocalMovementSync
,DiarkisRemoteMovementSync
, or prepare a derived class ofADiarkisCharacter
to customize processing.
About Synchronization Features
Features Synchronizable with Diarkis Plugin
The Field Walker sample includes examples of the following synchronizable features using the Diarkis Plugin.
Instance management of actors
Position synchronization of actors
Variable replication
RPC
These features are implemented differently from the standard UE communication procedures, requiring separate settings and implementation. Since synchronization is implemented using Diarkis Room functionality, it needs to be in a state where communication via Room is possible.
Instance Management of Actors
Locally created and deleted actors with
DiarkisSyncComponent
will have their instance management information sent remotely to have identical actor instances across hosts in synchronization state. Actors initially placed in the map reuse already created instances, while dynamically created actors are newly spawned on remote hosts.DiarkisSyncComponent
carries aDiarkis Actor ID
to identify the actor on the Diarkis network, and uses this ID for identification. It can also determine if it is an owner of theDiarkisSyncComponent
, allowing switching of behavior between local and remote contexts. For example, inThirdPerson_AnimSyncBP
, it switches whether to use information from localCharacterMovement
or information obtained from communication using this flag.This
Actor ID
or owner flag becomes usable after connecting to the Diarkis network and having the necessary information ready. AnDiarkisSyncComponent
eventDiarkisActorIDDecided
allows awareness of this timing. For example,ThirdPersonCharacter
utilizes this event inBegin Play
to execute registration of replication and RPC processes once the owner is decided.Additionally, custom data can be added when creating remote actors.
UDiarkisCharacterSyncComponent::SerializeSpawnActorCustomPayload()
adds custom data to remote-actor creation data, whileUDiarkisCharacterSyncComponent::DeserializeSpawnActorCustomPayload()
extracts necessary information from the received data.
Position Synchronization of Actors
Adding
DiarkisSyncComponent
to an Actor enables these features. Identical actors are automatically created on other hosts connected to the same Room. The remote-sideTherdPersonCharacter
seamlessly synchronizes position, orientation, jump state, and when the remote host exits Room, the remote actor in a local host also automatically deletes.
Variable Replication
Synchronizes variables held by Actors across the network. Target variables require
UPROPERTY()
specification. Specify the target Actor and variable name, and register withRegister Replicated Variable
, while sending data when necessary withSend Replicated Variable
. However, the transmission interval will occur no more frequently than permitted byDiarkisReplication::replicationMinimumInterval
. The sample implementation resides in the BlueprintThirdPersonCharacter
underRegister Replicated Variables
andSend Replicated Variable
.
RPC
Facilitates network-based function calls of Actor-held functions. Target functions require
UFUNCTION()
specification. Specify the target Actor and method name, register withRegister Rpc UEFunc
, and send using methods likeSend Rpc UEFunc All
. The remote side, upon receiving RPC, invokes the method of the indicated name in the actor with the same Actor ID. The sample registers RPCs within the BlueprintThirdPersonCharacter
byRegister RPCs
, whileAFieldWalkerCharacter::HandleFire()
executes an RPC transmission.
Operational Verification Environment
Supported Platforms
Windows10
Mac
Android
iOS
Nintendo Switch
PS4 / PS5
Xbox Series X|S
UnrealEngine Versions
4.27.2
5.0.3
UE 4.27.2
VisualStudio2019 Version142 (16.10.4)
WindowsSDK Version 10.0.19041.0
Android Environment
android-studio-2020.3.1.22-windows.exe
Android NDK 22.1.7171670
Andriod 4.4 (API Level 19)
Mac/iOS Environment
XCode 12.5.1
Nitendo Switch Environment
UE4 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 4.27.2 release
Commit: d94b38ae3446da52224bedd2568c078f828b4039
UE4 Switch Platform Package
Obtain code from the Console Switch via a portal site provided by EpicGames.
Using the pack Switch_4.27.2-release.zip
Switch NintendoSDK 12.3.2
PS4 Environment
UE4 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 4.27.2 release
Commit: d94b38ae3446da52224bedd2568c078f828b4039
UE4 PS4 Platform Package
Obtain code from the Console PS4 via a portal site provided by EpicGames.
Using the pack PS4_4.27.2-release.zip
SDK Version 9.0008.000
PS5 Environment
UE4 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 4.27.2 release
Commit: d94b38ae3446da52224bedd2568c078f828b4039
UE4 PS5 Platform Package
Obtain code from the Console PS5 via a portal site provided by EpicGames.
Using the pack PS5_4.27.2-release.zip
SDK Version 4.51.00.01
Xbox Series X|S Environment
UE4 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 4.27.2 release
Commit: d94b38ae3446da52224bedd2568c078f828b4039
UE4 Xbox Series X|S Platform Package
Obtain code from the Console Xbox via a portal site provided by EpicGames.
Using packs GDK_4.27.2-release.zip / XDK_4.27.2-release.zip
GDK version 210402
UE 5.0.3
VisualStudio2019 Version142 (16.10.4)
WindowsSDK Version 10.0.19041.0
Android Environment
android-studio-2020.3.1.22-windows.exe
Android NDK 22.1.7171670
Andriod 6.0 (API Level 23)
Mac/iOS Environment
XCode 13.3
UE 5.0.2
PS4 Environment
UE5 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 5.0.2 release
Commit: d11782b9046e9d0b130309591e4efc57f4b8b037
UE4 PS4 Platform Package
Obtain code from Console Playstation 4 via a portal site provided by EpicGames.
Using the pack PS4_5.0.2-release.zip
PS4 SDK Version 9.508.001
PS4 System Software 9.600.011
PS5 Environment
UE5 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 5.0.2 release
Commit: d11782b9046e9d0b130309591e4efc57f4b8b037
UE4 PS5 Platform Package
Obtain code from Console Playstation 5 via a portal site provided by EpicGames.
Using the pack PS5_5.0.2-release.zip
PS5 SDK Version 5.000.00.41
PS5 System Software 5.50.00.08
Xbox Series X|S Environment
UE5 base code
Repository: 「git@github.com:Diarkis/UnrealEngine.git」
Tag: 5.0.2 release
Commit: d11782b9046e9d0b130309591e4efc57f4b8b037
UE4 Xbox Series X|S Platform Package
Obtain code from Console Xbox [GDK] via a portal site provided by EpicGames.
Using the pack GDK_5.0.2-release.zip
GDK: 211001 October 2021 Update 1
Operational Verification Steps
Steps for Creating Windows10 Package
In the "File" menu, select "Package Project" and then choose "Windows10 (64bit)."
Specify the folder where the package will be output.
Once the build is successful, start via FieldWalker.exe in the specified output folder.
Operation Verification Steps on Android Devices (Separate Setup for AndroidStudio Environment Needed)
Click "Edit" in the UnrealEditor taskbar and then "Project Settings."
APK Packaging
Android Packaging
Minimum SDK Version
Target SDK Version
Build - uncheck arumv7 (support planned for later updates)
Check arm64 for support
Set each of the above items according to the environment.
Connect an Android device, and from the right ▽ of the "Launch" toolbar, select Android Device.
"Launch" will build the package and transfer it to the app after packaging.
Operation Verification Steps on iOS Devices
Click "Edit" in the UnrealEditor taskbar and then "Project Settings."
Go to the "iOS" section under Platforms.
Set "Provisioning Profile"
Set "Certificate"
Set "Bundle Display Name"
Set "Bundle Name"
Set "Bundle Identifier"
Connect an iPhone device, and from the right ▽ of the "Launch" toolbar, select iPhone Device.
"Launch" will build the package and transfer it to the app after packaging.
Operation Verification Steps on Switch Devices
Establish an "Epic Games Console NDA" with EpicGames to obtain the Platform Code for Switch.
Obtain the project code for UE4 4.27.2.
Install NintendoSDK 12.3.2
Latest compatibility of UE4 4.27.2 is NintendoSDK 12.3.2
In VisualStudio2019, select "Development" device: "Switch" project: "FieldWalker" for the build.
The build may take several hours. Once built, execute to run.
Last updated