start of monster pathfinding code based on tiles