Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

2D top down assets: Tiles or prefabs? Artist wants to set up mapbuilding assets for ease of use

A topic by Revington created Feb 01, 2022 Views: 435 Replies: 2
Viewing posts 1 to 2

If you don't want to read, please just a quick vote on tilesets VS prefabs for terrain, floors, tall walls and objects.

I am creating 2D top down tilemaps and I'd like to set up the art in a beneficial way to the programmers.

I have been trying to work out a general pipeline used, but it seems there are still limitations in Unity when it comes to working with tilesets and rulesets. With it's existing tools it doesn't come close to the ease of Tiled editor map creation and tile replacement. But maybe a programmer would prefer to tackle the ruleset/automap issue with scripts, rather than another program.

I'd like input from the scripting wizards out there. Basically, how can I prepare the 2D top down assets so they're not a headache to use?

--CURRENT PIPELINE--

Tiled (map creation) > SuperTiled2Unity (import maps and replace objects with Unity prefabs) > Unity (Map split into layers, SortingLayers/OrderinLayer all sorted, prefabs already set up)


--MAP CREATION WORKFLOW--

In Tiled editor, use ground lvl input for floor, walls and objects (*see INPUT on image). That automatically generates the right tiles for floors and walls and puts them in the correct map layers with SortingLayer/OrderinLayer assigned (*see OUTPUT v1 and v2 on image). Objects (signs, chests, trees) are automatically replaced with prefabs on import to Unity using SuperTiled2Unity. You can also add your own placeholders to be replaced by any prefab you want in Unity, or change Sorting/OrderinLayers. Object prefabs can also be added directly in Unity, of course.


--WHAT TO DO WITH TALL WALLS--

The walls more than 1 tile high can be done in 2 ways:

1) WALLS AS PREFABS (*OUTPUT v1* on images)

You input the ground wall tiles in Tiled. On import to Unity the placed walls can be replaced with tall wall prefabs (32x128). This would allow for pivot point edit and therefore more precise control of wall flipping in front/behind character. As far as I understand it also allows for referencing those objects with scripts, if you want to make the wall disappear etc.

2) WALLS AS TILES (*OUTPUT v2* on images)

You input the ground wall tiles in Tiled, and this automatically builds the taller wall tiles and sorts everything of the same height into the same Z-layer. On import to Unity it places tiles into map layers with set SortingLayer/OrderinLayer. Custom Sort Axis has to be set to y=1 z=-1 to have the character sort correctly in front/behind.

In this case all the walls (or just the wall collision) would have to start at the exact bottom of the tile, otherwise the wall flips over the character because of it's default an uncheangeable pivot location, as seen on the Unity comparison image.

--OTHER QUESTIONS--

What do you prefer being tiles and what prefabs? I assume terrain and floors should be tiles, and objects prefabs. I'm fuzzy on the tall walls and fences. Is it even beneficial to have the wall as prefabs if the prefab is not the entirety of the wall but just a one tile section?

Would handling hill terrain layered as tiles cause problems together with walls as prefabs somehow?

How would I build the tilesets, prefabs and mapmaking so that it allows for scripting to be done in Unity for in-game building?

How would the shading be handled with tiles as opposed to with prefabs? My plan was to make assets base color and for each create 4 light/shadow overlays. Would that work?

Any other tips to make the assets and the mapbuilding ideal for you?


Thank you for your time ~

(+1)

Here are my tips for artists creating tile sets, as a programmer who often makes tile based games, and is always looking for good tile sets. (Though maybe I'm not answering your specific questions...)

- Set it up with things like Tiled terrains in mind (are all corner types and transitions present?)

- Any prefabs you add for specific engines like Unity are a nice bonus, but many devs won't need them.

- Don't forget the typical tiles that many people want: some lethal tiles, some ladders, some doors, etc. No matter how good your tile set looks, this is what decides whether people will actually use them.

- Use bright colors. In most engines it's a piece of cake to make colors darker (or even just one color channel), but making them brighter requires specific shaders or changing them yourself it in a sprite editor.

- (This is less relevant for tile sets, but more for sprite animations, where it's often done wrong): Put your tiles/frames in a regular grid. Not all engines can work with texture atlases, and texture space on GPU is cheap anyway, for 2D games. (And if you create a non regular sprite sheet without providing an xml, like many on Opengameart, it's completely useless...)

As an example, see www.kenney.nl : many of his assets are quite basic, but they follow nearly all of the above tips, so they're very widely used.

Personally, I always use Tiled for 2D, in Unity but also in other engines. I even wrote a tool that modifies Tiled files using WFC, for automatically decorating greyboxes. See:

Finding well made and complete tile sets is always a hassle...

Regarding layers in Tiled, and (large) objects vs tiles: every game I make uses it's own conventions. Just make sure your tile sheets work for all cases (so if it should work for both 32x32 and 64x64, don't put corner points of tiles at 16 or 48).

(+1)

One more thing: there are many tile sets out there that consist for example of some nice platformer tiles, and then one beautiful hand drawn prop like a tree. If you use that tile set to create a level, you'll see that one tree over and over again. I much rather have some tree parts that connect in different ways, that can be used to create an infinite variation of trees, even if they're slightly less beautiful. It seems that some artists (especially for free tile sets) are focusing on creating a single nice painting, instead of creating a useful tile set...