Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

API to disable physics tick to run it manually #253

Closed
Shatur opened this issue Apr 24, 2022 · 2 comments
Closed

API to disable physics tick to run it manually #253

Shatur opened this issue Apr 24, 2022 · 2 comments

Comments

@Shatur
Copy link
Contributor

Shatur commented Apr 24, 2022

Description

When developing a game with multiplayer, I need to run my physics steps exactly on network ticks. For example, libraries like naia defines their own Tick stage. The easiest way to synchronize them I need to disable physics step completely and add it to my networking Tick stage. I also will need to apply looping run criteria on physics (i.e. use ShouldRun::YesAndCheckAgain to run it multiply times in case of restoring from rollback).

Possible implementation

To achieve this I need two things:

  1. Access to physics step system(s).
  2. The ability to disable physics step.

For the first one we could just export systems which tick physics will allow user to add these systems to custom stages.
For the second one we could add a boolean option the plugin to disable physics steps scheduling.

Should be easy to implement, but I would appreciate to which systems I should disable and which one I should export to make it work correctly.

Going to play with this first locally to make sure it's enough for integration with networking.

@jcornaz
Copy link
Owner

jcornaz commented Apr 24, 2022

I feel that there is an overlap, at least in user need, with #170 (related discussion: #168, implementation PR: #171)

I think we should consider the option of letting the user choose the stage. And if we go for a different solution, we'll have to re-assess the need of #170, as it's use-case is also rollback networking.

@jcornaz jcornaz added the design label Apr 24, 2022
@Shatur
Copy link
Contributor Author

Shatur commented Apr 24, 2022

Somehow I missed it all :D
Yes, this could solve my issue. I think I can replace looping run criteria with RollbackStage from naia side (need to request it), will be even better.

@Shatur Shatur closed this as completed Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants