Hi. I’ve been working in Unreal Engine for over 3 years now, and have shipped a fairly big title. I just wanted to post some general feedback for the Unreal Engine API. I’m still digging into the system and understanding it, converting the DUSK demo into a FPS with most of the mechanics implemented in C++ as a starting point. I’m going to try to use this thread as a general dumping ground for my thoughts and ideas as I work through certain issues and then try to do things better.
The UE API has total callback overload. There are callbacks everywhere, and it forces a pattern that doesn’t sit well with most Unreal Engine programming. Namely that anything coming in over the wire needs to have dedicated functions to handle the remote data coming in, even when there is a component attached to an actor that is supposed to handle it.
It seems like it would be easier, from a C++ perspective, to be able to subclass the generated components and handle certain events. For example, I would love to have a MyTransformComponent that directly applies the transform updates to the actor it’s attached to. I could also set it to tick after the CharacterMovementComponent, allowing it to correct predicted positioning. By waiting for a callback, I can’t do this. My current solution is to create a second component (some UMyGameTransformComponent) that binds to the TransformInfo Component and handles it’s callbacks. This seems super messy, and some way to unify this process would be appreciated.
On that note, some more control over the code generator would be nice. I see little issues in the generated code (like creating a new UObject when a simple struct or TSharedPtr<> to a non uobject class could hold that data, decreasing GC load and improving performance) that could be improved.
On a higher level, there is a lot of boilerplate that seems like it could easily be handled by code generation. Unreal Header Tool can parse classes and generate boilerplate, which could really help with this. By modifying UHT, spatial could possibly leverage the Replicated UPROPERTY tag(or even create your own tag for Spatial) to spit out a schema for each object, and then set up the callbacks so that when new data comes in, it automatically sets the values in code… no boilerplate needed.
Also, I ran into an issue that after attempting a Hot Reload, some code was compiled into a .obj and then when trying to link later it gave linker errors for defining functions twice. I’m not sure what specifically caused it, but Hot Reload may be broken. To fix it, I cleaned out all of the generated code and then recompiled.