pathfinding optimization, loading maps from file