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, 2012 at 07:00 PM

raoz gravatar image

raoz
411 15 12 17

(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, 2012 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, 2012 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:

x9451
x2741
x1369
x75
x2

asked: Apr 12, 2012 at 07:00 PM

Seen: 1343 times

Last Updated: Apr 22, 2012 at 02:44 PM