Hi Everyone,
I realise Culling is a hot topic recently, but I’d like to ask a theoretical question.
I have a tile based game set up (We’re not into the theoretical yet)
I’ve also Implemented my own off screen image culling for tiles coming onto the screen.
- They all start with visibility off and become visible when they enter the screenBounds.
for i = 1, map.numChildren do -- For all tiles
if isVisible(map[i]) and map[i].isVisible ~= true then -- isVisible() is a function to get screen bounds.
--So If within screen bounds and visibility is false then...
map[i].isVisible = true -- Set that specific tile to visibility on.
print("true" , i) -- to verify; seems to only count tiles coming onscreen.
end
end
end
Runtime:addEventListener( "enterFrame", moveMap ) -- Ran every frame.
My performance on a HTC Desire is still ~12 frame I think. (From a tester)
Is this good? (My tile map is 40x40 pixels per tile, 71 x 8 tiles = 568 tiles (Although about 2/3 of them don’t exist haha! Meaning they’re 00 tiles which don’t have images or physics bodies and don’t get placed down at all.) I hope to make larger.
I’m unsure if Corona’s culling is in effect for me, didn’t seem like it, didn’t know how to tell, I hope I’m not fighting it with my own Culling. (Build 840 - No Dailies)
Would it be possible for me to cull physics bodies?
They are Static and do go to ‘sleep’, does this mean they won’t hurt performance as much or does just being there hurt performance?
You don’t have to help me solve the issue, but would it be possible for me to do, or is it a Corona native thing that needs to be coded?
Thanks Matt [import]uid: 91798 topic_id: 30023 reply_id: 330023[/import]