A plugin that can calculate and show the percentage of completing a maze

Sorry for my English.

Like it in FF4, when the player enters into a dungeon and wanders around, there shows the percentage of the dungeopn that has been explored. Is there any plugin offering such functionality?
How would you track the percentage of how many percentage the dungeon is explored?
the number of grids that the player has reached

divide

the total number of grids of the map
Whereas that would work for a 1 dimensional grid (and going in a straight line) it won't work with a two dimensional grid. With a 2 dimensional maze you have to take into consideration the end point location, player location and the start location on both the x and the y axis. You also have to account for obstructions example:

   _________________

  End | start location

--------------------------------

In this example we have an obstruction between the end and the start location and lets say the player could go around the upper most obstruction to reach the end. But since you are technically only one tile away you might get a completion of 99% which would then go down the further away you go to get around the upper obstruction.
Whereas that would work for a 1 dimensional grid (and going in a straight line) it won't work with a two dimensional grid. With a 2 dimensional maze you have to take into consideration the end point location, player location and the start location on both the x and the y axis. You also have to account for obstructions example:

   _________________

  End | start location

--------------------------------

In this example we have an obstruction between the end and the start location and lets say the player could go around the upper most obstruction to reach the end. But since you are technically only one tile away you might get a completion of 99% which would then go down the further away you go to get around the upper obstruction.
I would mark with regions tiles that would not count towards the map completion. I would also define how many tiles around the player are considered completed as they walk. For example, every adjacent tile might be considered completed, rather than just the one under them...

I might try making this script
Might make more sense to combine this with a fog of war to give a visual cue to the player, which tiles they still have to visit.

Original thread: https://forums.rpgmakerweb.com/threads/a-plugin-that-can-calculate-and-show-the-percentage-of-completing-a-maze.54935/