When I have multiple background images in my platformer game like rocks, trees, etc. that are not interacted with, what is the best way to add them throughout the map?
It seems like using separate “image” layers for each instance of a tree or rock would get out of hand very quickly.
I’ve read in the documentation that using an “object layer” is good for this task, but the game engine I’m using (Monogame + Monogame.Extended) seems to have chosen to ignore the object layers for rendering purposes (see this forum post).
So I suppose that leaves me with using a normal “tile layer”… However, do I really need to create a “tileset” for every single thing I want to place on the map to do this? That seems like it would lead to an extra step for every asset I create, a lot of file bloat, and is going to make my tileset selection window super crowded – it will take quite some time to sift through all the placeable items mixed in with all the actual tilesets!
If creating a tileset is a requirement, though, I can probably deal with that. However, is there anything I can do to streamline the process? Each item really should just be one tile, so that means I would click “new tileset”, select the image, and then…? Is there a way to say “make this one tile” without opening up the image file, checking the dimensions, and manually typing them into the boxes?
Any help would be appreciated, even if it just means confirming that there’s currently no easier way than what I’ve specified above. I’m just trying to make sure I’m doing things in the right way, and that there isn’t some more efficient method I’m not aware of
You should make an Image Collection. This is a type of Tileset where each tile is a separate image, so you can have all your different files in a single tileset.
Even if you use Objects, you’d still need a tileset, by the way. As for rendering: generally the expectation in game engines is that Objects represent dynamic entities, so that’s probably why they’re not rendered by default. That doesn’t mean you can’t render them. But, if having the tiles along a tile grid is fine, it’s best to use a Tile Layer.
Wow, I’m not sure how I didn’t run into that in the documentation, that’s exactly what I was looking for!
… unfortunately there appears to be loads of display issues within the Tiled editor with including very large images this way (like 700x700), is that a known issue? Like, placing the large image as a tile appears to not really work (it only shows the bottom 1/4 of the image) until you scroll away from it and scroll back to it, and then hovering over parts of the tile with your mouse makes squares of it disappear until you scroll away and back to it again. If that makes sense. A bit hard to explain exactly.
Fortunately, this doesn’t affect how the map is saved or how it renders in my game, though.
Anyway, this is much easier than what I was going to try to do. And for very large images like this, maybe I’ll end up just sticking with the “image” layer feature, and use the tile layer for the collection of many smaller background objects.
Are you perhaps running into this issue (disregard the name of it)? Visual issues when adding a new Tileset to a map, causing it to disappear. · Issue #3440 · mapeditor/tiled · GitHub
700x700 isn’t a “very large image”, but if it’s much larger than your tile size, perhaps Tiled doesn’t realise it needs to be repainted when it’s in a different chunk from what’s being redrawn at the moment. If the comment I linked to sounds like your problem, please consider posting there to mention it (or, if you don’t have a GitHub account, let me know and I will post for you with a link to this thread).
If this can’t be fixed soon, consider using Objects instead of Image Layers. That way you can still have just a single layer for all that stuff instead of needing a lot of layers. That will mean rendering them “yourself” though, since Monogame doesn’t draw them by default. I’m not familiar with Monogame so I can’t provide details, but you can either draw them as sprites the same way you draw your player, or you can probably find a way to create a Tile Layer-like structure out of them since these “objects” are all static (which should perform better). Writing some code to render cosmetic objects like this is some up-front work, but it’ll probably take less time than creating image layers for every single large prop in the long run.