Tile Passability and You

Hey all!

Does anyone know what distinguishes to the game/code the differences between Wall and Roof tiles in terms of passability?

By default, Roof tiles can't be walked on from a ground/grass tile unless it's from below:
(Can't from Above) ______ (Can't from the Side) __ (Can from Below)
NotFromAbove.png
_
NotFromTheSides.png
_
FineFromBelow.png

But they can be walked on from any direction if you're already on another Roof tile:
(Can from Roof)
FineWhenOnRoof.png
(And, likewise, you can't walk onto a ground/grass tile from a Roof tile unless moving downwards).



Whereas for Wall tiles:
You can't walk on or off them in any direction at all.
But both are represented in the Database with an X for impassability and no other visible signs affecting them.

Is it that Roof tiles are considered passable in the Game_Map isPassable(x, y, d) function from the direction (d) 2 (down) and walls are not, so that's all the game needs to know to distinguish the differences?

But if that were the case then it wouldn't explain how Roof tiles are passable from any direction when going from Roof tile to Roof tile and why that doesn't work for Wall tiles.

So yeah, does anyone know what's distinguishing the different behaviours for Roof/Ground(Grass)/Wall tiles here?
I'm getting really lost I think.

Thanks for any help on the topic!
I'm not sure how technical an answer you're looking for, because on one hand you're referencing a function from the code, but on the other hand you don't seem to know what's in it.

So the short answer is - this is intentional and it's hard-coded into the engine. It knows which are wall and which are ceiling tiles based on their position on the A4 sheet.

They're made this way so you can place ladders or stairs on top of walls and then be able to walk around on the ceiling tiles as a second layer, without being able to walk off of them through the walls or back onto the floor.

The bottom side is passable so those ladders and stairs will work; you're seeing yourself walk back onto the ground because you've built it wrong and you don't have walls underneath the ceiling.
I'm not sure how technical an answer you're looking for, because on one hand you're referencing a function from the code, but on the other hand you don't seem to know what's in it.

So the short answer is - this is intentional and it's hard-coded into the engine. It knows which are wall and which are ceiling tiles based on their position on the A4 sheet.

They're made this way so you can place ladders or stairs on top of walls and then be able to walk around on the ceiling tiles as a second layer, without being able to walk off of them through the walls or back onto the floor.

The bottom side is passable so those ladders and stairs will work; you're seeing yourself walk back onto the ground because you've built it wrong and you don't have walls underneath the ceiling.

Any level of technicality is fine with me! I've been spending the past day and a half looking into this and getting lost in the 16 bit tileflag data stuff while trying to find my answer lol, I'm game for technical answers as long as I know where to go to learn about them!

The thing that I haven't looked into in my rabbit hole-ing research I realise on reading your answer, is the basics of custom tilesets. I didn't realise the position of where your tile is on the tileset image you upload was used as an indicator as to what type of tile the game sees it as and what passability logic gets assigned (I'm assuming that's the case based on your reply here).

I'm aware I've "built it wrong" when it comes to how those rooftiles are in the images of the game, I was just using them like that to indicate the way they worked as a visual aid.

So are you saying that:
Position of tile on the tileset image dictates the passability rules that get assigned to that tile when that tile is placed in a game map? Do you know where that code's located if that's the case?

Or are you saying it's already in the code I'm looking at?
Man I'm so lost :/



Edit - I was totally looking at how tilesheets work all wrong lol, you answered it well, I was just being dumb/not in the know of the editor side of things (even the basics, oops)!
Do you know where that code's located if that's the case?
As I said above, it's hard-coded in. It's automatically added by the editor to the tileset flags when you specify an image to be in the A4 slot of a tileset.

I'm aware I've "built it wrong" when it comes to how those rooftiles are in the images of the game, I was just using them like that to indicate the way they worked as a visual aid.
And I, in turn, am aware of that 😛 But I mentioned it because you included "ground" in your list of tiles you didn't understand, and the ground has nothing to do with it. You can go down off a ceiling onto any passable tile.
The A3 & A4 sections in a tile palette comprise alternating rows of autotiles: wall-top, wall, wall-top, wall, etc. The help file has details on tile roles based on their position on a tile page, or you can probably find related tutorials on the subject~

Every tile on a map has directional passability flags (up, down, left, right). When you draw an area of wall-top tiles, the editor automatically applies the directional passability settings based on the autotile's current shape at that location. This is what causes the unique wall-top passability rules.

(There is a static method in rpg_core.js, Tilemap.isWallTopTile, that can be used to check whether a given tile ID is a wall-top tile. However, that method is only referenced by the unused isWallTile and isFloorTypeAutotile methods.)

[Edit: changed bold emphasis from editor -> shape, because the editor auto-shapes the tiles but it is the shape of the autotile that affects the actual tile ID and thus the in-game passability of that map tile.]
The A3 & A4 sections in a tile palette comprise alternating rows of autotiles: wall-top, wall, wall-top, wall, etc. The help file has details on tile roles based on their position on a tile page, or you can probably find related tutorials on the subject~

Every tile on a map has directional passability flags (up, down, left, right). When you draw an area of wall-top tiles, the editor automatically applies the directional passability settings based on the autotile's current shape at that location. This is what causes the unique wall-top passability rules.

(There is a static method in rpg_core.js, Tilemap.isWallTopTile, that can be used to check whether a given tile ID is a wall-top tile. However, that method is only referenced by the unused isWallTile and isFloorTypeAutotile methods.)
Brill, thanks!
It's hard learning things about an engine, so many places to look I find it easy to get lost.
That's exactly the thing I was missing on the topic by the looks of things!

Thanks for the help everyone!

I'm aware I've "built it wrong" when it comes to how those rooftiles are in the images of the game, I was just using them like that to indicate the way they worked as a visual aid.
And I, in turn, am aware of that 😛 But I mentioned it because you included "ground" in your list of tiles you didn't understand, and the ground has nothing to do with it. You can go down off a ceiling onto any passable tile.
( @ATT_Turan Fair point! Lol 😅 )
Does anyone know what distinguishes to the game/code the differences between Wall and Roof tiles in terms of passability?
their position within the tileset.
....like, that's it.

what you call "tile" is not really a "tile", it is the cut out from the bitmap that is represented on screen, which may change, while the memory space that IT loads into (the tileset) remains the same.
so, the graphic itself is irrelevant.

what's important is that tile's ID within the construct that is the map.
and that ID is given from the object tileset you're loading, IF the tileset fits a bitmap in that section (which, is rendered as the tile).

....and, it's not really "hard"coded, only the editor is.
you can still access the IDs and bend them at run time (if you know where to look)
Actually, yea, that's a good point; I think the emphasis in my previous reply may have been misleading. I've edited it to change the bolded word from editor to shape. 😴

Each shape of an autotile has its own tile ID, and each tile ID has its own directional passability settings. The editor assigns passability to each shape of each autotile, and automatically reshapes them when you paint with them (unless you're holding shift).
It would probably help to explain why this is coded in.

This effect allows you to simulate a two-level dungeon on a single-level map.

in a regular map, you'll have one ceiling tile above two wall tiles to represent the walls - that is why in such a map you can't get on the ceiling tile, the access from below is blocked by the regular wall.

however, any override on the wall will allow you to get to the top line of the wall, the ceiling tile - this is intended to be a ladder but unfortunately any passable upper tile will allow this.

So in a dungeon map you can "climb" on top of the walls and use that to walk there, effectively giving the map a simulated second level to climb and get down from to pass the maze.
It would probably help to explain why this is coded in.
They're made this way so you can place ladders or stairs on top of walls and then be able to walk around on the ceiling tiles as a second layer, without being able to walk off of them through the walls or back onto the floor.

Original thread: https://forums.rpgmakerweb.com/threads/tile-passability-and-you.173219/