Thanks for the detailed explanation!
very smart on using an example! so i’m going to do the same to explain!
332 is a small enough example and good
i am actualy saying change the index to a 2d element instead of 4 use (4,0) and 13 would be (4,1)
now the tricky part might seem that path finding would have to change dramaticly but no! because in the same way 4 shares an edge with 1,3,5,7 it shares and edge with 10,12,14,16! or in the 2d way (4,0) and (4,1) both share an edge with {(1,n),(3,n),(5,n),(7,n)} n being the floor number in this case 0 and 1.
but obviously two tiles on top of each other share any edge but you would simply always consider it null or zero (none passable)! now for the search load in identifying all of the edge costs!
ok i am horrible at explaining so i’m going to upload a photo of a test map the same size you said 332 and this explanation is for that!
(i am not going to consider how your system acts with tiles out of the maps borders as i don’t have it in mind and i am not going to consider diagnal movement either it is a complication but i don’t think it could break any thing)
for the sake of this example i am going to consider that edges have the same cost of passage between two tiles example : going from tile a to tile b has the same cost of going from tile b to tile a (two tiles share an edge)
so a default tile will share an edge with every tile around it on the same floor with the cost of one (if they are default tile) and share an edge with every tile around it on its top and bottom floor with the cost of ( none passable) considering they are default tiles. As a default grid map would act in this example a 33 grid floating on top of another 33 grid
in this example I have made 5 of the second floor tile into nothing tiles which share an edge cost of 0 with every thing and I have added two walls making the cost between two tiles on the floor it is on into 0 and between the same tiles and the tiles in front of them but in the upper level also zero in other words:
(0,4)<->(0,5) cost = 0 / (0,4)<-> (1,5) cost = 0
(0,7)<->(0,8) cost = 0 / (0,7)<->(1,8) cost = 0
and one wall ladder that makes the cost between the two tiles on the same floor equal to zero but for one of the possible routes in between levels it makes the cost 1 or any number meaning passable!
In other words:
(0,0)<->(0,3) cost = 0 / (0,0)<->(1,3) cost = 1
So later when path finding check costs and it reaches (0,0) and it sees the cost of one it will add (1,3) as a possible destination and reachable tile
Now I now there is a lot to talk about doing to do with optimization for example right now in a 4 square grid not considering diagonal movement for a two floor map the checks will get twice the size for each tile!!! For a 3 floor map saying we might want something like a ladder connecting the first and the third it woulf be three times the checks and so on and so forth so I think it woul be much better to have an outer level reach check of some sort but in the end we are talking about a three floor level the summed checks would already be a lot if the three floors where put next to each other.
If I was still not able to give a good explanation please pm me and we can talk over it on skype