Summary
Highlights
The first bad habit is getting parent nodes or nodes with a reverse path, which can cause crashes and make debugging difficult. Instead, use an exported variable to assign references in the editor, making the code more modular and less prone to errors when reorganizing the scene tree.
Accessing nodes every single frame using the '$' sign is inefficient, especially when updating properties frequently. A better approach is to store a reference to the node with an 'onready' variable at the start of the game, reducing repeated 'get_node' calls.
Over-optimizing systems from the beginning, especially for features not yet certain to be in the final game, is a common pitfall. The advice is to get features working first, as long as the code remains modular, and only optimize when performance becomes a real issue. Finishing a playable game is more important than perfect optimization of a single component.
Simply watching Godot tutorials without actively engaging or enhancing them can hinder learning. Viewers are encouraged to add new features or modify tutorial projects to solidify their understanding. If unable to enhance, re-watching or referring to Godot documentation is recommended.
Neglecting popular game programming patterns like state machines is a significant mistake. Developers, especially beginners, should set aside time to learn these fundamental patterns, as they are crucial for robust game development. The 'Game Programming Patterns' book is suggested as an excellent resource.
Not using static typing in GDScript is a bad habit addressed. Static typing helps Godot understand variable and function types, leading to cleaner code, compile-time error detection, and improved autocompletion. Developers are encouraged to explicitly type their variables, arguments, and return values.
Using direct file paths for scenes and resources can break code if files are renamed or moved. The suggestion is to use Unique Identifiers (UIDs) obtained by copying them from the file system. UIDs ensure that Godot can always locate resources, even after file system changes.
A crucial habit that many developers neglect is not using version control. Version control systems like Git (with platforms like GitHub or GitLab) store every version of a game, providing essential backups and saving immense stress if data is lost or corrupted. Setting it up is free and highly recommended.