How to package and branch for different distributors and demos?

Hi there,

are there any proven and scalable ways to manage different builds (e.g. for distributors STEAM, GOG, EGS)?

In Unity we had a small editor script which added and removed Scripting Defines which we could use in code e.g.

if STEAM

Steam Specific code

elif GOG

GOG specific code

endif

and then we triggered a build for the selected configuration with one line of code.

Same question for demos. We had #if DEMO checks here and there, maybe excluded some maps. I haven’t found something like scripting define project settings in Unreal?

My goal is to be able to click Platforms → Windows → Package Steam, Package GOG etc… Is this easily possible? Is there a better known workflow for these kind of things?

Thanks!

I finally found a good and clean solution:

  1. Create YourGameDemo.Target.cs (besides YourGame.Target.cs). It should inherit from YourGame.Target.cs

  2. Add to the constructor of YourGameDemo.Target.cs
    bOverrideBuildEnvironment = true; GlobalDefinitions.Add("DEMO_BUILD=1");

  3. Write a IsDemo Function in a blueprint library, so you can check for demo everywhere.

	static bool IsDemo()
	{
#ifdef DEMO_BUILD
		return true;
#else
		return false;
#endif
	}
  1. Use IsDemo checks where you need (show demo banner, lock specific full game functions etc.)

Can be used for other builds to (e.g. EGS build, GOG build and whatnot)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.