Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend PhysicsDirectSpaceState3D or PhysicsServer3D for easy state duplication / memoization #8030

Closed
warent opened this issue Oct 8, 2023 · 2 comments
Labels

Comments

@warent
Copy link

warent commented Oct 8, 2023

Describe the project you are working on

Indie MOBA game

Describe the problem or limitation you are having in your project

PhysicsServer3D provides the tools needed to run physics against the current physics state, but it does not seem to easily support state freezing/exporting--a feature that is particularly important for handling lag compensation to run physics against past states.

The only way to do this now that I can think is to write a whole new PhysicsServer3DExtension which can export its current state on demand or handle some kind of custom internal buffer, which is pretty cumbersome.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I'm not a physics or networking expert, so I can't speak to the best way to generalize this. My best guess is perhaps something like PhysicsDirectSpaceState3D.export_state() and PhysicsDirectSpaceState3D.import_state() would do the trick.

In this case, then it is easy to export state on demand (e.g. per server tick) to store in some state buffer to run retroactive physics on.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Noted above

If this enhancement will not be used often, can it be worked around with a few lines of script?

Not easily

Is there a reason why this should be core and not an add-on in the asset library?

It seems fundamentally integrated functionality

@warent
Copy link
Author

warent commented Oct 8, 2023

I think it's related to this: #2821

But it's not clear that they would necessarily have the same solution

@warent
Copy link
Author

warent commented Oct 8, 2023

Actually yeah after reading that proposal further, this is definitely a dupe. Consolidating!

@warent warent closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants