How do I Visualize Line of Sight

Get help using Construct 2

Post » Wed Jun 15, 2016 6:24 am

I mean, I have a turret to shoot things at(with line of sight). And now I want to display the vector/ cone of view that will expand by variables like range or radius coverage. Is it doable in Construct? I knew that I need a sprite for that.
B
3
Posts: 2
Reputation: 179

Post » Wed Jun 15, 2016 6:47 am

Displaying a cone range can be done by simply resizing a cone sprite. Changing the angle is a little trickier, but I would just create a bunch of animation frames with as many different fan angles as I need.

If you need to show the cone of view WITH line of sight and obstructions... that is a rather advanced topic/technique. If this (https://twitter.com/JoeGribbs/status/701924446429437952) is what you're looking for, I'll leave you with a few links:
http://www.redblobgames.com/articles/visibility/
need-help-working-with-bullets_p1017125?#p1017125
https://www.scirra.com/tutorials/902/li ... raycasting
http://ncase.me/sight-and-light/

You may want to compromise and just simply show the range and angle with a translucent cone sprite, and let the game handle LOS... showing LOS can be very tricky.

Alternatively, you might want to look into the shadow light/caster behavior, which may give you the effect you're looking for. https://www.scirra.com/manual/178/shadow-light
Mistakes were made.
B
52
S
26
G
109
Posts: 1,611
Reputation: 61,643

Post » Wed Jun 15, 2016 7:46 am

You may also want to take a look at THIS work-in-progress plugin by @Johncw87

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Wed Jun 15, 2016 11:57 pm

Thank you very much for your replies.
Yes, I combine turret and LOS. The built-in LOS and turret behavior are great. But where the cone / LOS starts from (from image points?), I mean, if I want to overlay the LOS cone with sprite, how does the radius expansion work? .I tried to make my own sprite ("movieclip") of LOS ,but the result is not good enough.

Anyway ,thanks for your replies.
B
3
Posts: 2
Reputation: 179

Post » Thu Jun 16, 2016 3:36 am

Mistakes were made.
B
52
S
26
G
109
Posts: 1,611
Reputation: 61,643


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 23 guests