flame-engine / flame-engine/flame
[flame_tiled] Tile flip makes performance issue.
- Dominant language
- Dart
- Stars
- 10.8k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 21
Description
# Current bug behaviour
As I wrote in #1614, the FPS of the`tiledComponent` is very close to 0 before #1637.
And after #1637, The most of performance issue is gone so I felt there is no performance issue.
But I found some maps which have flips has lower FPS than others that don't have any flip.
So I tried to turn off flips forcefully by manipulating the following line to investigate what is the problem.
I changed `tile.flips` to `Flips.defaults()` and the performance issue is gone.
So I carefully predict that the performance is affected by flips.
https://github.com/flame-engine/flame/blob/ad602ff9634e248f7b3b385ee000d95131ea0a60/packages/flame_tiled/lib/src/renderable_tile_map.dart#L169
It seems some performance issue is resolved but some of them still remains.
# Expected behaviour
- Fix performance issue when using flips.
# Steps to reproduce
- I should investigate more for this
- **I found it occurs only on IOS**
Contributor guide
Research direction
Start at packages/flame_tiled/lib/src/renderable_tile_map.dart around line 169, where tile.flips is involved in rendering. Profile comparable flipped and unflipped maps on iOS, then identify and verify the performance regression; done means flipped tiles no longer cause the reported FPS drop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter, ios
- Domain
- game-dev, mobile-dev, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100