Categories
Projects

BattleGrid Update – Screw Draw Calls

Trying to get my draw calls down is extremely frustrating. I’m slowly learning what I’m doing that’s causing the batching to break, but I’m also finding out that some of what I want to see (draw call wise) simply isn’t going to happen.

I just found out that the vertex buffer for draw calls is around 4000 vertices (at least as of 2009). For a 30×30 map, my grid alone is 3600 vertices (900 grid tiles * 4 vertices per tile). For a 40×40 map (my largest maps), that comes out to 6400 vertices – already too many to batch. So, trying to get my terrain and structures to batch together is futile anyway. On the other hand, it seems like I should still be able to get down to just a few draw calls. Even if I max out that vertex buffer each time, I should still only be making about 4-5 draw calls, not the 86 I’m seeing. Those 80 extra draw calls are really causing me grief, and Unity can’t be so stupid about ordering things that it can’t properly organize the batches…

So for the time being, I’m going to forget about draw calls and get back to the fun stuff – AI and bug fixing. I’m going to do some optimization to the AI to get it running smoother, then fix the few things that are still slowing things down (like rendering map previews). Maybe I’ll also take a stab at the map submission website. Anything to get my mind off those damned draw calls.

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.