The tilemap implementation is (seemingly) terrible

I have read older threads claiming there are issues with the tilemap, and usually the reply is that improving it is in the backlog, but after now having tried it I’d have to say that it NEEDS to be fixed.

First let me say I just started using it, so let me know if I’m missing something. However, if I am, then some things are not intuitive and that may be an issue in and of itself.

Anyways, first things first: The current (small) set of tilemap features dont seem to be integrated in the editor. I cant find a way to flip tiles, except in code. I could just be missing this functionality though. (For the record having to hit space to bring up the palette is incredibly obtuse, and one shouldnt have to read a long manual to find that out)

Ok and now by biggest issue, the lack of features is bad, but from what I can tell the only way to set the bounds of a tilemap is by actually drawing the tilemap in the editor. So if you want a 10x10 tilemap you have to draw one line thats 10 tiles on the x axis and similar on the y axis. You can then “erase” these tiles by drawing over them with an empty (transparent) tile, which doesnt actually seem to “erase” anything at the core, but removes the graphical representation. Congratulations you now have a 10x10 tilemap you can work with procedurally (well or maybe 11x10 if you messed up… no way to tell but calling get_bounds then starting over).

I have never seen anything this wonky in a game engine before. Its awful. Now this affects me personally since most my projects would involve a tilemap of sorts, and if I had started with this feature when I first encountered the engine I would have dropped it immediately. Tilemaps are a very common game construct and I cant imagine this not scaring people away as it gives the impression of an incompetent team. I luckily didnt start with tilemaps, and have seen how well functioning parts of the engine work, so I want to stick with it; but if that had been my first impression I’d be back to godot or something.

edit: It seems like the tilemap was only meant to be used at design time… but plenty of games are going to need an implementation that allows for robust runtime manipulation

edit: I should probably give a recommendation for how to make this better, but that’s up to the team. At the very least we should be able to just specify a width and height in the editor (and in script). I’m not sure how that would work with the tilemaps (strange) support for negative cell values, but I’m sure that something can be done. (One could just set bounds for instance)

2 Likes

If you don’t need huge tilemaps you can use gameobjects with sprites instead. Then you can have sizes more easily dynamic and flip the sprites too. Have a single controller which manages all of the GO tiles with sprites on them.

Well of course, but that doesn’t address the core issue at all.

I honestly doubt tilemaps will be changed soon so it’s what you’re going to have to use. I had same issue when I started, and when I needed to in projects I just used GOs instead.

Search here to see if issues for each feature have already been made and if not make them so they’re being tracked https://github.com/defold/editor2-issues/issues

Also most engines do not have such tilemap features. It’s usually left to the user to make from more primitive building blocks. The reason for Defold’s tilemap constraints is based around how tilemaps work - they are a mesh in engine. Hopefully the issues can be addressed at some point…

This isn’t about what my options are. It’s about letting the dev team know that this is likely to scare people away.

The bit about “most engines” is simply false.

Anyways, thats my two cents on the tilemap, and I dont think workarounds cut it.

3 Likes

Well, there are many, many areas to work on. We prioritize mainly based on need from all our users and everyone has different needs. If you feel an area needs work, post feature requests, preferably with your use cases. See the link @Pkeod posted.

2 Likes

All of the ones I’ve used have you draw sprites raw. Some of them wrap that functionality so you draw to a cell, but it’s still drawing sprites to a canvas. I don’t know of any others which use Defold’s mesh approach out of the box.

Maybe a “tilemap with GOs” helper module would be useful for someone to make for the community. I have some useful code for it I could put together but I’m a little busy right now.

1 Like

Well thats cool, but I really am new to the engine and dont understand it enough to make any real recommendations. When I get some time I may make a post detailing what I’d expect a minimum viable tilemap to be.

edit: apparently I need to learn how this forum works first :stuck_out_tongue:

2 Likes

Welcome aboard! Spend time learning the engine, build a game or two and keep us posted on your progress. We want to hear more about pain points our teams experience during production.

4 Likes

I can agree that the tilemap is very basic and I though it has some really great/advanced features that I havent seen well implemented anywhere else (like the generation of collisionshapes) it lacks certain very fundamental features. (Yes it wouldn’t be hard to have a tilesize param set in the properties of tilemap instead of setting out tiles).
It is also only one way of creating a tilemap, a single mesh where all tiles are being rendered always, and leaves out dynamic tilemaps, isometric etc.
Working with the engine for a while I have l learned when it might be suitable to use it and when it’s preferable to create your own system (which is not hard at all in Defold) using data from Tiled or similar 3rd party tool.
Defold has never claimed to be giving you all the finished solutions for a specific games but rather the tools to build it yourself.
Remember Unity released its first version of tilemaps in 2017.2 so claiming that it is a very standard thing in other engines is really not true either :slight_smile:
Roll up your sleeves and create your own. I’ve done a few dynamic ones that is lightingfast with gameobjects/sprites and gives you more control over everything you would like to do.

6 Likes

Comparing an engine that focuses on 3d, to one that focuses on 2d isn’t very fair when talking about 2d features. Unity being the indie standard also doesn’t give it extra weight in a discussion on whats standard in a game engine. The majority of 2d focused game engines I have used have functioning tilemap implementations.

Its besides the point anyways. Tilemaps are in defold and they are garbage (imo). If the engine has the feature it should be done correctly, regardless of whats standard in other engines. It would be no different if it were some other non-standard feature. Pathfinding, voronoi diagrams, perlin noise generation, some scripting oddity… if its part of the package it should work. I know its an unpopular opinion, but Id go so far to say that the current tilemap implementation shouldnt even be available for use.

edit: anyways im not going to keep belaboring this. Ill leave it as ive written, and eventually offer what i would consider a good solution.

1 Like

I agree with most of your points @dakasha, but I would never find this true for any single feature. A MVP is a lot better than nothing, I can work with an MVP. Someone, as you said, might be scared away with how ‘bare bone’ the current tile map system is and switch to a different engine. And that would be totally fine, if there is a better tool for their specific game they should switch. Not to mention the user that would have been scared away because of that system would be equally scared away if it didn’t exist.
Even though the tile map needs improvements it is for many games adequate and adds value. As an example the game my team is working on is using it, but only for a tiny part of the game. It made that single thing it is used for so much simpler to build than if the feature wouldn’t have been there.

As a side note; I guess discussions like this is why you don’t like forums :slight_smile:

10 Likes