Set Up the Unreal SDK #

Create a new project (optional) #

Create a new project
  1. Launch Unreal Engine from the Epic Games Launcher.

  2. From the Select or Create New Project window in the Unreal Project Browser, choose Games and click Next.

  3. For the Select Template step, choose Blank and click Next.

  4. For the Project Settings step, choose C++. Name the project PragmaIntegration, then click Create Project.

Set up PragmaSDK for Unreal #

  1. Create a Plugins folder in the root of your Unreal project.

  2. Copy the update-pragma-sdk.sh file from pragma-engine/sdk/unreal4/ to the Plugins folder you just created.

  3. Modify the copied update-pragma-sdk.sh script as follows:

  • Uncomment SOURCE_ENGINE_RELATIVE_FOLDER and change the value to point to your pragma-engine repo.

  • Uncomment TARGET_PRAGMA_SDK_DIR and change the value to PragmaSDK. This creates a PragmaSDK folder under the current directory (Plugins).

  1. Run update-pragma-sdk.sh in Git Bash from the directory where you copied the script. Confirm that the PragmaSDK folder now exists in your Plugins directory.

Update PragmaSDK for Unreal #

Whenever you make changes to Pragma Engine or update the code, you’ll want to update the PragmaSDK Unreal plugin folder. Re-run the update script command from your Unreal Plugins directory:

update-pragma-sdk.sh

Configure the Pragma SDK #

  1. From your Unreal project base folder, open Source/[UNREAL_PROJECT]/[UNREAL_PROJECT].Build.cs and add PragmaSDK and PragmaSDKAux to the PublicDependencyModuleNames array:

    PublicDependencyModuleNames.AddRange(new string[] { ..., "PragmaSDK", "PragmaSDKAux" });
    
  2. From your Unreal project base folder, open Config/DefaultGame.ini and add the following configuration information to the bottom. For example, this config points to the Player Game Backend.

[/Script/PragmaSDK.PragmaSdkConfig]
BackendAddress="http://127.0.0.1:10000"
GameClientVersion="DefaultGameClientVersion"

(Optional) Add the following to Config/DefaultEngine.ini to enable logs for every inbound and outbound RPC with payloads.

[Core.Log]
LogPragma=Verbose