Well, it's a bit more complicated than that. If you want to set it up so that your path area encompases all that you can see, the path area "diameter" should be 1 (your center cell) + 2 * State.Radius (your "diameter") + 2 * State.AnimalSpecies.EyesightRadius (your eyesight "diameter"). I'd caution you on two things. 1) If you have a large eyesight, performance may be unacceptable, you'll probably have to set the PathFinder.MaxSearchDepth parameter. My own experience has been that it's better to decrease the path area rather than use the max search depth parameter. 2) If you have a small eyesight and a high top speed, including everywhere you can see in your path area can lead you to bump into things (including bugs that are dangerous to your health). Remember that when you go to a particular cell, your bug extends 2 to 3 cells in each direction from that cell. So, if you run to the edge of where you can see (in a single tick), your bug will extend 2 to 3 cells into an area that you could not see last tick. Good luck! I hope this helps. |