Explain the logics of line of sight

Hi guys 

I want to make my own line of sight script but I try to understand the logics in this 

in what this different of a sensor? 

this because line of sight just do a one line 

and sensor will  sorta do the 4 lines or 8 lines? 

I try to find the difference between both and I am not sure.

Also for gettint exemple the event sensor I will use that? 

def create_sensor(event_x,event_y,sensor_range)@event_x = @event.x@event_y = @event.yif @sensor = true@sensor = @event_x && @event_y *@sensor_range )endendbut actually I don't really know about event sensor and line of sight more then that but I want to create my own for my system

also I will be happy if people can provide me any documentation about this 🙂

thanks for you further answer
What I think about the two ( may be wrong ).

Line of sight:

 What the person ( event / player ) can only see. The shape is usually a 90 degree in 2d games, with the person being the origin. To find out what the person can't see ( so you can remove it from his sight ) you would use shadow casting.

Sensor:

 Detection of something entering an area set around an object.  This can come on different shapes like just a line, a circle, ect. Be careful with different types of sensors, for example a light sensor shouldn't be able to see through other objects / obstacles, depending on it's placement.  But a sound one will be able to hear through some objects / obstacles, the shape would just change when it hits the obstacle but that's a little more advanced.

Edit: now that I think about it, my line of sight sounds more like a field of view. So a line of sight  would be a line from the origin to the center end in the field of view maybe?
hum thanks for your explaination!

this help me a lot 

Edit: now that I think about it, my line of sight sounds more like a field of view. So a line of sight  would be a line from the origin to the center end in the field of view maybe?
I am actually not sure of the difference between them

but if I explain I use the line of sight for what the event can see like...is vision 

so I guess this a line of view what I search !
Maybe this can help?

los.jpg fow.jpg sensor.jpg

  Line of Sight   -    Field of View   -      Sensor

This does not take in account obstacles. Also note that sometimes line of sight is used as synonim of field of view.

Original thread: https://forums.rpgmakerweb.com/threads/explain-the-logics-of-line-of-sight.37187/