NOTE: I moved this post mortem/comparison here from the released game list to encourage discussion and feedback without cluttering the original thread (@britzl) .
“Scrivere con le sillabe” is a game to help children learning how to write in Italian. It shows a picture of a word, for example CASA (house in italian) and the user has to tap the syllables CA and SA choosing them among other wrong syllables. Then it starts again with a new word, and so on.
When I chose Defold for this project I did so for the following reasons:
Young but fast evolving game engine.
Focused on 2d.
Concise documentation.
Very nice looking website and forum.
Beginner friendly.
Completing the project with Defold was a pleasant exaperience, and when I had problems the forum was always helpful (thanks britzl in particular!). It has more than 1000 downloads on Play Store, not so bad for a niche game.
After completing this project I decided to give Unity a try, so I made a very similar game “Scrivere con le sillabe 2”, and another non yet published project. At that point I felt more confident with Unity so I decided to spend a few hours to rewrite also “Scrivere con le sillabe”, to better support future updates and improvements.
This is a list of things that I did’t like about Defold during this project:
Intellisense.
In Unity I create an instance of a prefab and assign it to a variable, then Visual Studio Intellisense tells me what methods and properties I can call. Most of the times I don’t even need to look the documentation, because it’s clear what a method or property is for.
Creating instances and communicating with them.
In Unity I create an instance of a prefab and then I call methods or I access properties very easily. In Defold, I need a factory, ask the factory to instance an object, then send it a message, then in that other object I need a handler that receives the message and do something appropriate. The Defold way leads to better programs? I am not convinced, to me it’s a longer process to do the same things.
Readability
This is an example of a piece of code that I hate in my Defold program:
local url = msg.url(“imgparola#sprite”)
msg.post(url, “play_animation”, {id = hash(parola)})
I have a lot of these couples of lines everywhere, they all begin with “local url = msg.url(…” and “msg.post(url…”, but in reality they do very different things. Not only they were harder to write, they are harder to read too.
Script properties can’t be strings, you need to hash them
Why? I come from the early days of C64, when a variable could be a number or a string, and nothing else. I don’t really like to see strings treated as second class citizens.
Click handling
In Unity I simply use OnMouseDown() only where I need it. In Defold input handling is a mess, since all objects receive a click and then it’s their responsability to determine if it was directed to them checking mouse or touch coordinates. I ended up using the module goput.lua (from britzl, if I remember correctly).
Lua
I have previous experience with C#, and I find Lua to be a very limited language. For example in Lua you have only tables as data structures, so in my mind I think at what data structure I would use in C# and then google for a way to implement it with Lua tables.
OOP
If I really had to use Lua, I prefer the approach of Gideros that gives a ready made OOP-like infrastructure.
Debug
I like Visual Studio debugging a lot more than using ZeroBrane
Sound
In Unity I change the mp3 or wav associated to a sound object with a line of code, in Defold I had to create a different sound object for every sound I needed, it was a big waste of time.