Bearbeiten

Freigeben über


Connect to Unreal Cloud DDC from Visual Studio

Important

The Unreal Cloud Derived Data Cache (DDC) offering has been removed from the Azure Marketplace. As such, we're retiring this documentation on March 31, 2024. Until then, this documentation exists for reference only, with no official support available from Microsoft.

Please contact your Epic Games representative for more information about using Unreal Cloud DDC.

Prerequisites

Software requirements for your device when connecting to Unreal DDC:

Tip

You can also use a Game Developer VM which comes with the above prerequisites installed.

Install the latest version of Unreal Editor

  1. Open PowerShell
  2. Run the following example script
git clone -b ue5-main https://github.com/EpicGames/UnrealEngine
cd .\UnrealEngine\
git checkout b5ce34c6e62294b6de6d3c5f35be0164a75cb3ba

.\Setup.bat
.\GenerateProjectFiles.bat

Create a new Project

We highly recommend creating a new sample game if it's your first time using it. Skip to the next section if you have an existing game project and want to use it.

  1. Open the Unreal Editor solution (.sln file) in Visual Studio 2022
  2. Set the desired game project as the startup project
  3. Build
  4. Start debugging (F5)
  5. Wait for the Unreal Editor to open
  6. Create a new sample C++ game
  7. Open that project in Visual Studio

Connect and use Unreal Cloud DDC

Edit DefaultEngine.ini

  • Go to your Unreal game project's DefaultEngine.ini file and add a section using the information below. This is the game project you built in Step 3 above.
  • Replace hostname with your hostname used during deployment, and set unique-namespace-for-project.
[ConsoleVariables]
DDC.Http.EnableOidc=1

[HordeDDC]
Root=(Type=KeyLength, Length=120, Inner=AsyncPut)
AsyncPut=(Type=AsyncPut, Inner=Hierarchy)
Hierarchy=(Type=Hierarchical, Inner=Local, Inner=Shared)
Local=(Type=FileSystem, PurgeTransient=true, UnusedFileAge=34, PromptIfMissing=true, Path=%ENGINEDIR%DerivedDataCache, EnvPathOverride=UE-LocalDataCachePath, EditorOverrideSetting=LocalDerivedDataCache)
Shared=(Type=Http, Host="https://<hostname>", ResolveHostCanonicalName=false, EnvHostOverride="UE-CloudDataCacheHost", CommandLineHostOverride=CloudDataCacheHost, Namespace="jupiter", StructuredNamespace="<unique-namespace-for-project>", OAuthProviderIdentifier="HordeStorage", ReadOnly=false)

Add a new json file

  • Add a new Programs/OidcToken/oidc-configuration.json file under the game project root folder with the information below.
  • Substitute your values for tenant-id, client-id, client-name, and app-uri.
{
    "OidcToken": {
        "Providers": {
            "HordeStorage": {
                // The /v2.0 at the end is important!
                "ServerUri": "https://login.microsoftonline.com/<tenant-id>/v2.0",
                // Client App Registration
                "ClientId": "<client-id>",
                "DisplayName": "<client-name>",
                // Port 6543 is chosen arbitrarily.
                "RedirectUri": "http://localhost:6543/callback",
                // The custom scope is from app registration whose scope is requested by the client app.
                "Scopes": "api://<app-uri>/Horde.ReadWrite openid profile offline_access"
            }
        }
    }
}

Modify Visual Studio property

In Visual Studio, for the startup project, an additional property must be set.

  • Go to Visual Studio
  • Under debug properties and add -ddc=HordeDDC at the end of the command line and then start debugging.
  • You may also use -DDC-Local-MissRate=10 for testing which will force a percentage of cache misses and generate traffic to the deployment.

See also