1
\$\begingroup\$

I'm creating my first tilemaps.

Tutorials usually do 32x32px (example), but this tutorial did 128x128px, which made it easier for me to see without zooming in so much.

In tiled, I did a 40 x 40 tile map at 128 x 128 px, and the map was 5120 x 5120 px big, versus the same 40 x 40 tile map at 32 x 32 px giving me 1280 x 1280 px in resolution. I'm making a web game from the typical HTML 5 (with canvas), JS, CSS3, and melonJS engine.

Does it matter if I make 32 x 32 px tiles vs 128 x 128 px? Will it affect performance?

\$\endgroup\$
  • \$\begingroup\$ AFAIK, images with dimensions which are of power of 2 should give better performance during runtime. There are some extra tips from Google on this issue. Hope it helps. \$\endgroup\$ – S.C. Jul 24 '14 at 3:29
  • 1
    \$\begingroup\$ See my answer at gamedev.stackexchange.com/questions/6678/tile-sizes-in-2d-games for an analytic answer to this somewhat subjective question. \$\endgroup\$ – Tim Holt Jul 25 '14 at 18:06
  • \$\begingroup\$ @TimHolt exactly what I was looking for... I upvoted that answer... thanks :) \$\endgroup\$ – Growler Jul 25 '14 at 19:13
2
\$\begingroup\$

That's purely a matter of personal preference. Unless you are going to extremes of some sort (too small or too large), that aspect alone won't affect performance. Of course if you have same count of tiles, larger images will naturally consume more memory and, generally, perform slower.

As a side note, assuming you are beginner in a gamedev, most performance aspects should be absolutely ignored, unless you immediately see serious perfomance degradation. I'm not saying they are not important, but often they are overestimated.

\$\endgroup\$
  • \$\begingroup\$ In fact it is not a matter of personal preference. See answer at gamedev.stackexchange.com/questions/6678/tile-sizes-in-2d-games for an analytic answer to this somewhat subjective question. \$\endgroup\$ – Tim Holt Jul 25 '14 at 18:08
  • \$\begingroup\$ @TimHolt sorry, I don't find your answer to be more analytical, because So decide how many tiles a player should see at once is essentially the same as personal preference. I would also notice that question was about performance, not about tile size in general. \$\endgroup\$ – Petr Abdulin Jul 27 '14 at 2:02
1
\$\begingroup\$

Its really a matter of how much definition you want in your map... If you choose 32x32 px you'll mostly end up with Pixel Art. If that is not what you are looking for, just pick a bigger size. As long as it is a power of 2 and its not an absurd HD size just for one tile, it wont really affect performance.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.