Components deleted from actor in Standalone/Packaged Game

My game works just fine in PIE or New Editor Window mode, however I tried it for the first time in Standalone mode today and several components are missing from some of my actors.

I use Text Renders on my units (this is a top-down tactical game) to display some info like their name, etc, as well as a UMG widget component as health bar.

I also use boxes and capsules on my units to detect overlaps with the tiles on the ground, and mouseover events.

All of these components appear to get deleted when I boot the game in Standalone Game mode. The only thing that remains is the mesh.

  • My actors are spawned by my level blueprint on Begin Play
  • I have made sure my default GameMode, GameState, etc are set in both World Settings and Project Settings
  • All of the components on my unit are changed in some way by variables on the unit, but I have tried adding a new text render component that does not get changed and it was still getting destroyed in Standalone.
  • I tried reproducing this by adding a component to the Top-Down Template character in a new project and the component showed up correctly.

One thing I have noticed while trying to figure this out (by getting the Display Name of all my components and printing them on screen) is that there’s a difference between units spawned via blueprint, and units that were placed in the map directly:

This is from Play in New Editor Window. You can see that both the Scout (placed manually) and the Grunt (spawned by the level blueprint) have all their components.

25451-pie.png

However, in Standalone Game, the Scout’s components show ‘TRASH’ in their name, and the Grunt has lost all its components. Visually, all the components are gone from both units.

25452-standalone.png

What could be causing this?

Well after a lot of debugging, the answer was fairly simple once I took a better look at the logs.

It seems that Play In Editor will let a lot of errors go through, that Standalone will not. There was a problem in one blueprint that I don’t really use but that my Unit blueprint had an unused reference to. PIE did not seem to care about this reference and would compile the Unit BP anyway, but Standalone would fail to compile the Unit BP because of the error and so it wasn’t so much that my components were getting deleted, but that the BP wasn’t even being compiled at all.

I’ve seen a lot of this behavior and I really wish that PIE would treat the errors the same way as Standalone. Gets very annoying after a while, it has come to the point that when I plan to add something (especially when I’m doing paid work), I plan for an extra day to sort the PIE-Standalone differences. Upvoted.