FieldWalker

FieldWalker Verification Steps

Table of Contents

Sample Overview

  • This project is a sample project (FieldWalker) using the Diarkis UnrealEngine Plugin in UnrealEngine.

  • It allows you to verify the Field feature of Diarkis.

  • By launching multiple instances of FieldWalker, you can verify synchronization of character positions running on different client devices.

  • It uses the UDP protocol to verify character position synchronization.

  • Supported operational verification environments are 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

  1. Right-click on FieldWalker.uproject and select "Generate Visual Studio project files".

  2. Open FieldWalker.sln with Visual Studio.

  3. Specify the Diarkis server connection information as follows: (FieldWalker/Source/FieldWalker/Diarkis/DiarkisPluginBase.cpp)

    ADiarkisPluginBase::ADiarkisPluginBase()
    {
         // Diarkis server connection server address
         Host = "192.168.11.2:7000";
         // Host = "asia-northeast1.diarkis.io/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    
         // Diarkis server connection client key
         ClientKey = "";
         // ClientKey = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    
         // Diarkis server connection uid (specify different id for each user)
         UID = 1111;
     }
    • If a client key is not needed, specify clientKey = "".

    • If the user ID is uid = 0, a random ID will be assigned when starting.

  4. Build & Run:

    • Windows: Build and run by selecting DebugGame_Editor and Win64 in VisualStudio

Mac Verification Steps

  1. Right-click on FieldWalker.uproject and select "Generate XCode Project".

    • If the process fails, run the following shell command to create FieldWalker.xcworkspace.

    For UE4.27

    sh "/{PATH_TO_ENGINE}/UE_4.27/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" -project="/{PATH_TO_PROJECT}/FieldWalker.uproject" -game

    For UE5.0

    sh "/{PATH_TO_ENGINE}/UE_5.0/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" -project=/{PATH_TO_PROJECT}/FieldWalker/FieldWalker.uproject -game
  2. Open FieldWalker.xcworkspace with XCode 12.5.1 (for UE4.27) / XCode 13.3 (for UE5.0).

  3. Specify the Diarkis server connection information as follows: (FieldWalker/Source/FieldWalker/Diarkis/DiarkisPluginBase.cpp)

    ADiarkisPluginBase::ADiarkisPluginBase()
    {
          // Diarkis server connection server address
         Host = "192.168.11.2:7000";
         // Host = "asia-northeast1.diarkis.io/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    
         // Diarkis server connection client key
         ClientKey = "";
         // ClientKey = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    
         // Diarkis server connection uid (specify different id for each user)
         UID = 1111;
     }
    • If a client key is not needed, specify clientKey = "".

    • If the user ID is uid = 0, a random ID will be assigned when starting.

  4. Build & Run:

Selected Viewport

  1. After starting UE4Editor, press the Play button on the toolbar.

    • Select Selected Viewport / Multiplayer Options, and set Number of Players: 1.

Screen Descriptions

  • Specifying Diarkis Server

    • HostName: Specify the URL of the Diarkis HTTP server.

    • ClientKey: If the Diarkis server has set a ClientKey, specify that Key. If not set, leave it blank.

    • UID: Specify a unique UID different from other clients. Note! If the same ID is specified as another client, synchronization will not work.

  • Specifying Synchronization Method

    • SyncMethod: Synchronization method (needed to join within 1 minute)

      • Field: Synchronization using the Field feature. The Field is divided by the number of Pods used (number of UDP/TCP servers).

        • By default, one Pod of UDP server is started, so one Map is divided into four Grids.

        • Moving across Grids will not send position information between characters in different Grids, resulting in them not being displayed.

    • Show Stat: Displays the frame rate, etc.

    • Fix FPS: Fixes the FPS.

    • FPS: Switches the fixed FPS to 30 FPS or 60 FPS.

InGame Screen

    • Grid Size Slider: Slider to change the Grid size

    • Server Count Slider: Number of connected UDP servers (this affects the number of Grids)

  • Application Controls

    W Key: Move Forward
    S Key: Move Backward
    A Key: Move Right
    D Key: Move Left
    Space Key: Jump
    Camera Operation: Mouse

Operation Verification (Multiplayer Options)

  1. After starting UE4Editor, press the Play button on the toolbar.

    • Select Play Standalone Game.

    • Select Number of Players: 2 to 4 in Multiplayer Options.

  2. Multiple Windows will be displayed and press the Start button of the game

    • Be careful not to have the same UID. If UID is the same, unintended behavior will occur.

    • Delays in character synchronization may occur depending on the specifications of the PC when increasing the number of Players.

Log Output

Log Output Section

  • Log files will be output to the following folder.

  • Output to folder under FieldWalker/logs/○○○○/ (OOOO is user ID)

  • Logs are output only during debug builds.

  • To output logs during Development Build, adjust to bOutputLog = true in the DiarkisInterfaceBase constructor.

  • You can switch the log output type to file output or debug output in the DiarkisInterfaceBase constructor using LogOutType.

Changing Log Levels

  • You can change the log output level in the LoggerFactory constructor.

  • You can set the log output level by feature (UDP, TCP, Socket, Room, P2P, MatchMaker, Runtime, etc.) in the client library.

  • The logs set in the Base class can specify the output level at Runtime.

     severities({
       { "TCP", DiarkisLoggerSeverity::Info },
       { "UDP", DiarkisLoggerSeverity::Warning },
       { "RUDP", DiarkisLoggerSeverity::Info },
       { "Socket-TCP", DiarkisLoggerSeverity::Info },
       { "Socket-UDP", DiarkisLoggerSeverity::Info },
       { "Field", DiarkisLoggerSeverity::Info },
       { "Scheduler", DiarkisLoggerSeverity::Info },
       { "P2P", DiarkisLoggerSeverity::Info },
       { "Room-TCP", DiarkisLoggerSeverity::Debug },
       { "Room-UDP", DiarkisLoggerSeverity::Debug },
       { "Group-TCP", DiarkisLoggerSeverity::Info },
       { "Group-UDP", DiarkisLoggerSeverity::Info },
       { "UDP-Stats", DiarkisLoggerSeverity::Info },
       { "Runtime", DiarkisLoggerSeverity::Debug }
     })
  • For example, if set to DiarkisLoggerSeverity::Warning, the following order will output logs below Warning.

       //! Log level: Verbose
       Verbose = 0,
       //! Log level: Debug information
       Debug,
       //! Log level: Information
       Info,
       //! Log level: Warning
       Warning,
       //! Log level: Error
       Error,
       //! Log level: Fatal error
       Fatal,
       //! Log level: None
       None

About Code

Main Code on FieldWalker Side (Sample Using Diarkis Plugin)

  • FieldWalker/Source/FieldWalker

    • FieldWalkerGameMode.h / FieldWalkerGameMode.cpp: Core class managing the game (AGameModeBase)

    • FieldWalkerCharacter.h / FieldWalkerCharacter.cpp: Class for your own character (ADiakisCharacter)

  • FieldWalker/Source/FieldWalker/Diarkis

    • DiarkisPluginBase.h / DiarkisPluginBase.cpp: Basic class using Diarkis Plugin

    • DiarkisPluginInterface.h / DiarkisPluginInterface.cpp: Interface class using Diarkis Plugin

    • DiarkisPluginSample.h / DiarkisPluginSample.cpp: Sample class using Diarkis Plugin

Main Code of Diarkis Plugin

About Client Code

  • Role Overview

    • Parent class of interfaces controlling Diarkis library

  • Location of Code

    • FieldWalker/Plugins/Diarkis/Source/Diarkis/Client

  • Classes

    • DiarkisInterfaceBase.h / DiarkisInterfaceBase.cpp: Interface class controlling Diarkis from UE4 (controls libDiarkis)

    • DiarkisRoomBase.h / DiarkisRoomBase.cpp: Parent class of Room function (controls libDiarkis)

    • DiarkisGroupBase.h / DiarkisGroupBase.cpp: Parent class of Group function (controls libDiarkis)

    • DiarkisFieldBase.h / DiarkisFieldBase.cpp: Parent class of Field function (controls libDiarkis)

    • DiarkisTcpBase.h / DiarkisTcpBase.cpp: Parent class of TCP function (controls libDiarkis)

    • DiarkisUdpBase.h / DiarkisUdpBase.cpp: Parent class of UDP function (controls libDiarkis)

    • DiarkisP2PBase.h / DiarkisP2PBase.cpp: Parent class of P2P function (controls libDiarkis)

    • DiarkisMatchMakerBase.h / DiarkisMatchMakerBase.cpp: Parent class of MatchMaker function (controls libDiarkis)

    • DiarkisRPCBase.h / DiarkisRPCBase.cpp: Parent class of RPC function (controls libDiarkis)

About Extension Code

  • Role Overview

    • Child class group of interfaces controlling Diarkis library

  • Location of Code

    • FieldWalker/Plugins/Diarkis/Source/Diarkis/Extension

  • Classes

    • Character (Class for synchronizing character data)

      • DiarkisCharacter.h / DiarkisCharacter.cpp: Class for Diarkis character synchronization

      • CharacterSyncData.h / CharacterSyncData.cpp: Class for serializing/deserializing character position data

      • CharacterMoveData.h / CharacterMoveData.cpp: Class for character position data. Initial position for synchronization

      • CharacterStateData.h / CharacterStateData.cpp: Class for character position data. Frame-to-frame differential information

    • Component (Component class for position synchronization in Diarkis)

      • DiarkisSyncComponent.h / DiarkisSyncComponent.cpp: Component class for position synchronization in Diarkis

      • DiarkisCharacterSyncComponent.h / DiarkisCharacterSyncComponent.cpp: Sample implementation of custom data send/receive component when creating actor class

    • Movement (Class for position synchronization in Diarkis)

      • DiarkisMovementController.h: Interface class for position synchronization component

      • DiarkisLocalMovementSync.h / DiarkisLocalMovementSync.cpp: Local position synchronization component class

      • DiarkisRemoteMovementSync.h / DiarkisRemoteMovementSync.cpp: Remote position synchronization component class

    • Diarkis/Utils (Utility classes)

      • DiarkisUtils.h / DiarkisUtils.cpp

    • Class derived from interface class controlling the library (XXXBase)

      • DiarkisInterface.h / DiarkisInterface.cpp

      • DiarkisRoom.h / DiarkisRoom.cpp: Class controlling Room functions

      • DiarkisGroup.h / DiarkisGroup.cpp: Class controlling Group functions

      • DiarkisField.h / DiarkisField.cpp: Class controlling Field functions

      • DiarkisTcp.h / DiarkisTcp.cpp: Class controlling TCP functions

      • DiarkisUdp.h / DiarkisUdp.cpp: Class controlling UDP functions

      • DiarkisP2P.h / DiarkisP2P.cpp: Class controlling P2P functions

      • DiarkisMatchMaker.h / DiarkisMatchMaker.cpp: Class controlling MatchMaker functions

      • DiarkisRPC.h / DiarkisRPC.cpp: Class controlling RPC functions

      • DiarkisSyncData.h / DiarkisSyncData.cpp: Class for processing Diarkis position synchronization

      • DiarkisReplication.h / DiarkisReplication.cpp: Class for variable replication using Room's Property

      • DiarkisActorManagement.h / DiarkisActorManagement.cpp: Class identifying Actor managed by Diarkis

About DiarkisNetwork Code

  • Role Overview

    • Interface classes of Diarkis Plugin

  • Location of Code

    • FieldWalker/Plugins/Diarkis/Source/Diarkis/DiarkisNetwork

  • Classes

    • Event/Interfaces ( Interface class receiving callbacks from Room functions of Diarkis Plugin )

      • DiarkisNetworkCoreEvent.h: Interface for Core events of Diarkis Plugin

      • DiarkisNetworkRoomEvent.h: Interface for Room events of Diarkis Plugin

      • DiarkisNetworkGroupEvent.h: Interface for Group events of Diarkis Plugin

      • DiarkisNetworkFieldEvent.h: Class receiving callbacks for Field functions of Diarkis Plugin

      • DiarkisNetworkP2PEvent.h: Interface for P2P events of Diarkis Plugin

      • DiarkisNetworkMatchMakerEvent.h: Interface for MatchMaker events of Diarkis Plugin

    • Event/Emitters ( Class queuing Room events of Diarkis )

      • DiarkisNetworkCoreEventEmitter.h / DiarkisNetworkCoreEventEmitter.cpp: Class queuing Core events of Diarkis

      • DiarkisNetworkEventEmitterBase.h / DiarkisNetworkEventEmitterBase.cpp: Base class generating various events

      • `Di

最終更新