I'm coding an isometric game in c++ with SDL. My question is this: At the moment, every cycle the game redraws the entire map layer by layer, inserting actors and cursors and so on at the appropriate time. Would it be substantially faster (or better for some other reason) to instead have a big surface for each level generated at the beginning, and blit each layer all together instead of drawing it tile by tile.

Thanks for any responses!

  • 3
    \$\begingroup\$ Is it a bottleneck? I would, as most people would, warn about early optimization. Just code your game. If you figure it out later that its a bottleneck then sure fix it. But a couple hundred extra draw calls a frame for sprites is not going to make a huge difference on most modern platforms. \$\endgroup\$ – mobo Jul 20 '13 at 20:53
  • \$\begingroup\$ Alright, I'll wait until it becomes an issue. Thanks! \$\endgroup\$ – Matt Grimes Jul 20 '13 at 20:57
  • 1
    \$\begingroup\$ Be wary that this is a balance between memory usage and speed. If you were to use too much memory, the game would run even slower. \$\endgroup\$ – jmegaffin Jul 21 '13 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.