User Errors With GUI Layers Can Make The Game Crash (SOLVED)

I have noticed that there are three different things that can happen if a layer is missing:

  1. If a layer doesn’t exists in a gui-scene that is within a collection you will not be able to build and get a “Problems” entry.

  2. If a gui-scene is missing layers from it’s templates AND have no regular node in the scene, and this gui-scene are within collection, you will not be able to create the collection and the game will crash.

  3. If a gui-scene is missing layers from its templates AND have a regular node in the scene, and this gui-scene are within a collection, you will get a error message but no crash.

I draw a picture to try to help you understand what I mean.

What happens in the second setup feels like a bug and also makes me a little hesitant to add layers to the game.

Is this the expected behaviour?

Thanks for the report. The second case do seem like a bug. It seems that we might need to check the error handling in the other cases.

The second setup is definitely a bug, the engine should never crash.
Will report a bug and it will be taken care of asap.
The expected behaviour is at the very least that of case #3, i.e. an error message.

I will bring up the question to whether it should give an error message or silently mute the layout since it doesn’t exist in the main scene (that is, it will behave as if there weren’t any layer set).

1 Like

I think a warning if a layer is missing is better than no message at all. If you care about optimising draw calls it’s helpful to know if you’ve forgotten to set a layer in the gui in which you’re using a template.

1 Like

We have filed a bug report on this. The game should not crash.
The expected behaviour is that of pt. 3, a warning message but no crash. The engine should treat the node as if it has no layer set (in the case of missing layer)