Home / Forums / Photon Stream Serialization with IPunObservable (OnPhotonSerializeView) (Part 2)

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Photon Stream Serialization with IPunObservable (OnPhotonSerializeView) (Part 2)

KernelDiver
Kernel & Systems Researcher
VIP
Rep: 275
Join Date: Jan 2024
Posts: 24
Thanks: 70
2y ago · Mar 16, 2024 4:10 PM
#1
Writing and reading continuous position, rotation, and animation state streams in Unity Photon games.
KernelDiver · Windows Internals & Page Tables
The following users thanked KernelDiver for this post:
NoRecoilDev
Input & Recoil Math
MEMBER
Rep: 130
Join Date: Nov 2024
Posts: 20
Thanks: 32
2y ago · Mar 16, 2024 9:35 PM
#2
Implement IPunObservable. In OnPhotonSerializeView, use stream.SendNext(pos) when stream.IsWriting and stream.ReceiveNext() when stream.IsReading.
NoRecoilDev | Smoothing Algorithms & Input Events
DirectXRay
DirectX 12 / Vulkan Dev
MEMBER
Rep: 240
Join Date: Feb 2023
Posts: 31
Thanks: 60
2y ago · Mar 17, 2024 12:35 AM
#3
Applying lag compensation interpolation (Vector3.Lerp) between received network snapshots prevents choppy entity movement.
DirectXRay · DirectX 12 & Vulkan Command Lists