Troubles with performance on IE, Firefox, Safari

Sorry, I haven’t time to dig into the behavior on Firefox.
On chrome, it will help if you split your map, because every map has its cache. So if you split your map into three, the original large cache will be splited into 3 pieces too, therefore, the size of each cache is smaller than the threshold to trigger the issue.

Hi Huabin,

I have downloaded the newest Cocos-version from Github and now the problem with the tilemap is solved :slight_smile: (60.0 fps on each browser!)

However, I have found another problem:
If you call “removeTileAt(cc.p(x,y))” or “getTileAt(cc.p(x,y))” (to remove a distroyed brick block) the whole game freezes for about 1 sec!

We have made some changes in our code to fix that problem, but it would be much easier if you could fix this problem :slight_smile:

With many thanks and best regards, Matthias

Hi, Matthias,

For your problem that the game freezes, it’s because our solution to the huge tile map issue is not optimal, it’s just a walk around before Chrome fixes its issue of big texture rendering. When I say it’s not optimal, this solution uses 100% more memory when the tile map is huge, so the memory use become a real concern. And also, every time your tile map is dirty, that means when you use removeTileAt, setTileAt, etc… the engine uses more time to render the new cache. That’s why your game froze.
You can see the implementation of this walk around here: https://github.com/cocos2d/cocos2d-html5/commit/73ca736deb4357b17f98d5f97e1a3f0a508c4855

Fortunately, this solution is triggered only when the map is really big. We haven’t found better solution which can in the same time resolve the problem and not break our current structure in the engine. So, my suggestion is still the same, manage your game with smaller map or use combined map. Sorry for the inconvenient

Best regards

Huabin