Developer Notes

In 4.22, we now periodically compact the Object Hashes in packaged builds to save on memory. In the editor, the Actor Iterator uses the levels list which is quite stable, but in a cooked build i uses the object hashes which is very unstable. After discussing this, we have determined that this is working as designed, and BeginPlay order should not be assumed to be stable.

Description

Using Game Mode instead of Game Mode Base causes the Begin Play event to trigger in a different order. This is shown in the reproduction with the Begin Play of the Player Controller and the Game Mode. When using Game Mode Base, the Game Mode Base's Begin Play is fired first. When using Game Mode, the Player Controller's Begin Play is fired first.

Regression?: Yes
This did not occur in 4.21
This was tested in and does occur in 4.22, 4.22.1, and Dev-Main CL#6105541

Steps to Reproduce
  1. Download the attached project and open it
  2. Press Play and notice that the name of the Player Start after travel is printed twice
  3. Package the project for Win64
  4. Open the packaged game
    Result: After the travel, the Player Start name is "None" for the first (bottom) print string, meaning the Player Controller's Begin Play triggered before the Game Mode's
    Expected: The Player Start name is printed twice after the travel.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-73371 in the post.

2
Login to Vote

Non-Issue
ComponentUE - Gameplay - Blueprint
Affects Versions4.224.23
CreatedApr 26, 2019
ResolvedApr 26, 2019
UpdatedApr 30, 2019