# How map the stage?

for routing, and for better action need the map of surrounding area. how we can map it. for example where hero can go and accessible and where not. such as wall and other.

While this is not possible at the moment, it has already been mentioned and is discussed on GitHub.

1 Like

if it know the boundary at least for start can use mash the area and then get the score each 6 near square. and then used as next step. in more advanced it can use Finite element method or Monte Carlo method

Please provide a bit more attention to grammar and ortoghrapy to make you point clearer, I had to guess a bit.

You can easily define the boundary of the field by yourself. Lower left corner is almost always `(0, 0)`, the upper right corner can be easily taken from the level-screen by hovering your mouse in the general area.

Nothing stops you from walking outside the game-field, at least as long there are no boundaries (like dungeon-walls).

As far as I know neither FEM nor Monte Carlo are pathfinding algorithms (at least not on their own). What do you mean when you mention them?

You can also generate a grid of arbitray accuracy by running two while-loops across the x- and y-axis and save a point (something like `{x: 20, y: 20}` for example) for each desired position, then use A* or Dijkstra (or any other mesh-walking algorithm) to find pathes along them.

The only thing you canâ€™t do at the moment is get obstacles or hazards. This is exactly the thing discussed in the linked issue.

1 Like

thanks for time. unfortunately i am not native. FEM nor Monte Carlo for for find approximate solution. but as you mention my problem is find boundaries to avoid my hero try to go some where that is not suppose to go.

It is possible to create code which avoids some obstaclesâ€¦ isPathClear() or equivalent can help. I have about given up on parts of that approach as fleeing can run you deep into corners, howeverâ€¦

That being said, I do have some sample code posted but was getting an error â€¦ probably caused by the function being called with coordinates outside of the playing field.