Territory Layer Update#120
Merged
Merged
Conversation
…, and optimize tile rendering
…zed rendering and viewport updates
…ering queue and optimize texture management
…es, optimize offset calculations for defense posts and spawn highlights
… Uint32Array for pixel manipulation and streamline tile painting logic
…bticks for smoother territory changes and optimize execution handling
…a handling, and streamline rendering logic for improved performance
…es with ATTACK_SUBTICKS_PER_TICK constant for improved clarity and maintainability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request introduces significant optimizations and refactoring to the territory rendering and attack execution logic, aiming to improve performance and visual smoothness in the game client. The most impactful changes include switching to more efficient data structures for tile rendering, introducing caching to avoid expensive per-pixel computations, and updating attack processing to occur multiple times per tick for smoother territory transitions.
Rendering and Caching Optimizations:
PriorityQueueused fortileToRenderQueueinTerritoryLayer.tswith aSet<TileRef>, simplifying the queue management and improving performance. [1] [2] [3]borderCache,defendedCache, andborderColorsCache) to avoid repeated expensive calculations for border and defense status during territory rendering. These caches are invalidated on relevant updates. [1] [2] [3] [4] [5]Territory Highlighting and Offset Calculations:
Attack Execution Smoothing:
Code Cleanup:
TerritoryLayer.tsfor clarity and maintainability. [1] [2]These changes collectively enhance the game's visual performance and responsiveness, particularly during large-scale territory updates and attacks.