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.
This PR adds the following performance improvements with minimal simulation changes
This is the maximum range a mob can interact. This includes reaches, hitboxes, and radius/rectangle dimensions. If the distance between a mob is greater than this, we skip all calculations between these mobs.
Now uses A* instead of dijkstra. This will most likely need to be re implemented due to recent pathing changes
Edge shadows are now individually checked if they are on screen, and culled when not. If a sector's bounding box is fully on screen, this step is skipped. Furthermore, these calculations are now reused to update multiple edge buffers.
The "all" mob list is now sorted by minimum interaction position. Mobs are now grouped into regions based on their interaction radius, and interactions are only processed between regions.
Simulation changes
Performance Gains
All measurements are taken from a release build on the latest commits, and are recorded upon entering the area.
Specs: i7-9700k @ 4.4 GHz GTX 1060 6GB, 32GB RAM @ 2400MHz
D.E.V. Lab
Master: 99 - 103 FPS
Performance Branch: 240 - 250 FPS
Playful Yard
Master: 180 - 200 FPS
Performance Branch: 290 - 320 FPS
Crash Landing
Master: 220 - 240 FPS
Performance Branch: 300 - 330 FPS
Cryptic Atrium
Master: 150 - 165 FPS
Performance Branch: 205 - 220 FPS
Verdant Agrids (https://discord.com/channels/459094367425134593/1156405792547807244):
Master: 20-22 Fps
Performance Branch: 71- 75 FPS