Sight'n'Shoot

Get help using Construct 2

Post » Thu May 24, 2012 6:32 pm

No problem... your method is obviously better for a view cone function ;)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu May 24, 2012 11:46 pm

Math lovers are here, your enemies are all robots !

I aggree with sqidders about the draw line/strech sprite method (I have speak about that in my first post men !) ... but i love the bullet method as bullets can take some time to move and so it's more easy for the player to hide before be seen ... the more time the enemy stay in line of view with player the more far the "view bullets" are fired ... this "view bullets" objects must be destroyed if enemy view change and can also be destroyed using a fade in time destroy behaviour to avoid using too many cpu. But don't say it take's always a lot of cpu !!! ... shooting invisible bullets or shooting "real" bullets it's near the same for the game ... same objects ... some are invisible others not ... so if your game can not handle this, it can not handle many enemies shooting at the same time so it's a good way to know if your game will be playable or not !
naelian2012-05-24 23:55:48
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Fri May 25, 2012 2:06 am

@Naelian.. are you suggesting bullets in real time? That wouldn't give real line of sight at all... Why not just manually integrate a delay into the other method?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri May 25, 2012 3:47 am

Yes i'm suggesting firing some invisible bullets every X from the enemy toward the player ... not something really different than drawing a line but a bullet "dash" line with speed effect and so less effectiveness :

In a game such as Splinter Cell some elements such as darkness, or player stealth mode are important to make a difference between "in line of sight" and "seen", it's not just a simple delay. By using a bullet mode you can adjust speed of bullets, bullets size and life time according to darkness and reduce player "shape" according to stealth mode. By doing this you give more "life" to the line of sight system and integrate a failure, it's not 100% effective such as humans behaviour !

How many times have you search something which was just in front of you ?
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Fri May 25, 2012 8:01 am

thanks for the discussion.

didnt find a working solution yet. i want the enemies also to view at the player only (angle) when there is no object of a specific family (BlockedObjects) between them. that makes it a bit harder to create the event group "sightCheck".

currently, i spawn invisible bullets for each enemy every 0.1 seconds, and set the angle of the bullet manually towards the player.
then i set the angle of the enemy towards the player, only when he is hit by the invisible bullets spawned by the specific enemy.

anyway, this does only work when the player is overlapping an enemy. no idea why.

the invisible bullets are destroyed on BlockedObjects and outside screen. i cant recognize a real performance decrease.

do you have an idea how to solute this, maybe a capx?
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Fri May 25, 2012 1:02 pm

sorry for pushing the thread,

the only problem is, how do i "connect" the invisible bullets to a specific enemy, so that only the one turns around to the player?



this one does not work ..

any help appreciated xeed2012-05-25 13:03:21
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Fri May 25, 2012 1:56 pm

Line of Sight...
LoS.capx
Last edited by Yann on Sun Sep 14, 2014 8:28 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri May 25, 2012 2:14 pm

Here's my example of using the "invisible bullet" method to determine line of sight when obstacles are present, and then having only the instance(s) with LOS react.

http://dl.dropbox.com/u/6109058/lineOfSightDemo.capxjimand2012-05-25 14:15:38
B
16
S
4
G
1
Posts: 40
Reputation: 2,705

Post » Fri May 25, 2012 4:08 pm

many thanks :)

@Yann: yes, found this thread before few hours, and just made it through the line-of-sight solution, which seems to be fastest and free of bugs.



best regards :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Previous

Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, Evanetot, Yahoo [Bot] and 25 guests