Conversation
|
Great stuff!! |
| func record_state(tick: int) -> void: | ||
| var input_snapshot := get_rollback_input_snapshot(tick - 1) | ||
| _record(tick, _rb_state_snapshots, _rb_state_properties, false, func(subject: Node): | ||
| if not subject.is_multiplayer_authority(): |
There was a problem hiding this comment.
Server always has authority to broadcast states
| if not subject.is_multiplayer_authority(): | |
| if subject.multiplayer.is_server(): | |
| return true | |
| if not subject.is_multiplayer_authority(): |
There was a problem hiding this comment.
Might have to investigate why is_predicting() was returning true in this case. Otherwise we risk overwriting a client's prediction with ticks that the server had no input for.
There was a problem hiding this comment.
Without the suggested change, RollbackSimulationServer.is_predicting() would return true for the other player's car on the server, because of this clause:
if is_owned and not has_input:
# We own the node, node depends on input, we don't have data for input - predict
return trueSo as long as we haven't received input from the client, we consider the recorded simulation predicted, which - in theory - makes sense. I guess next thing to find out is why we need to forego the above.
On clients, is_predicting() returns false for the player's car with this clause:
if not is_owned and has_input:
# We don't own the node, but we own input for it - not (input) predicting
return false
This is an experimental PR, that refactors much of netfox's internals, inspired by Godot's server pattern.
While Godot had its own requirements, the interpretation here is that:
Hopefully this allows:
Also lays the foundations for some potentially wild features like:
TODO:
Pending fixes:
Sanity tasks:
Introduces #556