I had a conversation with silver-Streak on Discord about possible ideas about “TileMapMask” and “TileMap” simultaneously.
We currently know that the version of “TileMapMask” is in EXPERIMENTAL state, and as we have seen, it works very well.
But how does it currently work?
1 – When creating a collision in Tiled, we are forced to put in the CLASS parameter the name of the collision that will be created in Gdevelop. This CLASS can have any name at first, however, this name used in Tiled must be placed in the “TileMapMask” by Gdevelop.
2 – So if we have more than one type of collision, we must create more than one “TileMapMask” for each one, which happens with JumpThru, Ladder and Platform.
3 – Now, if you create a game with several rooms, or even huge rooms, with several objects in the scene, it becomes kind of frustrating. See the example of my game if I were to use the “TileMapMask”:
What would happen if I had all 3 Behaviors in every room? Unfortunately, I would at some point get lost in the placement of some collisions, what if I had placed the collisions above objects? If I were to move an object I would be forced to delete the collision masks or move them to the side. Not to mention that I would have to create 36 more “TileMapMask” which would not be pleasant.
The idea behind it all!!
When we create a collision in gdevelop through the “TileMapMask” what happens in practice, it is almost the same thing as creating a normal object and placing it as a platform (jumpThru or Ladder), as we did before version 139 (138?).
So what FACT changes in this type of collision, is that gdevelop recognizes and “draws” according to the collision shape that was placed in Tiled.
But in that case, how do I believe it should work? Well, my opinion is to do the same rule that the user “Pandako” did with the extension “TileMapCollision”, but in an automated way and following the rules of D8H. What makes the version of “Pandako” have a bad side, is that if our “TileMap” has several layers with collisions, the original version of the extension does not do that, because it only works with 1 layer per “TileMap”, but in this case I adapted it myself and it worked perfectly.
Contrary to what D8H did, it does not use CLASS but the name of the created collisions. However, adapting to the ways the two developers did with collisions would make everything easier to work with and much more robust.
As:
• Use the “drawing” version that the D8H made, as well as the automatic creation of collisions
• Use the creation of objects that Pandako did through TileMap, but without the need to create them manually
• The “TileMapMask” could be a BEHAVIOR instead of being objects, and with that link to the “TileMap” only
• In Tiled, when putting a name on the collision we want, it would be interesting to follow the rule of gdevelop itself, how to use only: Platform, Ladder and JumpThru instead of the user writing any name that comes to mind, this would be easier at the time of programming inside gdevelop, because the user would be forced to put the correct name that must be read by gdevelop.
I understand that it can be a bit of work, and sometimes not so much, because both solutions are there, just both developers talk and reach a consensus to improve collisions even more.