Hi guys! This is my first post here.
The game I’m currently prototyping involves lots of pushing objects mechanics in a gamey, non-realistic way. So I don’t want inertia, angular movement or anything like that in my “physics”, just collision solving based on the Minimum Translation Direction vector and the relative masses of the overlapped objects.
I already have a first draft of the system working and now I want to refactor my code and distribute it into reusable UComponent classes. The most obvious way to do so, I think would be to have a UMyCustomMovementComponent that updates the position and a UMyCustomCollisionSolvingComponent that solves the collision after that. To make sure that their respective Ticks happens on the expected order I would add the Actor Tick as a prerequisite for the UMyCustomMovementComponent Tick, and the UMyCustomMovementComponent Tick as a prerequisite for the UMyCustomCollisionSolvingComponent Tick.
The problem I’m facing with that is that some objects would still update, move and solve their collision before the others, wich can lead to some unwanted behaviours. And even worse, those unwanted behaviours would be framerate dependant.
So, ideally, what I want is to update all my Actors Ticks (and my Logic components), then update all my UMyCustomMovementComponent Ticks and after that update all my UMyCustomCollisionSolvingComponent Ticks.
What is the best way to setup this ?
Seems like UE has the concept of components, but doesn’t lets you write your own custom systems. Am I wrong ? Is there any way to iterate over all the components of a specific class?
Maybe I should use custom events instead of Ticks ? If so, where should I store and manage them ? Into a custom Actor that acts as a custom framework ? Into my GameMode ?
Thank you for reading. And sorry for my English.