Skip to content

Commit

Permalink
perf: redesign of area of interest
Browse files Browse the repository at this point in the history
The AOI system we inherited from Mirror is poorly designed.
It's API requires O(n^2) algorithms,  it is highly complex, and it is not flexible enough.

This PR implements AOI in a completely different way.
The NetworkIdentity objects no longer track visibility, and neither do NetworkPlayer.

When the server spawns an object, all it does it raise the Spawned event,
the AOI system will subscribe to this event,  and then show that object to all the relevant players.
Likewise,  when a player joins,  the AOI will listen for the event and show the relevant objects to the
newly created player.

In this fashion, we decouple AOI policy from NetworkIdentity and NetworkPlayers. The AOI system can keep the
relationship between them in any way that is suitable.

In this PR, I implement the simplest InterestManager called GlobalInterestManager.
This Interest Manager will just show all objects to all players.

Implement the class InterestManager to create any policy desired.  I expect to create a Spatial Hashing interest Manager

BREAKING CHANGE: Removed NetworkVisibility, extend InterestManager and attach to the ServerObjectManager instead.
  • Loading branch information
paulpach committed Mar 16, 2021
1 parent 666cdb0 commit a7e70a6
Show file tree
Hide file tree
Showing 29 changed files with 197 additions and 1,372 deletions.
139 changes: 0 additions & 139 deletions Assets/Mirage/Components/NetworkMatchChecker.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Mirage/Components/NetworkMatchChecker.cs.meta

This file was deleted.

102 changes: 0 additions & 102 deletions Assets/Mirage/Components/NetworkProximityChecker.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Mirage/Components/NetworkProximityChecker.cs.meta

This file was deleted.

118 changes: 0 additions & 118 deletions Assets/Mirage/Components/NetworkSceneChecker.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Mirage/Components/NetworkSceneChecker.cs.meta

This file was deleted.

Loading

0 comments on commit a7e70a6

Please sign in to comment.