Assets load differently, in surprising ways. Materials may work fine in Editor but not in Client.
Code executes differently. Timings are different, the Editor shares managed Heap with the Client, and so garbage collection is different.
And so on.
Rule 0 with Unity: _do not rely on the Editor for testing_.
I agree that you can't easily use editor performance profiles though; there's far too much editor noise.
Unity is still crap at loading things in order but you simply have to make peace with that. Instead you have to write a bit more defensively and assume that your code will get initialized in a random order. As long as you use Unity serialization all the references will be set when the lifecycle callbacks fire.
You can - Use coroutine Starts to wait for initialization
- Ensure all the inits are done in Awake so things are ready during Start
- You can also move away form initialization towards a more lazy pattern and make sure any calls into your behavior are asynchronous and include self init when needed.
It is a bit clunky but you can get used to it. Lean into the idea of behaviors being asynchronous actors and it makes a bit more sense.
All coroutines on a gameobject are halted if it is disabled, _and do not restart_ when it is re-enabled.
For this reason it is easy to mistakenly leave a game object half-initialized, due to an enormous amount of plausible situations where some event, script or other may disable the game object.
Now, there is a work-around: have Start yield a coroutine started on a "safe" object that will never disable.
The caveat is that the caller can be destroyed during execution of the coroutine but the coroutine will persist to execute because it is on another object.
The only lifecycle a behavior can trust is its own. Relying on other objects turns into a mess when your weak assumptions are violated.
Besides causing a spaghetti mess of lifecycle tracking and callbacks and such, it leaves you wide open to the major problem if callbacks running pass the life of the thing to call back to. You've thrown away Unity's lifecycle tools by dumping everything into a big pot. Now you have to null-check in the callbacks to make sure your things are still alive. Track your own state and you'll be fine.
Coroutines will stop when the owner dies and that is by design. Leverage that to ensure brain dead clean up.
Objects are very often going to be disabled through user action anyway, eg quitting a level. Its better to just assume that will happen at any time and plan accordingly.
I think with time/experience you'll learn to spot what to ignore (frame lengths, etc) and what you could count on. And just to test fully-build games often, and across clients.
* C# does something similar with hash across builds (so you don't depend on serializing/deserializing hashes and expect them to work; they want the freedom to change hash functions).
Unless you plan on developing an open source game or need absolute total control over your project I wouldn't use Godot.
The greatest advantage of Unity is anyone can develop something for it very fast. The worst part of Unity is anyone can develop something for it very fast. An asset developer might build something which he or she doesn't actually update, or has a nasty habit of completely breaking your project.
The one thing I don't like about Unity is the lack of quality control with assets. Some assets will give you a nice foundation for a fantastic project, others will set you back days. Asset authors are almost always either absolute Angels, who will go out of their way to help you and if they can't offer you a refund.
Or their jerks, their assets don't do what they promised and they'll refuse to refund your money. If I could fix one thing about the unity ecosystem, I'd tell Unity to give asset buyers a few no contest refunds . I probably spend about 1000$ on Unity assets per year.
The one time a $15 asset ends up not working correctly I should be able to get a refund without begging the author for it.
Plus it's essential to understand what your goal is. Do you want to actually ship your game within a reasonable amount of time? Or do you feel like creating a project primarily for learning, or to just share the code on GitHub?
If you want to ship a game, either use Unity or Unreal. These are the only two engines which are well supported enough where you can get something done within a reasonable amount of time.
Open source engines are cool, but there is absolutely no expectation of things working as well. Let's say you want to build a project with Godot, and it's going well so you want to publish it to Switch. You're going to run into a ton of problems off the bat, one open source projects tend to not support closed apis which council manufacturers force you to support. So you're going to have to build your own integration there.
Vs clicking a build to Switch button with Unity.
Honestly I can't say enough good things about Unity, you have an amazing amount of educational material they publish. And for the most part I've been able to buy assets for $50 or $100, and save myself 80% of the development time on my projects. You aren't going to have a good time with Unity if you're adverse to buying assets.
So you're saying we're Waiting for Godot?
Very surprising. ;-)
What important features is Godot missing that Unity has?
When I played with Godot (two years ago, a lot has been improved since), it was definitely a bit raw. It worked, but I found it a bit of a struggle. I’ve been reading their release notes since and they’ve improved a lot, but I haven’t actually tried it out yet.
The one thing I personally don’t like about Unity is how much emphasis is put on C#, I just never got into the language and have no desire to use it. Godot is a bit nicer for me in that respect. I prefer Unity’s ECS and job system over Godot’s scene system though, but lots of people say the opposite.
I don't see anything so far to back up the claim that Godot isn't finished, which would mean it's not suitable for anything except for experimentation. Seems like it's at least fine for smaller games.
Here's a summary: https://www.reddit.com/r/godot/comments/axsohk/in_your_opini...
Missing occlusion culling is on the top of list.
The latest reference (from 9 months ago, so not much more recent) I could find for occlusion culling[0] says it and LOD are planned for the Vulkan branch, so those are still issues.
[0]https://old.reddit.com/r/godot/comments/emachb/how_long_unti...
Especially for a software engineer, there's of course always the fantasy of coding everything on your own. I might not get a platformer system because that seems "fun" to implement, but shaders often feel so beyond me that I'd just rather get someone's optimized shader.
That's basically a 2D / 2.5d game framework.
Nothing from the Asset Store is essential, but it would take much longer to do everything yourself from scratch, as well as being difficult to learn how to do everything yourself without examples to experiment with.
> The Corgi Engine is recommended by Unity as part of its 2D Essentials Pack.
Maybe I read too much into it.
It's simply nowhere near as polished as Unity or Unreal. If you want to make something in Unity, you can pay a few hundred dollars for some assets, snap them together like Legos , add your own character models and be ready to ship in months.
In Godot, it's rare at all to see any paid assets. Meaning instead of being able to buy a starter kit and get my project done, I'm coding all this stuff by myself.
It's easy to get started, iterate on ideas, there are tons of examples of things online.
That said, it's not without its warts -- APIs change constantly, which means many of the examples or assets you find are no longer functional or need to poking to get working. Sometimes things just... behave oddly... in the editor. And the story around collaborating with friends is still not great (though a free tier for Unity Collaborate has helped with this a bit.)
If you haven't messed around with Unity, I encourage folks to give it a try. The new Universal Render Pipeline stuff they've been building is really nice for a solo/small team project.