Fix airborne sitting and remote animation playback
This commit is contained in:
parent
a1ea341e8c
commit
c65176b99f
3 changed files with 105 additions and 9 deletions
|
|
@ -38,7 +38,9 @@ func _validate_latency_smoothing() -> void:
|
|||
_validate_animation_action_ordering(avatar)
|
||||
_validate_transit_estimation()
|
||||
_validate_remote_snapshot_smoothing(avatar)
|
||||
_validate_remote_locomotion_playback_recovery(avatar)
|
||||
_validate_reliable_jump_intent(avatar)
|
||||
_validate_airborne_sitting(avatar)
|
||||
_validate_stale_input_expiry(avatar)
|
||||
avatar.queue_free()
|
||||
await process_frame
|
||||
|
|
@ -141,6 +143,26 @@ func _validate_compact_animation_encoding() -> void:
|
|||
)
|
||||
|
||||
|
||||
func _validate_airborne_sitting(avatar: Player) -> void:
|
||||
avatar.reset_network_movement_state()
|
||||
avatar.set("_sit_after_landing", true)
|
||||
assert(avatar.get_network_sitting_intent())
|
||||
assert(not avatar.get_network_sitting_state())
|
||||
assert(not bool(avatar.make_network_snapshot(2)["sitting"]))
|
||||
assert(bool(avatar.capture_network_input(1)["sitting"]))
|
||||
|
||||
# Even a malformed or stale reconciliation that marks an airborne avatar as
|
||||
# seated must not bypass gravity and freeze it in place.
|
||||
avatar.set("_sit_after_landing", false)
|
||||
avatar.call("_set_sitting", true)
|
||||
avatar.velocity = Vector3(0.0, 4.0, 0.0)
|
||||
avatar.call("_simulate_movement_physics", 0.1)
|
||||
assert(not avatar.is_sitting())
|
||||
assert(bool(avatar.get("_sit_after_landing")))
|
||||
assert(avatar.velocity.y < 4.0)
|
||||
avatar.reset_network_movement_state()
|
||||
|
||||
|
||||
func _validate_animation_action_ordering(avatar: Player) -> void:
|
||||
var draw := NetworkPlayerAnimationProtocol.make_action_state(
|
||||
&"draw", 5, 0.2
|
||||
|
|
@ -352,6 +374,32 @@ func _validate_remote_snapshot_smoothing(avatar: Player) -> void:
|
|||
)
|
||||
|
||||
|
||||
func _validate_remote_locomotion_playback_recovery(avatar: Player) -> void:
|
||||
avatar.configure_network_remote(false)
|
||||
avatar.push_network_snapshot(
|
||||
_network_snapshot(Vector3.ZERO, Vector3(4.5, 0.0, 0.0), 21)
|
||||
)
|
||||
avatar.call("_update_character_animation")
|
||||
var animation_player := avatar.get_node(
|
||||
"Visuals/CharacterRig/AnimationPlayer"
|
||||
) as AnimationPlayer
|
||||
assert(animation_player.assigned_animation == &"running")
|
||||
assert(animation_player.is_playing())
|
||||
|
||||
# Reproduce issue #111: locomotion replication still says RUNNING (and the
|
||||
# dust therefore still emits), but the rig playback has fallen idle. The
|
||||
# local presentation pass must repair that state without another packet.
|
||||
animation_player.stop()
|
||||
assert(not animation_player.is_playing())
|
||||
assert(
|
||||
int(avatar.get("_network_target_locomotion_state"))
|
||||
== Player.LocomotionState.RUNNING
|
||||
)
|
||||
avatar.call("_update_character_animation")
|
||||
assert(animation_player.assigned_animation == &"running")
|
||||
assert(animation_player.is_playing())
|
||||
|
||||
|
||||
func _validate_reliable_jump_intent(avatar: Player) -> void:
|
||||
avatar.set_local_control(true)
|
||||
avatar.call("_queue_local_network_jump_intent")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue