feat: refactor tick interpolator to server pattern#602
Conversation
| static var _logger := NetfoxLogger._for_netfox("InterpolationServer") | ||
|
|
||
| ## Register an interpolation group for a TickInterpolator node | ||
| func register_interpolation_group(group_id: int, root: Node, properties: Array[String], enabled: bool, enable_recording: bool) -> void: |
There was a problem hiding this comment.
We could limit the registration method to registering a property on a subject ( Node ), and manage the rest with setter methods ( e.g. set_recording(subject: Node, enabled: bool) ). Internally, the bool flags could be handled as _Sets, e.g. if a node is in the _recording_enabled set, then recording is enabled, otherwise not.
( The reason I keep referring to subjects instead of nodes is that there's a chance netfox will support recording, syncing, interpolating, etc. properties on any object, not just nodes )
| if Engine.is_editor_hint(): | ||
| return | ||
|
|
||
| NetworkTime.before_tick_loop.connect(_before_tick_loop) |
There was a problem hiding this comment.
We could separate the pre- and post tick loop activities into discrete methods ( e.g. _clear_teleports(), _apply_target_state(), _record_next_state() ), and call them from NetworkTime.
Same rationale as with interpolate()
There was a problem hiding this comment.
I might leave this one for now. I'd have to mess with NetworkTime
|
Supersedes #539 |

Switch tick interpolation to use server pattern while keeping all original contracts.
Added unit and perf tests.