What is the loadorder of objects?

Hi,

i try to figure out what the loadorder is in a level and/or gamemode?

For example:

I have 3 Actors in a level and they add an entry in an array. Which is the first who will be loaded.

For example:

Game Mode has Pawn/HUD/Player Controller, etc.
How is the loadorder of all Assets that are in the specific Game Mode?

AND: What will be loaded first? Game Mode or Level Objects?

Thanks in advance :smiley:

Anybody who wants to know it, i have found out by myself.

  1. Game Mode: Player Controller > Pawn > HUD > Game State > Player State > Spectator Pawn (when loaded)
  2. Unfortunately: Objects that are placed in the Level will be loaded in the order of when they were created. For example: You create 3 actors and name them o1,o2,o3, they will be loaded in that order. But when you rename for example o1 to o4, the load order is o4,o2,o3.
  3. Game Mode will be loaded before any object of the level

Old post, but I want to share my fresh findings.
I played around with it in our project (for 2 players multiplayer).
Printing class names right after Event BeginPlay for classes resulted in [this.][1]
The bottom one is printed first. It is PlayerController object for 1st player (which is also listen server), then GameMode instance is created on server. Then another PlayerController is created for the 2nd player (remote machine).

Anyway, just wanted share in case anyone stumbles upon this and get confused. Because I know I did :slight_smile:

86065-beginplayorder.png

Game Mode: Player Controller > Pawn > HUD > Game State > Player State > Spectator Pawn (when loaded)

^ these are not loaded. They are spawned.

The load order is NON-deterministic. Which means the order you posted WILL change with every compile, every cook, etc. There is NO guarantee that any order will be maintained.

Begin play, end play, and ticks, are also in a NON-deterministic order.

You can print stuff all day long, and you only prove that that was the order the stuff was printed in, IE the order in which they were ticked in. Not loaded, not created, or anything else. If you let it tick long enough, you will see that that order can change from 1 tick to the next. Its meaningless.

THERE IS NO ORDER.