Hi everyone,
let me start by thanking the devs and the community for being so helpful (this is my first post but I used the forum to get some answers before ).
I’ve got a couple of questions regarding best practices for laying a decent game architecture.
At it’s core Defold works with the messaging system and that is made clear in the example projects.
Let’s take the “Roids” sample game. Scriptwise almost every communication between objects is made with messages, sometimes the message is even sent to the same script to handle simple tasks like disabling the GO itself.
Now, for a game prototype I’m working on I was using modules to handle shared data and functionality (game manager, inventory, language manger for localization, etc).
What do you say is the best approach? Relying on messages for almost everything or using Modules to handle game logic? I get that every approach has it’s pros and cons (modules cannot hot reload for example) and I also get that the Roids game being an example may be using messages for everything so that the messaging pattern is well explained to new users.
Let’s take an inventory system for example:
a) I could have a stateful module handle the data, require it where I need it and access it’s functions (say calling an addToInventory() for example)
b) Have an inventory GO with a script and send a message to do the same.
Can we discuss a little on what’s best and why? (even tho I’m expecting a lot of “it depend” and “both equally works” hehe)
Thanks a lot.
PS: I, like many others, wish for strings to be passed as properties. Just to display the name of an item it’s being a pain