some thoughts on switching engines, or a "devlog"
I’ve been using Flax for quite a while now, and I’m getting used to it. I’m starting to get quick with it, but I’ve also noticed a number of weird bugs and quirks that I have to work around. So I thought about compiling a list of things that I found a bit unusual about Flax as a former (?) user of Unity
Firstly, I love how instant the workflow is. Both when playtesting and compiling, it takes way less time compared to Unity, and this allows for more productivity during the development, especially with larger games. It feels fast, it feels lightweight, it’s amazing.
Next, I like the way materials are defined, mainly because it supports a graph workflow, very similar to what Unity’s shader graph offers. But because it’s also based on it, writing a custom shader, while possible, doesn’t have great support at the moment (or so I’ve read on official Flax discord - i cant write shaders myself). One unexpected thing that kinda bugged me was defining a normal map from file. Whenever you make a material, you can define custom parameters, like here
Notice the Colour Texture and Normal Map fields. They look similar, don’t they? As in, you can select an image file to be used as a colour or normal texture. Well, they are two separate fields with two different use cases. Colour Texture is just a regular texture, that we can use for things like colour, masks, etc. But you can’t really use it as a normal map input, or else you can get various shading artifacts like here:
(And, if you’re wondering, both the road and the rock materials are supposed to be fully shaded.)
This is why they have a dedicated input field for normal maps. They made it like that so that the normal map can (presumably) be interpreted differently from a regular texture. But still, I think it’s a bit too easy to miss, and then try to debug all the lighting glitches caused by wrong parameter type.
Next thing I want to talk about is UI. And it feels a bit… clunky. Now, there are a lot of cool features that are familiar to anyone who’s worked in Unity UI, but one thing I am a bit torn about is handling of buttons. When it comes to properties, here’s everything that you can modify:
Notice that there’s one thing that feels like it belongs there, and that is custom engine event system. Now, I don’t want it to become a second Unity workflow-wise, but it’s just so convenient to do simple stuff with exposed events like On Click. On the other hand, doing it this way gives the programmer more control over button’s behaviour using custom scripts. But then, if you need a lot of buttons, each doing a different thing… well, you have at least 2 options: either make a script for every button (good for simple generic operations) or make a wrapper script that’d handle all the buttons necessary (good for organised UIs like editors and HUDs). Still, code that looks like below, isn’t as intuitive as I’d wish for (especially given Flax’s actor system), and it could allow for some unwanted references.
This leads me to the last point (for now), which is the aforementioned actor system. Actors in Flax work in a similar way to Unity’s game objects, but they have one big distinction. In Flax, each component is a separate actor. That means that you can’t have, for example, a rigidbody and a collider on a same actor, you have to make a rigidbody actor and then make a collider actor its child. And scripts are treated separately, so you can put a large number of scripts on an actor. It might be weird for some, and I agree that Unity’s more component-oriented design allows for more modularity. However, I’d compare this game object/actor distinction to a difference between procedural languages (like C, Rust) and object-oriented ones (like C#, Java), in such that they are both functionally identical, just manifested in a different way, and you can still do it this way in Unity if you want. And I think one might argue that Flax’s approach makes it more readable, as in, for example, you don’t have to see collider settings when you’re editing the point light, and vice versa.
So, that is what I’ve noticed so far after switching to Flax engine. And it proved that it’s a solid, capable tool for 3D games. The similarities to Unity make porting feel not too tedious. So far I’ve managed to implement all 3 test tracks, and I’ve started constructing a main menu. Lots of work awaits me, but it’s looking promising. And if any of you want to try something new, especially in 3D, then Flax gets my recommendation. If 2D interests you, then you better start binging some Godot tutorials, because Flax is not great for that for now.
(also there are a couple of more things that i havent mentioned here but it’s 1:15 am as of writing this, so if you have any question feel free to ask them)