Skip to content

Idea: Warning developer of invalid component state #515

@droqen

Description

@droqen

Example situation: the local_to_parent component fails to perform its function when certain conditions are not met. (Hierarchy must be set up correctly, parent must have local_to_world component.)

Currently, there is no feedback to the developer about this.

As one suggestion, we could work towards something like what Godot has, which I'll show below:

image
fig. 1

In figure 1, CharacterBody2D_a is set up correctly, while CharacterBody2D_b is not.

Clicking on the small /!\ icon displays a popup:

image
fig. 2

Figure 2 shows the popup message: it indicates what's causing the problem, what the consequences of the problem are, and suggests a way to fix it. If the developer runs the program anyway, there are no further error messages or warnings.

We don't currently have a graphical UI for editing nodes, so my initial proposal is this:

  1. Some kind of common system for each component to detect and report any invalid state which causes it not to function (e.g. a local_to_parent child that is missing a parent, or its parent does not have the local_to_world component)

  2. When running in non-debugger mode, print this warning to console and suggest the game be run in --debugger mode to examine these errors/warnings better.

  3. In --debugger mode, show something similar to the Godot /!\ icon next to every component that is reporting invalid state.

Related to #480

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions