Download

[4.25.2] Packaged project Call Order is different than in editor?

I have added logs to the constructors, begin plays, and various other startup/setup functions and events in my project’s game instance, entry level blueprint, game mode, and player controller. Ive done this because it is important to know when certain things are called so I know when and where to set certain variables, and when I can use those variables and expect properly set values.

In the editor, the log shows the call order as follows:


[Logging]
0=" Game Instance Constructor BEGIN"
1=" "
2=" Game Instance Constructor END"
3=" "
4=" Game Instance BP Init Event"
5=" Playercontroller SetupInputComponent()"
6=" GameMode BeginPlay()"     <-----------------------------------------------------------------------------------
7=" Map Level BP BeginPlay Event"
8=" Playercontroller BeginPlay()"
9=" Game Instance DoGameStartup()"
10=" Game Instance -Initialize Startup Config Options"
11=" Game Instance -Start ApplyGraphicsOptions()"
12=" Game Instance -ApplyGraphicsOptions() > Fullscreen - Resolution: w - 1176x1176"
13=" Game Instance BP Init Game Audio Event"
14=" Game Instance -Apply Startup Config Options"

The shipped project log, shows the call order as follows:


[Logging]
0=" Game Instance Constructor BEGIN"
1=" "
2=" Game Instance Constructor END"
3=" "
4=" Game Instance BP Init Event"
5=" Playercontroller SetupInputComponent()"
6=" Map Level BP BeginPlay Event"
7=" Playercontroller BeginPlay()"
8=" Game Instance DoGameStartup()"
9=" Game Instance -Initialize Startup Config Options"
10=" Game Instance -Start ApplyGraphicsOptions()"
11=" Game Instance -Apply Startup Config Options"
12=" GameMode BeginPlay()"     <-----------------------------------------------------------------------------------


As you can see GameMode BeginPlay() is being call WAY late in the shipped package.

The reason for the other two missing entries, are known. The instance’s Playercontroller variable is set in Gamemode and those two entries are behind a if (Playercontroller) filter. I can likely easily fix the missing entries by having the player controller set the instance’s variable, but that would not explain why GameMode’s BeginPlay() moved and it makes me nervous about creating a reliable call order at all.

Why is GameMode in the shipped package called differently than in the editor??

EDIT:
Game Instance -ApplyGraphicsOptions() > Fullscreen - Resolution: w - 1176x1176
the log of resolution is displaying the width value twice. A typo on my part

This is weird.
BTW Similar topic created week ago: https://forums.unrealengine.com/deve…ged-executable

Ah. Thank you. I tried searching for previous topics, but I guess my search terms were not accurate.
After matching my search to the topic you posted, I found many other posts, as well as this AnswerHUB question:
https://answers.unrealengine.com/que…-begin-pl.html

Thank you for the heads up.