How do I package a demo while maintaining the full build?

Hi devs,

I have a full game and want to make a demo build. This demo needs a subset of the original assets to save disk space and a modified front-end menu which launches a custom map only.

In the past, to create demos, I’ve created a boolean (IsDemo) in one of my classes and checked it on when I packaged the build. But I have to remember to turn that checkbox back off when I export a full build, and the demo build contained every asset of the full build so it’s file-size was bloated. This is not a good solution.

What do I set so that I can export a full build or a demo build at any time? And is it possible for the demo build to
reference different levels and, as a result, package fewer assets?

Thanks
Stu

So, not sure if this is a real answer to your question or not, however this is the second game I am working on that I wanted to do a demo build separate from full game package.

In the first game I just created a separate branch in my source control (Perforce in this case, but applies to anything else)

  • I would just merge in any gameplay updates needed, but the packaging settings were the same (DefaultGame.ini specifically), and whatever was specific to demo (so demo bool).

In this second game ( https://www.indiedb.com/games/neko-ghost-jump), I didn’t want to maintain separate branches unless I absolutely had to, still using Perforce.

Here are the options I came up with:

  1. Having a separate DefaultGame.ini file just for demo (that only has the maps to cook)
  2. Quickly just deleting the deleting the map list in editor or .ini and reverting after demo is built
  3. Doing the demo branch (which honestly, I don’t want to remember to maintain, and the only thing that would ever pertinent/constant diff between the two would be the map list)

I am currently choosing option 2 , I can simply delete out the maps (which btw, I use Cook Only Maps option), and only the maps that I need will ever get packaged out (demo or full)


In either case, source control is really the hero here.

I have the same goal and also do not want to make a full branch just because I have exactly one file with one Property (“isDemo”) which differs in branches. Did you ever found a way to pass “something” to the build-process so it is knowing if “IsDemo” (e.g. in GameInstance) is true or false?

I read the answer of VictorBurgos, but I also do not like the idea of editing files and set back every time. If someone knows a solution would be cool .

thanks a lot

Still looking for something to control a variable with Build parameter. Same as the default build target option: You can set default build target to “test”, “developement” or something else and can check in your code what build target it is. This I need for a custom variable like “IsDemo”, which should be set at command line build&cook parameters.
Any solution for this?

In the Project Settings you can add the maps you want for the build. So you can change it from the full game maps to the demo maps if you have your game set up that way. I believe only the assets referenced in the included maps gets put in the build.

The “Lists of Maps to Include in a Packaged Build” option is in Project Settings - Packaging - Packaging - (Click Show Advanced Drop down) There is an array that you add the maps to.

Four years later I’ve found an acceptable solution: you can package a function library in a separate pak chunk and then access a function from it and determine by the outcome if the chunk file is present or not.
If the pak file is missing, such call will just silently fail.

You can set an isDemo variable by a function included in a separate pak chunk and then just don’t include that pak file for the demo and it will remain in its default state