On a grid-based game, how would I procedurally determine adjacent objects (North, South,East, West) in an efficient manner?
I already have everything implemented from grid, to grid object placement, to actual object placement. Id like to implement this automatic system rather than having the player ie. select a corner for the building or sidewalk model
Below is a picture to better describe what Im trying to explain:
I have several 3d model variations of multiple objects from cliffs to paths/fences to buildings. Im aiming to allow players to place an object in runtime where if another of the same object is placed next to it, then depending on the direction a different mesh piece would replace the other.
Think of it as the Cliff system while making a map in starcraft 2 or warcraft 3.
(Place an object, in this case a cliff, then place another next to it and both will change where the left cliff would have no face on its right side and the right cliff would have nothing on its left face.)
Im trying to do this because allowing objects to simply overlap with one model rather than having multiple variations of the model with different faces not rendered is more ideal. Another example with exactly what I want: