Skip to content
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

Map entity rendering performance enhancements and minor client bug fixes #308

Merged
merged 7 commits into from May 14, 2023

Conversation

ethanmoffat
Copy link
Owner

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:

  • Shop dialog only allowed MaxBuy of 1 when the shop defined a MaxBuy amount (logic incorrectly reversed)
  • Display of stats 'evade' and 'armor' were swapped in the stat panel

@ethanmoffat ethanmoffat added this to the v1-beta milestone May 14, 2023
@ethanmoffat ethanmoffat merged commit 10491f9 into master May 14, 2023
3 checks passed
@ethanmoffat ethanmoffat deleted the fix_map_entity_perf branch May 14, 2023 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant