I have tried first to load My TMX map normally using TMXTiledMap:: guys !create I discovered that it will stop rendering when it reaches a specific limit I have searched for a solution I some guys on the forum was talking about experimental::TMXTiledMap but it just did the same as normal TMXTiledMap some parts still invisible/unrendered
but I have noticed that GL verts have been reduced also fps dropped from 60 to 30 anyways my question is how can I draw a huge map without any fps drops or invisible parts please help me it’s urgent I can’t advance more in the project with out you guys!
I have tried to do this :
for (int x = 1; x < 499; x++) {
for (int y = 1; y < 499; y++) {
Sprite* sprt1 = map->getLayer("earth")->getTileAt(Vec2(x, y));
Sprite* sprt2 = map->getLayer("signs")->getTileAt(Vec2(x, y));
Sprite* sprt3 = map->getLayer("grass")->getTileAt(Vec2(x, y));
Sprite* sprt4 = map->getLayer("sea")->getTileAt(Vec2(x, y));
}
}
it draws the whole map and fps is still 60 but it everything on the game moves very slowly!
Please help me I might use the experimental::TMXTiledMap wrongly since there isn’t a lot of people are actually talking about it
I wish I had more context without getting to into the details of your game, but i’ll ask this:
How large is the texture you will be using in your map? (Based on the code snippet you put above, It looks like you may have a large texture that you might want to async load in the background)
How are you trying to traverse the map? (depending on how you do it, it may be there reason it’s going slowly
Have you changed any of the config setting? (There is a setting in ccConfig.h That look like this #define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0. You may want to try that and set it to one and see what happens, if saved me with my game using TileMaps
From my experience, If kinda about the optimization part of everything. I would be happy to collaborate with you on this specifically if your open to that kind of stuff
1-My tilesRes image is 464x2735 (.png) and my tileset is 10x10px
2-I m using the Follow action to follow the player (creating node and then loading the map at the beginning and add it as a child to the node, after all that i do this
auto followTheSprite = Follow::create(GameManager::player->PlayerSprite,
GameManager::map->map->getBoundingBox());
edgeNode->runAction(followTheSprite);
3-I have changed that to 1 to avoid artifacts and weird lines in the map
Note: when I create new layer it draws perfectly seems the limit per layer is 128x128
BUT the tile map uses a LOT of RAM please help me with that too
Also, when you do this, make sure you enable the flag on the cocos library as well as your main project, otherwise you can get a lot of issues during linking.
Good day!
(My English is terrible. The text below is a Google translator)
I recently tried using “experemental::TMXTiledMap”.
If I move the Scene, the tiles start to disappear.
see screenshots
I’m writing new docs for TileMap. Your tilemap looks great. Can I have a copy to use for the example code and screenshots in the docs? PM me if you want.
I noticed that drawing tiles went forward the camera twice as fast.
I did not use the “scale” or “scale factor”
The debugger showed that the “origin” is not correct
I added this line and it all worked. Even if I use Scale.
rect.origin *= 0.5;
Why does this work?