how to make the LineOfSight condition trigger on a collision mask.

0 favourites
  • This is just semantics. Line of sight denotes point to point.

    I can see you, and you can see me.

    Point to polygon does not fit that, raycasting does.

    How would you do Ray Casting if you want to do a game like this? which you need to be aware constantly of all the enemies around you, not just the first object that the ray can intersect, did you get what I'm trying to say?

    https://www.youtube.com/watch?v=E8xO8jWS8NM

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You mean like picking the closest object?

  • You mean like picking the closest object?

    Yep just picking but not the closes that will be easy to do, instead, you need to pick all the objects that are an example at 400 Pixels away but 400 pixels away from both objects "collision Mask" not origin point as the origin point it doesn't work on this kind of Games because as you can see you have many variations of objects Sizes so you cannot do just one Size Range to fit all of them

  • You would filter out the unwanted results into a variable comparison using distance(), and an instance variable with its radius once you have picked closest.

    Edit:

    This is a completely different topic should you need to figure out more.

  • You would filter out the unwanted results into a variable comparison using distance(), and an instance variable with its radius once you have picked closest.

    Edit:

    This is a completely different topic should you need to figure out more.

    That's the thing I'm trying to point out, You need to do a lot of extra events for filtration so it becomes double or triple performance hit, I know this because I tried it already that's why if it was integrated the "LOS to Collison Mask" then it will be much simple as you don't have to do any extra events by replacing it just with one event and the performance will be better.

    his is a completely different topic should you need to figure out more.

    No worries, I tested everything that it could be tested as once I been working on a project like this for over a year and half or more and I had to drop it because of the performance issue but thanks for the offer.

    I'm just trying to point out that is not that simple for some games to use (Los To Origin or Raycast) as they are more occasions when you need to do (Los to Collision Mask) instead

  • Also, the Doops example is a good one, how many raycasting you will need to cast to detect Enemies on those situations?

  • No raycasting, or los needed there either.

    Overlapping at offset for platforms.

  • No raycasting, or los needed there either.

    Overlapping at offset for platforms.

    So you want to Loop check around the 360 degrees to check for overlaps at offset every thick? doesn't make much sense

  • You said Doops which I assume meant dop2000 and his use case for blocking objects either along the x, or y axis which is what overlapping at offset was made for.

  • You said Doops which I assume meant dop2000 and his use case for blocking objects either along the x, or y axis which is what overlapping at offset was made for.

    Yeah I'm still on Dop200, What I was trying to say is that he point just that specific case but you have to count that it can happen the same thing but on different positions, the enemy could be at the top or bottom of left or right etc.... so you have to look 360 degrees using overlap at offset to detect any enemy at any position

  • The pick closest suggestion is for less than specific question.

    The overlapping at offset suggestion is for a specific use case.

  • The pick closest suggestion is for less than specific question.

    The overlapping at offset suggestion is for a specific use case.

    I feel like you guys didn't get what we are requesting or I'm missing something?

    the pick by closest by itself it doesn't work as LOS check as it picks only one object and also you need to make extra events to check the distance to simulate if it's inside the LOS Range

    The overlapping at offset you need to make a 360 degrees check at offset to detect any enemy as you could have one enemy at the top RIght and another one at the bottom left for example or more on different Angles, the point you guys missing is the LOS check when it detects it picks multiple enemies in one Pick and they can be at any Angle:

    SO to replicate the LOS for what you guys saying has to loop every tick 360 degrees to check all the Angles by checking overlapping at offset Angle by Angle and pick by pick

    or

    The same thing you loop 360 degrees trowing Ray cast rays at all 360 angles to detect enemies, also here you pick only the first object that intersects no the one is behind

  • Doop agrees with tarek2 :)

    Raycasting is not a substitute for "LOS to collision polygon". The larger the distance, the more rays you will need to cast to get accurate results. And I don't see how picking the nearest instance or using overlapping at offset may help in this case:

  • This was the case for overlapping at offset.

    construct-static.com/images/v780/uploads/articleuploadobject/0/images/39604/capture.jpg

    In a platformer setting overlap at offset would cover detecting the polygon without needing a ray.

    I have no idea why raycasting is even being applied to tarek2s Agar io clone.

    You can't make a circle polygon anyway, thus the sorting method using pick closest.

    I don't think "los to polygon" is feasible as it would also be cpu intensive.

    ...unless los is somehow less intensive than raycasting.

  • > The engine does already provide an efficient line-of-sight capability. So it should be possible to customise it to your needs already.

    mm No without hurting Performance huge time, I tried it already before but you have to remove completely the LOS Behaviour and do all the LOS checking by Events

    This is not what I was suggesting. Using events will indeed likely be slower. My suggestion was to use the LOS behavior's feature which can determine LOS between any two points. You can use that to customise visibility as you see fit.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)