I need some help with Tiled Map Editor

Discussion in 'Public Game Developers Forum' started by headcaseGames, Mar 10, 2012.

  1. headcaseGames

    headcaseGames Well-Known Member

    Jun 26, 2009
    1,869
    0
    0
    Mobile Game Developer
    Hollywood, CA
    really enjoying this editor for level layout, however as I'm designer only (not coder) I have a few issues that aren't immediately clear to me. We're still figuring out our pipeline and so I thought I'd ask some folks for a few basic rules of using this program. I've looked around online and, surprisingly, FAQs/etc (for non-coders) regarding Tiled are not very easy to find.

    The main questions I have are concerning Tile Layers vs Object Layers. Consider that I am build a basic 2d platformer - obviously, I will lay out the non-interactive 2D elements on the tile layers, likewise all the platforms you will jump on and so forth. For interactive items/enemy placements/etc, I'd suppose you will put them on the Object Layers - is this correct? For those of you familiar with this stuff, would you just put a lot of those interactive elements as simply tiled layers as well?

    I am very foggy on what "object layers" actually mean - I see them being used as "start points" and such in actual examples I have been lucky to come across. Any further explanation for us laymen would be a huge help. Let me know what you think, thanks for reading!
     
  2. ChaoticBox

    ChaoticBox Well-Known Member

    Oct 8, 2008
    878
    6
    18
    Male
    Developer
    Toronto Canada
    Tiled is an intentionally generic editor, which can be a good or bad thing depending on your point of view. So the only real answer is "use whatever works" ;)

    Object layers are great for what you've described, especially for anything that needs to be positioned off the grid or requires unique properties. Objects can also do things tiles can't, like define polyline/polygon shapes for physics or triggers.

    Tile layers can work just as well for objects that are grid-aligned though - especially for stuff that repeats a lot, like coins or other static pickups. It's really up to you to decide what works best for your game, and/or what works best with your code/engine.
     
  3. headcaseGames

    headcaseGames Well-Known Member

    Jun 26, 2009
    1,869
    0
    0
    Mobile Game Developer
    Hollywood, CA
    thank you CB!
     
  4. CharredDirt

    CharredDirt Well-Known Member

    Hey there, I'm mostly in the same boat. Non-programming developer using tiled.

    One thing I've learned about Tiled is that just because you can do something in Tiled does not necessarily mean that that particular feature is supported by your game or framework. We're using cocos2D so I've had to work around restrictions there a bit. (like using one texture map per layer)

    Best thing I can advise, is before you get in too deep, sit down with your programmer(s) and figure out what you can or can't do. Let them figure out what types of things they want to include on object layers and then have them show you what you need to do to make the map. You can't just wing it. Objects need to be purposeful and just what the programmer needs.

    Also, hop on IRC, channel #tiled on Freenode. There's a guy there by the name Bjorn, he's the main creator of tiled and he has been extremely helpful when I had questions about the program.
     
  5. dannythefool

    dannythefool Well-Known Member

    Dec 16, 2010
    401
    0
    16
    Germany
    Ok, first off, like others have posted before, you really need to get together with the person(s) who do(es) your actual coding to figure out what kind of maps they expect. Tiled is fairly flexible and you'll all need to have at least a rough idea of how you're going to use it. Especially object layers offer a tonne of possibilities that the engine has to specifically support, for example it may make sense to only allow rectangular objects.

    One major difference between tile layers and object layers is that object layers are free form, whereas tile layers restrict you to putting tiles on a grid. So level backgrounds and static (non-animated) parts like blocks you can jump on in a platformer make the most sense in a tile layer, as collision detection is way easier against a grid, and you only really want to do that based on sprites if it's necessary because both colliding objects move around.

    The object layer on the other hand is basically a bunch of free-form regions in the map that can have types, names, and properties. You can also put tiles in object layers, they'll work somewhat like rectangular regions with a pixel image. Ultimately it's up to the coder what happens with the objects in an object layer. Marking the start and goal area of a level is the most obvious example. Animated platforms, monster spawn points, and generally things that you'd think of as living on top of the tiled background map are also good examples. In a platformer this also includes items the player might collect, like floating golden coins. Or you can use them for other types of regions that you want to mark in your level, for example if you're building a platformer that uses a physics engine, you might have regions where gravity is reversed. You'd create an appropriate object type in tiled, make a rectangular object with that type, and the game would then have to periodically check if the player is inside an object of that type, and if so, apply an upward force. Another example for a physics based platformer could be the rigid objects in the level, since physics are complicated and you don't want to handle each individual tile as its own actor: You can use objects to mark regions the physics engine should treat as rigid bodies. Yet another example would be regions where the player is supposed to take damage, if you don't have that information in your tiles or want to keep it separate for some reason. Or you can use them to mark teleporters, and put the destination in an object property, and if you use an object to mark teleport destinations too, then you can use the name you assigned to a destination to hook them up and the relationship will survive if you move them around. And the same thing also makes sense for switches and doors, and so on.

    I think the main problem with object layers is that you really, really need to know what kind of objects the game will support. You can always make tiled layers and treat them like pictures that'll just be displayed like they look in the editor, but for object layers, you need to have some rough idea of how the game is going to work and what kinds of regions you want to mark. Maybe it's a good idea to get out a piece of paper and a pen and draw a level that you think will be typical of the kind of game you're going to make. Then separate it out into static bits and background, and objects that live on top of it (golden coins, movable platforms, enemies), or objects that need to have a relation described with another object in the scene (buttons, teleports), as well as regions where you just need to know where they are (start and goal areas).
     

Share This Page