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

Mutations #364

Open
elementbound opened this issue Dec 28, 2024 · 0 comments
Open

Mutations #364

elementbound opened this issue Dec 28, 2024 · 0 comments
Labels
feature New feature or request

Comments

@elementbound
Copy link
Contributor

✨ Description

An API to make sure that when nodes change other nodes during rollback, the changes are propagated.

Use case

In the current rollback implementation, it is only possible to change the current object, not others. This requires cumbersome workarounds for mechanics like shove / push, moving platforms, or even managing HP and other similar stats.

The Mutations API would solve these by making sure that when changing an object in rollback, the change is recorded and further ticks are re-simulated based on the updated state.

This affects multiple game genres.

Implementation notes

NetworkRollback would expose methods for managing mutated objects:

  • NetworkRollback.mutate(object, [tick])
  • NetworkRollback.is_mutated(object, [tick])

These methods can be used to register mutated objects and to check for them. Mutations always happen at a given tick, and affect all future ticks as well. Specifying the tick is optional, and should default to the current ( rollback ) tick. Re-simulation should consider the earliest mutation tick.

RollbackSynchronizer should take mutations into consideration and always re-simulate mutated objects.

Distribution

netfox core

Notes

@elementbound elementbound added the feature New feature or request label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant