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

Author Topic: Tile Engine question  (Read 1226 times)

0 Members and 1 Guest are viewing this topic.

krisztian

  • Guest
Tile Engine question
« on: October 30, 2014, 09:06:15 pm »
Hi, everyone - I'm new here and I just moved to sfml. I'm using Ubuntu 14.04 for Linux development.

I would like to know if anyone has some drop in source code for a simple tile engine setup done with sfml, that i can try out.

I'm looking at the documentation and I found some interesting notes. Such as using more sprites than actual textures. I'm assuming large texture atlases would be needed to keep the graphics optimized. How would this look in sfml code. How do you guys organize this in the intitial setup.

krisztian

  • Guest
Re: Tile Engine question
« Reply #1 on: October 30, 2014, 09:11:21 pm »
My question was premature, I will look around more (I just found the vertex-array tutorial). However, if anyone has something to add to this, that would be nice also.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Tile Engine question
« Reply #2 on: October 30, 2014, 09:12:12 pm »
The tile map example from the tutorials is probably the closest thing you're going to get to an actual answer: http://sfml-dev.org/tutorials/2.1/graphics-vertex-array.php#example-tile-map

I believe there is also a program called "Tiled" http://en.sfml-dev.org/forums/index.php?topic=3023.0 that was written (rewritten?) in SFML, though I'm not sure if it's a "tile engine" since I've never heard that term before.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Tile Engine question
« Reply #3 on: October 30, 2014, 09:28:09 pm »
Tiled is a tile map editor (and a quite nice one), not a tile map engine.

krisztian

  • Guest
Re: Tile Engine question
« Reply #4 on: October 30, 2014, 10:06:28 pm »
The vertext array tutorial helped. I do know about Tiled editor, thank's.

So, a quick question. If I have an animated character set, let's say 100 tiles. Do I want to combine other characters, or is it still efficient for each character to use their own texture. I mean, what is the maximum size bitmap I should use as a texture to keep the performance up.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Tile Engine question
« Reply #5 on: October 30, 2014, 10:14:55 pm »
It's less a question of what texture size is performant than what size is possible. There is a hardware limit that cannot be exceeded, accessible by sf::Texture::getMaximumSize().

As a general rule, if you can combine multiple images in one texture without worrying about that limit, then do it.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: