-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: redesign of area of interest #743
Closed
Commits on Mar 27, 2021
-
perf: redesign of area of interest
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.
Configuration menu - View commit details
-
Copy full SHA for 6cc2f55 - Browse repository at this point
Copy the full SHA 6cc2f55View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd5fab0 - Browse repository at this point
Copy the full SHA cd5fab0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 93c9f29 - Browse repository at this point
Copy the full SHA 93c9f29View commit details -
Configuration menu - View commit details
-
Copy full SHA for f68864d - Browse repository at this point
Copy the full SHA f68864dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 559528b - Browse repository at this point
Copy the full SHA 559528bView commit details -
Configuration menu - View commit details
-
Copy full SHA for f4fe323 - Browse repository at this point
Copy the full SHA f4fe323View commit details -
Configuration menu - View commit details
-
Copy full SHA for bcd7088 - Browse repository at this point
Copy the full SHA bcd7088View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29c5afa - Browse repository at this point
Copy the full SHA 29c5afaView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.