Support running the user controls system in a different timestep than the Tnua and (/or?) physics backend systems #62
Replies: 3 comments 12 replies
-
Problem: actions need to be fed each frameUser control systems are not expected to explicitly tell Tnua that the action ends. Instead, the action ends when it is no longer fed. For example - when the user releases the jump button, the user control system stops invoking If the user control system runs in a different timestep from the internal system, the internal system may have two consecutive steps without the user control system running between them, which means that the second step will see that the action was not fed (because the user control system was not there to feed it) after the first step already marked the action as fed. |
Beta Was this translation helpful? Give feedback.
-
Problem: user control systems may want to interact with the sensorThis, for example, is how ghost platforms work - the user control system needs to modify the There are also issues with some "lags" if the user control systems wants to utilize information from the proximity sensor output (e.g. make a bigger jump when standing on entity marked as trampoline) |
Beta Was this translation helpful? Give feedback.
-
Problem: using the action flow status
The user control system may also miss states like |
Beta Was this translation helpful? Give feedback.
-
@janhohenheim mentioned in Discord that input mechanisms (like
just_pressed
) don't work well in fixed timesteps. This is a problem because it often makes sense to run the physics engine in fixed timestep. Crates like Leafwing Input Manager can handle this, but it may also be desirable to just allow the user input system run "out of sync" with Tnua's internal systems (that will still need to run in the same timestep as the physics backend)I've made this a discussion instead of an issue because there are several issues that need to be resolved when the user control systems are not in sync with Tnua's internal systems, and a discussion can have multiple comments each with its own replies which we can use to discuss these various aspects.
Also note that this is mostly a nice-to-have - I'm not sure this can be reasonably done, and it's always possible to just keep the user control system in the physics timestep and just use LWIM.
Beta Was this translation helpful? Give feedback.
All reactions