Fill DDC for all maps inside of a project for multiple platforms

Finally was able to figure this out without my old hack

Fri, 08 Sep 2023

I’m finally happy to share that I was finally able to figure out how to fill my projects DDC(Derived Data Cache) without using my old hacky method. What I primarily like about this method is that its straightforward. My workstation is higher end, my computer usually builds the shaders rather than pull them from my local NAS since its faster so I don’t build the DDC for my entire project.

That being said, my build agent is nowhere near as fast. Having a primed DDC reduces build times by about 7ish minutes atm and I currently just have a few UAssets inside of the Third Person Template project. I prime(cook) all of my projects maps to decrease build times.

The old method I was using was to just build the project. While building the project the build process will look for the cooked content in the DDC. If that content is not there it will compile it and add it to the DDC whether it would be local or shared

ue4 package Shipping

The downside of this method is that it will only fill the DDC with the content from maps that you set in your maps to package config as well as you will have to run a full build for each platform

I had to dive in some of the C++ code of the engine since this isn’t documented. I found that the default DerivedDataCache command has a switch to build content for just your project as well as just the maps

ue4 run -run=DerivedDataCache -fill -mapsonly -projectonly -targetplatform="Windows,WindowsClient,LinuxServer" -nullrhi

What the above command does is run the DDC commandlet to fill the DDC with all the content from my maps that are found in my projects Content directory for the Windows(standalone game), WindowsClient(game build meant to be used with a server) and LinuxServer platforms. The ultimate goal being that when I build any of those targets, I should never have to wait for content to cook unless it was just checked in (I build my DDC every Mon and Thurs)

Lets break it down

  • ue4 run: Same as running UnrealEditor.exe ProjectName
  • -run=DerivedDataCache: Command to work with the DDC in the cli
  • fill: loads content to put in the ddc
  • mapsonly: Only fill the DDC with content from the maps
  • projectonly: Only fill the DDC with content from the project
  • targetplatform: Platforms to load content for
  • nullrhi: prevent the editor splash screen from showing while the command is running. If you use UnrealEditor-cmd.exe instead of UnrealEditor.exe you can omit this
Buy Me A CoffeeDigitalOcean Referral Badge
Loading...
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge