Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Should every TileMap layer be composed of tile vertices?  (Read 1196 times)

0 Members and 1 Guest are viewing this topic.

hal1001

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Should every TileMap layer be composed of tile vertices?
« on: July 14, 2014, 10:39:07 pm »
I was using this example for some time in getting my feet wet, and it worked well with a single map layer:

http://www.sfml-dev.org/tutorials/2.1/graphics-vertex-array.php#example-tile-map

However, it got me wondering why I wouldn't just have a small subset of large textures or backgrounds that I layer as graphics for a level. This presents the general concept:

http://gamedev.stackexchange.com/questions/62391/whats-the-purpose-of-layers-in-map-editors

Does this have to do with memory and graphic's card constraints? If I had multiple layers, should each layer still be composed of a collection of tile vertices? Why not redraw each layer as a large graphic?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Should every TileMap layer be composed of tile vertices?
« Reply #1 on: July 15, 2014, 12:01:21 am »
Quote
Does this have to do with memory and graphic's card constraints?
Yes.

Memory: using big images with large transparent portions wastes memory; and since SFML doesn't use compressed texture formats it's even worse. And you duplicate tiles that appear several times on the layer. But it could be ok, it's not as if you had hundreds of those layers.

GPU constraints: this is the blocking point. Today's graphics cards can probably support textures up to 16384x16384, but with old or crappy ones it may be as low as 512x512.
Laurent Gomila - SFML developer

hal1001

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Should every TileMap layer be composed of tile vertices?
« Reply #2 on: July 15, 2014, 03:04:12 pm »
Thanks for the quick reply and confirmation Laurent. I didn't want to start going down that route only to find out I had misinterpreted the answer on the gamedev stackexchange.

 

anything