Map entity rendering performance enhancements and minor client bug fixes #308
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.
Map entities are now stored in a dual-key collection that is indexed by both map coordinates and unique ID based on the type of entity (item uid, npc index, character id). This allows rendering of map entities to do an O(1) lookup rather than O(N) when determining if a grid space has a renderable element, which significantly improves performance when there are many entities to render (especially considering resizable window mode).
Additionally, map items are now culled unconditionally when the main character gets out of range, similar to how Characters/NPCs are culled by
UnknownEntitiesRequester
. This is due to the fact that there is no server packet that despawns an item.Minor bugs fixed: