Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > How to Determine my Eyesight Radius
 

How to Determine my Eyesight Radius

This might be a dumb question, but how do I determine what my own creature's eyesight radius is?  
Is there a formula to derive it from the EyesightPoints Attribute?  
If so, how do I access the values of an Attribute programatically?  (I am new to C#).
MigrationUser 1  Thursday, September 09, 2004 6:06 PM
Yours: Animal.State.AnimalSpecies.EyesightRadius
Others:  AnimalState.AnimalSpecies.EyesightRadius

(I typed this from memory so it may not be exact, but you should get the idea.)
MigrationUser 1  Friday, September 10, 2004 4:26 PM
Thank you, dkocur.
That was it.  
I am trying to re-write my creature using your provided classes, especially for navigation.
I am creating a new PathFinder obj using a new PathArea obj that uses my Eyesight Radius for the diameter field.  Is this correct?
MigrationUser 1  Saturday, September 11, 2004 2:37 PM
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.
MigrationUser 1  Saturday, September 11, 2004 7:12 PM

You can use google to search for other answers

Custom Search

More Threads

• Problem occured during installing, a newer need help
• State of Affairs
• Does XPander control needs the Manifest?
• TaskVision VB.NET
• More than 1 creature per Solution
• Has anyone changed IssuVision?
• SoapException
• using n-tier architecture for winforms
• Please Wait at least 5 minutes ?
• no Text is shown in the .NET Terrarium 1.2 Client