Categories
Projects

BattleGrid Update – An Epiphany

So I finally had that epiphany I was hoping for. I should have expected it to come to me as soon as I decided to quit working on it…

I was reading over my last post (in which I decided to quit working on draw calls) and I realized that the majority of the vertices in that vertex buffer are used up by my grid tiles. Although each individual tile only has 4 vertices, the map as a whole uses up a large chunk of the 4000-vertex buffer. My problem was that I was trying to get everything into a single batch – it’s simply not going to happen because there’s too many vertices to batch. So I decided to try something slightly different. Instead of trying to batch everything together, I’ll batch all the tiles together, and all the structures separately. And today, after about 3 minutes of work setting up a new material for just the tiles, I’m down to around 20 draw calls. Well within the iOS “limit” with room to spare. So I’m happy and I can still move on to doing more interesting things.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.