How about multiple Rays for PerceptronSight?

JOON 5 months ago in Behavior updated by Marti (Lead Developer) 5 months ago 2

Hi, I am trying to understand the logic of PerceptronSight of "Behavior Module"

I think PerceptronSight class uses only one ray for "raycast" to check AI can see "sightTarget" or not. the transform.position of sightTarget is usually bottom of characters. especially generated characters by "Create Character" of GC. 

we can big difference of perceptrion power by adjusting transform.position little bit.  but it is stll not enough to making good game.

I am trying to use several lines to check AI can see target Object or not. at first I was considering to make several lines like arc with angle-rotation. I don't know much about "computing cost of  calculation" but angle-rotation is not cheap way.

Instead of making more than 1000 lines with rotations.., I tried to respect and follow the "main logic" of PerceptronSight. it saved "sightTarget" to check AI can see or not with just only one ray instead of multiple rays. I just added some lines at near of main line, it seams pretty work

we can add some rays, (just some 20 ~50 rays, not like 1000 or 2000 rays) to increase quality of PerceptronSight like below images 

Unity version:
Game Creator version:

I made this concept quickly to check it is working or not, and I feel it is so working well :)


Perception does not work like this. This would be a waste of performance as each ray costs. Do not worry about the implementation details of perception. Just know that it works.