Hi All ( and Ansca ),
I have a question that relates to tile based maps. We built a demo to try out the new performance improvements and we succeeded in getting a map of 50x50 ( 64x64 px tiles ) tiles and physics per tile, with 70-80 sprites (with physics ) on the map, with full accelerometer control running at 60fps on the sim, and also running at 60fps on device ( iPhone4 ) as well.
This demo was mainly to test how we could apply the technique to the game we are working on. Just to be clear, the tiles are drawn once into an imageGroup, using tile images from an imageSheet. We do not need to animate tiles so this works well for us. I do not cull individual tiles as this performance update should ( as stated ) be doing off screen culling of objects anyway at low level.
This brings us to the game we are working on…
It makes use of Lime and Tiled to get our maps into the game, but as Lime doesnt yet make use of imageGroups, we rolled our own ‘tile drawing into layers’ that Lime would normally do for you with lime:createVisual(), lime:createPhysical(). We also set the map position and clamp it using our code. However to leverage some of lime’s functionality we do set references to our display layers ( imageGroup, displayGroups ) on the corresponding tile layers as Lime sees them ). In making use of an imageGroup for the tiles, we did get performance improvements ( average of 37 fps or less ) but not as we expected. And we noticed something quite interesting…
It should be pointed out that this game is doing player and game object movement, animation, collision ( the landscape has a large physics object attached to it ) and collision response, full headup display, in short, we are doing the usual things in a game loop to make any game playable.
Here is the odd thing… when the map is scrolling ( to keep the player centred on the screen ) we are getting 37fps or worse on device ( iPhone4 ) but when the map can’t be scrolled ( it’s come to map edge, or x, y doesn’t change ), the fps jumps to 60fps. And this is with everything else still running as before. Again, we are not doing any culling of tiles or gfx ourselves, just to be clear.
So what I want to know is why scrolling the map is losing us 20fps?
Does anyone have any idea why this should happen?
All I do to scroll is change the x and y ( and rounding it or you get gfx artifacts! ) of the displayGroup holding all the layers [I do not use Lime to do this] It’s about the simpliest way you can do it.
Does anyone have any explanation or ideas?
Thanks [import]uid: 134650 topic_id: 23761 reply_id: 323761[/import]
mydeveloper’s profiler. i can’t take credit for that…