x


AI Field of vision

How should I go about implementing my AI-s field of vision? Raycasts? Something else?

EDIT

Here is a better explaination. how can I find out what it can see. When it looks to one side, than it cannot look to the other.

-------N-----------
--------SSSSN------
----N-|-S--->--N---
---------SS-N------

S is what it can see, N is what it cannot see, | is wall, > is enemy facing left, - is just void.

more ▼

asked Apr 12 '12 at 07:00 PM

raoz gravatar image

raoz
391 4 7 9

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Raycasts are kind of slow and dependent on raycast resolution. You might want to look at using a few box triggers to detect what is in the field of vision and then do raycasts for checking occlusion.

more ▼

answered Apr 12 '12 at 08:35 PM

dkNinja gravatar image

dkNinja
91 2

Thanks! Sorry it took too long, I forgot I had this question up, cause I haven't been to my AI code since posting this question.

Apr 22 '12 at 02:44 PM raoz
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x7626
x2388
x1257
x69
x2

asked: Apr 12 '12 at 07:00 PM

Seen: 1096 times

Last Updated: Apr 22 '12 at 02:44 PM