How to package and branch for different distributors and demos?

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