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

Autotiler cleanup and performance improvements #721

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

JaThePlayer
Copy link
Member

@JaThePlayer JaThePlayer commented Jan 8, 2024

Started out as optimisation, ended up with bugfixes and cleanup as well 😅

  • Added the ability to disable automatic sorting of <set> elements, as it can be unintuitive and makes it harder to create complex tilesets.
<Tileset id="A" path="..." sortMode="none">
  • All code paths of TileHandler now use the Everest version of autotiler code - improves performance, simplifies the code and makes it much easier to implement new optimizations.
  • Introduced constants which explain the meanings for magic numbers within the byte[] Masked.Mask
  • Fixed a potential bug when using non-ASCII chars in GetByteLookup, used in <define> elements - now throws an exception instead of potentially not working or overwriting other custom masks in hard to predict ways. This should be fine, as I honestly don't know if anybody used this feature at all ☃️
  • Fixed the everest TileHandler being completely broken (it used to ignore the ignores="..." xml tag...
  • Big performance improvements for maps with tons of rooms - f5 in 9d went from ~4.5s to ~2.8s for me
    • Introduced a cache for tileset masks
    • Stopped using CheckForSameLevel potentially several times per tile, as it's O(n) complexity (n - number of rooms in the map). Instead, we calculate which room the currently checked tile comes from (still O(n), but only once per tile), and simply check if the surrounding tiles belong to the same room (O(1))
    • Various micro-optimisations combined with code cleanup

@JaThePlayer JaThePlayer marked this pull request as draft February 11, 2024 01:05
@maddie480 maddie480 added the dormant This PR is really old, do we really need it? label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dormant This PR is really old, do we really need it?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants