flame icon indicating copy to clipboard operation
flame copied to clipboard

Tiles are shown wrong with Flutter 3.10.0

Open mrx27o opened this issue 2 years ago • 13 comments

Current bug behavior

When I run my simple Flame game with a tiled map. The tiles are shown wrong when I use Flutter 3.10.0 It looks like in this screenshot: app

Expected behavior

It should look like this: map And it looks right in "Tiled" and if I downgrade Flutter to 3.7.12.

Steps to reproduce

I use this code for loading the map file and creating the TiledComponent:

@override
  Future<void> onLoad() async {
    final tiledComponent = await TiledComponent.load("map.tmx", Vector2.all(40));
    add(tiledComponent);
  }

And this is the map file:

1,1,1,1, 1,2,2,1, 1,1,1,1

More environment information

  • Flame version: 1.7.3
  • flame_tiled: 1.9.1
  • Platform affected: only tested on ios

mrx27o avatar May 17 '23 15:05 mrx27o

Map file doesn't looks right, so here it is again:

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="4" height="3" tilewidth="40" tileheight="40" infinite="0" nextlayerid="2" nextobjectid="1">
 <tileset firstgid="1" name="tileset" tilewidth="40" tileheight="40" tilecount="2" columns="2">
  <image source="tileset.png" width="80" height="40"/>
 </tileset>
 <layer id="1" name="Tile Layer 1" width="4" height="3">
  <data encoding="csv">
1,1,1,1,
1,2,2,1,
1,1,1,1
</data>
 </layer>
</map>

mrx27o avatar May 17 '23 15:05 mrx27o

Can you try to deactivate impeller and see if it makes a difference? https://docs.flutter.dev/perf/impeller#ios

spydon avatar May 22 '23 09:05 spydon

Good guess, it works with deactivated impeller

mrx27o avatar May 22 '23 19:05 mrx27o

Oh no, yet another impeller issue. :( We'll have to write up some issues for the flutter issue tracker.

spydon avatar May 22 '23 20:05 spydon

I think that this PR will solve this: https://github.com/flutter/engine/pull/42293

spydon avatar May 25 '23 08:05 spydon

@mrx27o have you tried if it works with Impeller now?

spydon avatar Jun 11 '23 12:06 spydon

With Flutter version 3.10.4 it's not working. Is this a wrong version?

mrx27o avatar Jun 11 '23 19:06 mrx27o

With Flutter version 3.10.4 it's not working. Is this a wrong version?

Maybe the fix isn't released yet then, or possibly that the fix didn't solve that problem.

spydon avatar Jun 11 '23 20:06 spydon

@mrx27o have you tried this on the latest version of Flutter (and Flame)?

spydon avatar Sep 11 '23 19:09 spydon

@spydon it looks better than before, but it's still glitchy. With Impeller there are horizontal and vertical lines between my tiles. Without Impeller it looks fine. Current used versions: Flutter: 3.13.1 Flame: 1.8.2 Flame_Tiled: 1.13.0

With Impeller: withImpeller

Without Impeller (should look like that): withoutImpeller

mrx27o avatar Sep 14 '23 10:09 mrx27o

@spydon I created a simple project to reproduce the problem. You can find it here: https://github.com/mrx27o/flame_playground

mrx27o avatar Sep 21 '23 12:09 mrx27o

This is most likely a bug on impeller's side, so it would be good to be able to reproduce this in pure flutter code and open an issue at Flutter.

spydon avatar Sep 21 '23 12:09 spydon

Not sure if I am able to reproduce it. But if the problem occurs in all "tiled" apps with Impeller it should be quite critical.

mrx27o avatar Sep 21 '23 12:09 mrx27o

Can you now check with the latest flutter version 3.19 @mrx27o

When I checked (your repo example) with new version on iOS - default impeller enabled.

And this is the output: Screenshot 2024-02-29 at 21 38 25

immadisairaj avatar Feb 29 '24 16:02 immadisairaj

Yes thanks, it seems fixed indeed.

mrx27o avatar Feb 29 '24 22:02 mrx27o