>>1612
I think I posted about same exact problem multiple times.
The simplest solution is to have 1 sprite per coordinate, and nothing goes outside of tile borders. And you dont need to sort anything, just render decorations on top of each other, in added order. And you can store "wide" sprites in the lowest part of the coordinate grid, so they are rendered the last, and that they are actually part of the floor layer.
Ultimately it depends on the amount of stuff you need to render. If its 100 decals per map chunk, all of which are in the same RENDER order layer, you can store them as a simple array and sort it once. It all depends on number of tile variations you have.
Decorations are just a rendering order problem.
You probably should just use the most simple approach. Background "skybox">Floor grid>Wall grid> few Decal layer grids1[x][y] drid2[x][y]>Shadow layer>Actor layer. When you start to think about it, it doesnt work perfectly, and shadows especially start fucking up, but its not that big of a deal. And most of these matrixes are empty, but its not a big deal, because you can always change it later, when you know how much data you have to worry about.
I spoke about it before, but in CNC2 shadows look in random directions, and in diablo 2 flames have shadows.
>player edited
>placing stuff below
Without proper Z level system, even with a few layers of decal grids, its too much to ask. The best you can do, is have your procedurally generated/loaded map, load as usual into memory, and have a list of player edits, to modify it, loaded afterwards. Yes, all of them at the same time, after each minor change. And its okay, because you dont know if it even will be a performance hit, you just theorize it will be slow because worrying about "but what if he made a million changes to the map" is pointless, before you even know how bad it is. You optimizing them, before you even have any of them.
You trying to fit unknown number of tiles, with unknown shape, into unknown number of containers.
>>1613
>rendering at once
Doesnt work, if you have lighting system, you cant render part of the image brighter or darker, without chopping it during rendering. You can make it "per room" system, but it overcomplicates things.
>>1615
>impossible in this configuration
Normally people just pre-render all of literal edge cases.