ethanmoffat / EndlessClient

An open source client for Endless Online written in C#
MIT License
34 stars 16 forks source link

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

Closed ethanmoffat closed 1 year ago

ethanmoffat commented 1 year ago

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: