@Halfer : from the qhimm wiki :
The backgrounds are actually 16x16 blocks that are loaded into VRAM and then assembled into the video buffer every frame. The system allows for layers to obscure the 3D entities using a simple painter's algorithm
Painter algorithm means you first render distant parts then parts which are nearer thereby covering some areas of distant parts.
So order is very important. It will make some 3D objects of the field (eg : characters) appears behind or above the tiles depending of that order.
In case of FF7, you first want to render layer0 (the main background) then some 3D characters , then layer1, partially covering some 3D characters (eg : characters behind a house), then again some 3D characters (not covered by anything) and so on
I clearly understand this part.
The real question is , depending the position on the field, how do you know if a character is behind or above a given tile/layer ?
Here is an
example, if player is on A you shouldl render is this order : Layer0, Layer1, Player
If player is on B, this order : Layer0, Player, Layer1 (so he appears behind the fence)
Since a 3D character is on a walkmesh you know it's Z value. But (AFAIK) you don't have the Z values of individual tiles.