FieldWalker
FieldWalker Verification Procedure
Table of Contents
Sample Overview
This is a sample project (
FieldWalker
) using theDiarkis UnrealEngine Plugin
for UnrealEngine.You can verify features such as
Room, Group, Field, P2P, MatchMaker, RPC, DirectMessage
inDiarkis
.By running multiple instances of
FieldWalker
, you can verify the synchronization of character positions running on other client devices.Character position synchronization can be verified using the
UDP/TCP
protocol or theP2P
protocol.Supported platforms include Windows10/11, Mac, iOS, Android, Nintendo Switch, PS4, PS5, Xbox Series X|S.
Verified with UE5.3.2.
Verification Procedure
Windows Verification Procedure
Right-click on FieldWalker.uproject and select "Generate Visual Studio project files" from the context menu.
Open FieldWalker.sln with Visual Studio.
Build & Run
To run on Windows: Select
DebugGame_Editor
andWin64
in Visual Studio, then build and run.
Mac Verification Procedure
Right-click on FieldWalker.uproject and select "Generate XCode Project" from the context menu.
If the process fails, execute the following shell command to create FieldWalker.xcworkspace.
In the case of UE4.27:
In the case of UE5.0:
Open FieldWalker.xcworkspace in XCode 12.5.1 (for UE4.27) or XCode 13.3 (for UE5.0).
Build and Run
From the
File
menu, selectWorkspace Settings
and chooseNew Build System
.Select
FieldWalker
My Mac(XXXXX)
under Scheme.
In EditScheme's Build Configuration, select
DebugGame Editor
and then build & run.
Selected Viewport
Launch UE5Editor and click the
Play
button on the toolbar.Select
Selected Viewport
and setMultiplayer Option
toNumber of Players: 1
.
Explanation of Each Screen
Login Screen
After launch, the first displayed login menu is as follows:
Specify the Diarkis Server.
HostName: Specify the URL of the Diarkis HTTP server.
ClientKey: Specify if there is a ClientKey on the Diarkis server; otherwise, leave it blank.
UID: Specify a unique UID different from other clients. Caution! Synchronization will not occur if the same UID as other clients is specified. By default, this value is a combination of the machine name and client's process ID.
Protocol: Choose a communication method (UDP/TCP).
Start Button: Moves to InGame and allows verification of character position synchronization.
Framerate Settings
Show Stat: Displays information such as framerate.
Fix FPS: Fixes the FPS.
FPS: Toggles fixed FPS between 30FPS and 60FPS.
MainMenu Screen
After launch, the first displayed main menu screen is as follows:
Select the sample type.
RoomRandomJoin: Participates in a synchronized Room through RandomJoinRoom.
Field: Synchronization using Field features. Field is divided into a Grid according to the number of Pods (UDP/TCP servers) used.
By default, an UDP server with 1 Pod is running, so 1Map is divided into 4Grid.
Even if the other character is in the adjacent Grid, if the character is within your sight, the character's position information will be sent.
MatchMaker Button: Transitions to the MatchMaker Menu screen. Does not affect
SyncMethod
.Ticket Button: Transitions to the Ticket Menu screen. Does not affect
SyncMethod
.Disconnect Button: Disconnects from Diarkis and returns to the login menu.
InGame Screen
Clicking the Start button on the MainMenu screen transitions you to the InGame screen, synchronizing the character's position according to the "synchronization method" specified on the MainMenu screen.
Application Operation
Verification Method for P2P Connection
When connected in a Room, press the
P2P Start
button on the InGame screen.If successful (HolePunch), it will show
P2P Connect: 1 Client
on the InGame screen, and P2P communication between terminals will begin.If joined InGame via MatchMaker, transition to P2P using MatchMaker features.
MatchMaker Screen
Clicking the MatchMaker button on the MainMenu screen transitions you to the MatchMaker screen, allowing you to join InGame (Room) with matched opponents in MatchMaker.
Matching Types
Rank Matching
In this sample, users with ranks of 1-10, 11-20, 21-30, 31-40,... are matched with each other.
On the UI, users with the same number in "Rank", 5 or 8 or 10, or 12 or 15 will be matched together.
Matching by RateAndPlay
Matches with users having the same combination of "Rating" and "Play".
OwnUID: Your UID is displayed.
MatchMaker
Matching occurs based on the matching type.
Host Button: Click this button if you want to be the host for matching.
Search Button: Click this button if you want to match as a guest.
MatchMaker UID Lists: Displays the UID list of matched members.
Abort Button: Excludes from matching search. This function is available only to hosts.
Release Button: Releases the match. This function is available only to hosts.
Complete Button: Completes the match and removes the host from the matching search. This function is available only to hosts.
Ends matching. This function is available only to guests.
Team MatchMaker
TeamMatchMaker matches teams based on the
matching type
, but when checking TeamMatchMaker, thematching type
used in MatchMaker must be different.Team Host Button: Click this button if you are the host for team matching. This button is only available to someone who was the host in MatchMaker.
Team Search Button: Click this button if you want to match as a guest.
TeamMatchMaker UID Lists: Displays the UID list of matched members.
Abort Button: Excludes the team from matching searches. This function is available only to hosts.
Complete Button: Completes matching and excludes from matching search. This function is available only to hosts.
Synchronization
Sync Button: The message entered in SendMessage is sent to all matched hosts.
Send Message: Enter the message to send.
Recv Message: Displays received messages.
Start Button: Moves to InGame with matched members.
Main Menu Button: Returns to the main menu.
Operational Verification (Multiplayer Option)
Once UEEditor is launched, press the
Play
button on the toolbar.Choose
Standalone Game
.Select
Number of Players: 2 ~ 4
inMultiplayer Option
.Select
Play Standalone
in the network modeNet Mode
.
Multiple Windows will be displayed. Press the
Start
button on the game screen.Make sure that the UID is not the same. Otherwise, unexpected behavior will occur.
When playing with several people, synchronization of characters might be delayed depending on the PC specs.
The following steps are the same as the selected viewport case.
Log Output
Log Output
Log files are output in the following folders.
FieldWalker/logs/○○○/ and the following folders (OOOO is the user ID).
Logs are only output during debug builds.
If you want to output logs even during the Development build, adjust
bOutputLog = true
in the constructor of DiarkisInterfaceBase.In the constructor of DiarkisInterfaceBase, you can switch between file output and debug output with LogOutType.
Change Log Level
You can change the log output level in the constructor of LoggerFactory.
Log output levels can be set for each function of the client library (UDP, TCP, Socket, Room, P2P, MatchMaker, Runtime, etc.).
For logs set in the Base class, output levels can be specified with Runtime.
For instance, setting DiarkisLoggerSeverity::Warning will result in output below Warning in the following order:
About the Code
Main Code on FieldWalker Side (Sample using Diarkis Plugin)
FieldWalker/Source/FieldWalker
: FieldWalkerGameMode.h / FieldWalkerGameMode.cppFieldWalkerGameMode.h / FieldWalkerGameMode.cpp
: Main class that manages the game (AGameModeBase)FieldWalkerCharacter.h / FieldWalkerCharacter.cpp
: Character class (ADiakisCharacter)
FieldWalker/Source/FieldWalkerDiarkis
.DiarkisPluginBase.h / DiarkisPluginBase.cpp
: Base class to use Diarkis PluginDiarkisPluginInterface.h / DiarkisPluginInterface.cpp
: Interface class for using Diarkis PluginDiarkisPluginSample.h / DiarkisPluginBase.cpp
: Sample class using Diarkis Plugin
Main Code of Diarkis Plugin
Client
Parent class of interfaces controlling Diarkis library
Extension
Child classes of interfaces controlling Diarkis library
DiarkisNetwork
Interface class of Diarkis Plugin
libDiarkis
Diarkis library
About Client Code
Overview of roles
Parent class of interfaces controlling the Diarkis library
Code location
FieldWalker/Plugins/Diarkis/Source/Diarkis/Client
Each class
DiarkisInterfaceBase.h / DiarkisInterfaceBase.cpp
: Interface class for controlling Diarkis from UE (controls libDiarkis)DiarkisRoomBase.h / DiarkisRoomBase.cpp
: Parent class of Room features (controls libDiarkis)DiarkisGroupBase.h / DiarkisGroupBase.cpp
: Parent class of Group features (controls libDiarkis)DiarkisFieldBase.h / DiarkisFieldBase.cpp
: Parent class of Field features (controls libDiarkis)DiarkisTcpBase.h / DiarkisTcpBase.cpp
: Parent class of TCP features (controls libDiarkis)DiarkisUdpBase.h / DiarkisUdpBase.cpp
: Parent class of UDP features (controls libDiarkis)DiarkisP2PBase.h / DiarkisP2PBase.cpp
: Parent class of P2P features (controls libDiarkis)DiarkisMatchMakerBase.h / DiarkisMatchMakerBase.cpp
: Parent class of MatchMaker features (controls libDiarkis)DiarkisRPCBase.h / DiarkisRPCBase.cpp
: Parent class of RPC features (controls libDiarkis)
About Extension Code
Overview of roles
Child classes of interfaces controlling the Diarkis library
Code location
FieldWalker/Plugins/Diarkis/Source/Diarkis/Extension
Each class
Character` (Character data synchronization class)
DiarkisCharacter.h / DiarkisCharacter.cpp
: Class for Diarkis character synchronization.
Component` (Diarkis component class for location synchronization)
DiarkisSyncComponent.h / DiarkisSyncComponent.cpp
: Diarkis location synchronization component classDiarkisCharacterSyncComponent.h / DiarkisCharacterSyncComponent.cpp
: Sample implementation component class for sending and receiving custom data when creating an actor
Movement` (Diarkis location synchronization class)
DiarkisMovementController.h
: Interface class for location synchronization componentDiarkisLocalMovementSync.h / DiarkisLocalMovementSync.cpp
: Location synchronization component class for local use.DiarkisRemoteMovementSync.h / DiarkisRemoteMovementSync.cpp
: Location synchronization component class for remote use.
Diarkis/Utils` (Utility class)
DiarkisUtils.h / DiarkisUtils.cpp
: Interface class for controlling the library
Interface class for controlling the library (derived from XXXBase)
DiarkisInterface.h / DiarkisInterface.cpp
(Class derived from XXXBase)DiarkisRoom.h / DiarkisRoom.cpp
: Class for controlling Room featuresDiarkisGroup.h / DiarkisGroup.cpp
: Class for controlling Group featuresDiarkisField.h / DiarkisField.cpp
: Class for controlling Field featuresDiarkisTcp.h / DiarkisTcp.cpp
: Class for controlling TCP featuresDiarkisUdp.h / DiarkisUdp.cpp
: Class for controlling UDP featuresDiarkisP2P.h / DiarkisP2P.cpp
: Class for controlling P2P featuresDiarkisMatchMaker.h / DiarkisMatchMaker.cpp
: Class for controlling MatchMaker featuresDiarkisRPC.h / DiarkisRPC.cpp
: Class for controlling RPC featuresDiarkisSyncData.h / DiarkisSyncData.cpp
: Class for processing Diarkis location synchronizationDiarkisReplication.h / DiarkisReplication.cpp
: Class for variable replication using Room PropertiesDiarkisActorManagement.h / DiarkisActorManagement.cpp
: ID for identifying actors managed by Diarkis
About DiarkisNetwork Code
Overview of roles
Interface class group of Diarkis Plugin
Code location
FieldWalker/Plugins/Diarkis/Source/Diarkis/DiarkisNetwork
Each class
Event/Interfaces` (Interface class for receiving callbacks for Room functions of Diarkis Plugin)
DiarkisNetworkCoreEvent.h
: Interface representing Core event of Diarkis Plugin.DiarkisNetworkRoomEvent.h
: Interface representing Room event of Diarkis Plugin.DiarkisNetworkGroupEvent.h
: Interface representing Group event of Diarkis PluginDiarkisNetworkFieldEvent.h
: Class for receiving callbacks for Field functions of Diarkis Plugin.DiarkisNetworkP2PEvent.h
: Interface for P2P events of Diarkis PluginDiarkisNetworkMatchMakerEvent.h
: Interface for MatchMaker events of Diarkis Plugin
Event Emitter` (Class for queuing Diarkis Room events)
DiarkisNetworkCoreEventEmitter.h / DiarkisNetworkCoreEventEmitter.cpp
: Class for queuing Diarkis Core events.DiarkisNetworkEventEmitterBase.h / DiarkisNetworkEventEmitterBase.cpp
: Base class for generating various events.DiarkisNetworkRoomEventEmitter.h / DiarkisNetworkRoomEventEmitter.cpp
: Class for queuing Diarkis Room events.DiarkisNetworkGroupEventEmitter.h / DiarkisNetworkGroupEventEmitter.cpp
: Class for queuing Diarkis Group eventsDiarkisNetworkFieldEventEmitter.h / DiarkisNetworkFieldEventEmitter.cpp
: Class for queuing Diarkis Field eventsDiarkisNetworkP2PEventEmitter.h / DiarkisNetworkP2PEventEmitter.cpp
: Class for queuing Diarkis P2P eventsDiarkisNetworkMatchMakerEventEmitter.h / DiarkisNetworkMatchMakerEventEmitter.cpp
: Class for queuing Diarkis MatchMaker events
Modules` (Class for checking the status of Room functions of Diarkis and queuing callback events)
DiarkisNetworkModuleBase.h / DiarkisNetworkModuleBase.cpp
: Class for queuing Diarkis's MatchMaker eventsDiarkisNetworkRoom.h / DiarkisNetworkRoom.cpp
: Class for checking the status of Room functions of Diarkis and queuing callback events.DiarkisNetworkGroup.h / DiarkisNetworkGroup.cpp
: Class for checking the status of Group functions of Diarkis and queuing callback events.DiarkisNetworkField.h / DiarkisNetworkField.cpp
: Class for checking the status of Field functions of Diarkis and queuing callback events.DiarkisNetworkP2P.h / DiarkisNetworkP2P.cpp
: Class for checking the status of P2P functions of Diarkis and queuing callback events.DiarkisNetworkMatchMaker.h / DiarkisNetworkMatchMaker.cpp
: Class for checking the status of MatchMaker functions of Diarkis and queuing callback events.
DiarkisNetworkBlueprintLibrary.h / DiarkisNetworkBlueprintLibrary.cpp
: Class for registering callback events of Diarkis Plugin as blueprint functions.DiarkisNetworkManager.h / DiarkisNetworkManager.cpp
: Class managing Diarkis PluginDiarkisNetworkSubsystem.h / DiarkisNetworkSubsystem.cpp
: Class holding UDiarkisNetworkManager instance
About libDiarkis Code
Overview of roles
Diarkis C++ Library
Code location
FieldWalker/Plugins/Diarkis/Source/ThirdParty/libDiarkis/prebuilt
Each library file
Library used on win-x64
(win-x64\bin\diarkis.dll)
Library used on macos-x64
(macos-x64\lib\diarkis.dylib)
Library used on android
(android\libs\arm64-v8a\diarkis.so)
Library used on ios
(iOS\lib_static\libdiarkis.lib)
Library used on switch
(nx64\Libraries\NX-NXFP2-a64\Release\libdiarkis.a)
Library used on ps4
(ps4\lib_staic\libdiarkis.a)
Library used on ps5
(ps5\lib_staic\libdiarkis.a)
Class Diagram
Class diagram of Diarkis Plugin
To customize Diarkis Plugin
Provide a class derived from the interface class controlling the Diarkis library (red frame at top of diagram) and customize its processing.
Refer to
ADiarkisPluginSample
for customization.
Class diagram related to character synchronization
To customize the synchronization method
Provide a class derived from
DiarkisLocalMovementSync
orDiarkisRemoteMovementSync
for customization or provide a class derived fromADiarkisCharacter
for customization.
About Synchronization Features
Features Synchronizable with Diarkis Plugin
The FieldWalker sample includes samples of the following features that can be synchronized using the Diarkis Plugin.
Actor Instance Management
Actor Location Synchronization
Variable Replication
RPC
These features are implemented differently from standard UE communication processes, so you need to set up and implement them separately from normal communication processes. Also, since synchronization is implemented using the Diarkis Room feature, communication using Room must be possible.
Actor Instance Management
When an actor with
DiarkisSyncComponent
is created or removed locally, information for managing actor instances is sent to remote, and synchronization occurs so that the same actor instances exist on each host. Actors initially placed on the map are reused from existing instances, whereas dynamically created actors are generated dynamically on remote.DiarkisSyncComponent
has aDiarkis ActorID
used to identify actors on the Diarkis network. You can also determine whether you are the owner of theDiarkisSyncComponent
and use this information to switch between local and remote behavior. For example,ThirdPerson_AnimSyncBP
switches between using information from the localCharacterMovement
or using information obtained through communication based on this flag.The
actor ID
and ownership flag become available after connecting to the Diarkis network and obtaining the necessary information.DiarkisSyncComponent
has anOnDiarkisActorIDDecided
event, which informs you when this event occurs. For example, theBegin Play
ofThirdPersonCharacter
uses this event to perform replication and RPC registration processing after the owner is determined.Custom data can also be added when creating remote actors.
UDiarkisCharacterSyncComponent::SerializeSpawnActorCustomPayload()
adds custom data to the remote actor creation data, andUDiarkisCharacterSyncComponent::DeserializeSpawnActorCustomPayload()
retrieves the necessary information from the received data.
Actor Location Synchronization
By adding a
DiarkisSyncComponent
to an actor, these features are enabled. The same Actor is automatically created on other hosts connected to the same Room. RemoteThirdPersonCharacter
automatically synchronizes location, posture, jump state, etc. When a remote host leaves the Room, the remote actor existing locally is also automatically removed.
Variable Replication
Synchronize variables that an actor possesses over the network. You need to specify
UPROPERTY()
for the target variables. Register the target Actor and variable names withRegister Replicated Variable
and send data at the required timing withSend Replicated Variables
. However, the transmission interval will be the shortest timing ofDiarkisReplication::replicationMinimumInterval
. In this sample, there are implementations inThirdPersonCharacter
blueprint'sRegister Replicated Variables
andSend Replicated Variable
.
RPC
RPC is a function that calls the function of an Actor over the network. Specify
UFUNCTION()
for the target function. Register the function by specifying the target Actor and variable name withRegisterRpcUEFuncName
, and send withSendRpcUEFuncAll
, etc. When a remote side receives the RPC, it calls the method with the specified name of the Actor that has the same Actor ID. In this sample, the RPC in the blueprint ofThirdPersonCharacter
is registered and sent inAFieldWalkerCharacter::HandleFire()
.
Features Utilizing Synchronization in the Sample
In this sample, the following processes are implemented using the above functions.
Player Character Generation and Location Synchronization
When
ThirdPersonCharacter
is created locally, the same actor is automatically created on other hosts connected to the same Room. RemoteThirdPersonCharacter
automatically synchronizes location, posture, jump state, etc. When a remote host leaves the Room, the remote actor existing locally is also automatically removed. Also, when creating a remote player character, the owner's determined actor's color is passed as initial data, reproducing the same appearance on all hosts.
AI Character Management
AI is executed only on a specific host, and the position information is synchronized on other hosts. In this sample, AI characters are executed on the host that is the room owner, and the results are synchronized with normal actor position information. When the room owner leaves, the authority to handle the AI character is delegated to the new room owner. The two green characters will be AI characters.
Bullet Firing
Bullet firing processing is called via
RPC
on the remote host side. When firing locally, if you are the owner of the player character, anRPC
call is sent to other hosts participating in the room. ThisRPC
call allows the remote host to perform the same bullet firing process. The collision and damage processing of the bullet are determined by the host that is the owner of the actor.
Health Synchronization
The variable
Health
ofThirdPersonCharacter
is synchronized through replication. WhenHealth
decreases upon being hit on the host that ownsThirdPersonCharacter
, it is automatically synchronized to theHealth
variable of the remoteThirdPersonCharacter
. Additionally, whenHealth
is recovered by theRecovery
button, the change is automatically reflected in the remoteThirdPersonCharacter
.
Operational Verification Environment
Supported Platforms
Windows 10
Mac OS X
Android
iOS
Nintendo Switch
PS4 / PS5
Xbox Series X|S
UnrealEngine Version
5.3.2
UE 5.3.2
VisualStudio 2022
Windows SDK Version 10.0.19041.0
Android Environment
android-studio-2020.3.1.22-windows.exe
Android NDK 22.1.7171670
Android 6.0 (API Level 23)
Mac/iOS Environment
XCode 13.3
UE 5.0.2
PS4 Environment
UE5 Base Code
"git@github.com:Diarkis/UnrealEngine.git" repository
5.0.2 Release Tag
Commit: d11782b9046e9d0b130309591e4efc57f4b8b037
UE PS4 Platform Package
Obtain the code for console PS4 from the portal site provided separately by EpicGames.
Use the PS4_5.0.2-release.zip package.
PS4 SDK Version 9.508.001
PS4 System Software 9.600.011
PS5 Environment
UE5 Base Code
"git@github.com:Diarkis/UnrealEngine.git" repository
5.0.2 Release Tag
Commit: d11782b9046e9d0b130309591e4efc57f4b8b037
UE PS5 Platform Package
Obtain the code for console PS5 from the portal site provided separately by EpicGames.
Use the PS5_5.0.2-release.zip package.
PS5 SDK Version 5.000.00.41
PS5 System Software 5.50.00.08
Xbox Series X|S Environment
UE5 Base Code
"git@github.com:Diarkis/UnrealEngine.git" repository
5.0.2 Release Tag
Commit: d11782b9046e9d0b130309591e4efc57f4b8b037
UE Xbox Series X|S Platform Package
Obtain the code for console Xbox [GDK] from the portal site provided separately by EpicGames.
Use the GDK_5.0.2-release.zip package.
GDK: 211001 October 2021 Update 1
Operational Verification Procedure
Steps to Create Windows 10 Package
Select
Edit
Menu =>Package Project
=>Windows 10 (64bit)
.Specify the output destination folder for the package.
If the build succeeds, launch FiledWalker.exe from the folder you specified as the output destination.
Android Device Operation Verification Procedure (Separate AndroidStudio setup required)
Click
Settings
⇒Project Settings
from the taskbar of UnrealEditor.Click
Android
under Platform section.
APK Package
Android Package
Minimum SDK Version
Target SDK Version
Build
Uncheck armv7 support (armv7 will be progressively supported)
Check arm64 support
Checkmark "Android SDK" under Platform section
Set each of these items according to your environment.
Connect an Android dev kit device and package the project for Android platform.
Execute the adb server using "adb start-server" command in the command prompt.
Double click the install file located in the output directory of the android project.
Once the installation is complete, the app appears on the last page of the app list of the dev kit.
Launching the app displays the main menu eventually.
iOS Device Operational Verification Procedure
Press
Settings
=>Project Settings
from the taskbar of UnrealEditor.iOS under Platform section
Configuring
Provisioning Profile
Configure
Certificate
Setting of
Bundle Display Name
Setting of
Bundle Name
Setting of
Bundle Identifier
Connect your iPhone device and choose the iPhone device from "Launch" in the toolbar on the right.
Once the package build is complete, it transfers the package to the app.
Switch Device Operational Verification Procedure
Conclude
Epic Games Console NDA
with EpicGames and obtain Platform code for Switch.Obtain the project code for UE 4.27.2.
Install NintendoSDK 12.3.2.
Latest support for UE 4.27.2 is NintendoSDK 12.3.2.
Select VisualStudio2019 Build: Choose Terminal:
Development
Select:Switch
Project:FieldWalker
and build.Building might take several hours. Execute after building.
Last updated
Was this helpful?