A Brief History of Mirror
TCP and UDP
Round Trip Time (RTT)
The Pragmatic Hosting Guide
Cloud Hosting Guides
Hosting with a Remote Desktop
Edgegap Hosting Plugin Guide
Cheat Protection Stages
Cheats & Anticheats
Mirror Quick Start Project
Unity for MMORPGs
Unity Canvas HUD
Odin Inspector Support
Ready Up And Die!
Mirror Docker Guide
Optimization for Lag Compensation & Client Side Prediction
In the previous chapter, we discussed how to use lag compensation to check player's hitboxes in the past.
To minimize performance overhead, it can be useful to first cast against
before we decide which players to rollback.
are essentially a 4-dimensional bounding box: (x,y,z,time). In other words, a bounding box which contains all the player's positions in the last second or so.
The orange Collider shows the Tank's red Collider over the last second.
component to your NetworkIdentity
Make sure your NetworkIdentity has a collider, drag it into the component's
Add a child GameObject with a BoxCollider and isTrigger enabled. Drag it into the component's
Press play, enable Gizmos, notice the orange HistoryCollider.
The component automatically adjusts the child trigger collider to match the orange box, which means that you can use Physics.Raycast against all the history colliders very easily.
In other words: if a player fires a gun, do this:
Raycast against all HistoryColliders to find out which other player's we need to check
Then apply lag compensation for the collider's parent NetworkIdentity
Then check if it was hit
This is a brief overview on why HistoryCollider exists, and how to use it. In the future we will provide a proper FPS demo with all the advanced techniques.