When and how to avoid using nodes for everything
Godot provides more lightweight objects for creating APIs which nodes use. Be sure to keep these in mind as options when designing how you wish to build your project’s features.
Object: The ultimate lightweight object, the original Object must use manual memory management. With that said, it isn’t too difficult to create one’s own custom data structures, even node structures, that are also lighter than the class.
Example: See the Tree node. It supports a high level of customization for a table of content with an arbitrary number of rows and columns. The data that it uses to generate its visualization though is actually a tree of Objects.
Note
One should be careful when handling them. One can store an Object into a variable, but these references can become invalid without warning. For example, if the object’s creator decides to delete it out of nowhere, this would trigger an error state when one next accesses it.
Reference: Only a little more complex than Object. They track references to themselves, only deleting loaded memory when no further references to themselves exist. These are useful in the majority of cases where one needs data in a custom class.
: Only slightly more complex than Reference. They have the innate ability to serialize/deserialize (i.e. save and load) their object properties to/from Godot resource files.
Example: Scripts, PackedScene (for scene files), and other types like each of the AudioEffect classes. Each of these can be save and loaded, therefore they extend from Resource.