Page MenuHomeWildfire Games

[WIP] Changes to ObstructionManager & Spatial structures for performance
Needs ReviewPublic

Authored by wraitii on Jun 4 2023, 5:00 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This changes the obstructionManager Spatial data to store pointers to the map data, instead of indices. This allows faster TestLine calls (and a few other cases).
Furthermore, with some care, this allows changing the structures from std::map to std::unordered_map, speeding up a few things further.

TODO: figure out how to do serialization / deserialization, because we need the same ordering and obviously pointers won't work.

It's not impossible that there is a third way to do this that's better, with e.g. an Entity-Map like thing.

An AI 2v2 reports this as a ~2% performance improvement.

Test Plan

^

Event Timeline

wraitii created this revision.Jun 4 2023, 5:00 PM
Vulcan added a comment.Jun 4 2023, 5:06 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7049/display/redirect

Hmm to be honest it might be enough to try and switch to unordered_map regardless, I think most use case are order-independent. Might be fast enough that we don't care about the pointers thing, which would be nice.

Vulcan added a comment.Jun 4 2023, 5:34 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/8719/display/redirect

wraitii published this revision for review.Jun 5 2023, 8:46 AM