Hey everyone! Here I am again, bothering you all with my Defold learning journey! ![]()
After getting a better understanding of how variables work in Defold, I decided to dig a little deeper into the engine. So far, I’ve come to believe that the biggest hurdle to overcome isn’t the coding itself or the component system, but rather the engine’s overall workflow and logic, which are quite different from those of other engines I’ve used in the past.
One thing that has puzzled me the most is the messaging system. I often see people praising it as one of Defold’s greatest strengths, and while I can certainly see how powerful and flexible it is, I can’t help wondering whether relying heavily on messages could become difficult to manage once a project grows beyond the scope of a tutorial or a game jam.
As a project gets bigger, I imagine that keeping track of all the messages flying around could eventually become quite a challenge.
This got me thinking about how to structure a Defold project in a way that remains manageable as it grows. My current theory is that, rather than relying too heavily on messages, it might make more sense to move most of the game’s logic into dedicated Lua modules, each responsible for a specific purpose and accessible to whichever scripts need them.
In other words, I’m imagining a structure along these lines:
-
Small scripts attached to individual game objects, handling their specific behaviour.
-
Messages for simple, localized interactions between game objects.
-
Modules for shared logic and systems that need to be accessed from multiple places.
The idea would be to keep game object scripts relatively small and focused, with most of the more complex logic living in dedicated modules rather than being spread across numerous scripts communicating through messages.
Is this a common approach when working with Defold, or am I misunderstanding something about how the engine is intended to be used?
I’d love to hear how more experienced Defold developers approach this, especially when working on larger projects.
Thanks a bunch! ![]()