You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, netfox nodes have @exported variables to configure state and input to track and synchronize. These are arrays and can be manipulated.
It would be better to have more specialized options for configuring these properties.
Implementation notes
Procedural configuration
Implement the following methods:
StateSynchronizer::add_state(node, property)
TickInterpolator::add_property(node, property)
RollbackSynchronizer::add_state(node, property)
RollbackSynchronizer::add_input(node, property)
Each of these would add a new property to the appropriate configuration. They return true if a new property was added. If the property was already tracked, it they would return false without modifying anything. The node parameter can be a Node, a NodePath, or a string that can be used as a node path. The property parameter is a string, denoting the property name.
Example usage:
@onreadyvarrollback_synchronizer:=$RollbackSynchronizerasRollbackSynchronizer@onreadyvarinput:=$InputasInputfunc_ready():
rollback_synchronizer.add_state(self, "transform")
rollback_synchronizer.add_state("", "velocity") # Same as selfrollback_synchronizer.add_input(input, "movement")
rollback_synchronizer.add_input("Input", "jump")
Exploration
To avoid having to call the above methods in _ready() or _enter_tree() ( and therefore making scene instantiation take more time ), netfox nodes should recognize nodes with state / input / interpolated properties and add them to their configuration from the editor. Preferably, there should be a way to trigger this exploration manually too.
The following methods should be recognized on any node:
_get_interpolated_properties()
_get_synchronized_state_properties()
_get_rollback_state_properties()
_get_rollback_input_properties()
These return arrays of tuples, that are then passed to the relevant methods from above. For example:
In the editor, RollbackSynchronizer should call these methods and configure itself.
Use case
This would affect all current netfox nodes, so all games.
This API would be great for programmatically ensuring correct configuration and cutting down on manual effort. Expecting these to be mostly useful past the prototype phase, where any given mechanic is already solved, and the required properties are known in advance.
Distribution
netfox core
Notes
❓ Should the add_* methods automatically process configuration?
The text was updated successfully, but these errors were encountered:
✨ Description
Currently, netfox nodes have
@export
ed variables to configure state and input to track and synchronize. These are arrays and can be manipulated.It would be better to have more specialized options for configuring these properties.
Implementation notes
Procedural configuration
Implement the following methods:
StateSynchronizer::add_state(node, property)
TickInterpolator::add_property(node, property)
RollbackSynchronizer::add_state(node, property)
RollbackSynchronizer::add_input(node, property)
Each of these would add a new property to the appropriate configuration. They return true if a new property was added. If the property was already tracked, it they would return false without modifying anything. The
node
parameter can be a Node, a NodePath, or a string that can be used as a node path. Theproperty
parameter is a string, denoting the property name.Example usage:
Exploration
To avoid having to call the above methods in
_ready()
or_enter_tree()
( and therefore making scene instantiation take more time ), netfox nodes should recognize nodes with state / input / interpolated properties and add them to their configuration from the editor. Preferably, there should be a way to trigger this exploration manually too.The following methods should be recognized on any node:
_get_interpolated_properties()
_get_synchronized_state_properties()
_get_rollback_state_properties()
_get_rollback_input_properties()
These return arrays of tuples, that are then passed to the relevant methods from above. For example:
In the editor,
RollbackSynchronizer
should call these methods and configure itself.Use case
This would affect all current netfox nodes, so all games.
This API would be great for programmatically ensuring correct configuration and cutting down on manual effort. Expecting these to be mostly useful past the prototype phase, where any given mechanic is already solved, and the required properties are known in advance.
Distribution
netfox core
Notes
add_*
methods automatically process configuration?The text was updated successfully, but these errors were encountered: