[Added] A_CheckLOS, ACS_GetSight

Moderator: GZDoom Developers

A_CheckLOS, ACS_GetSight

Postby Skippy » Sun Aug 06, 2006 12:06 pm

Hi everyone,

We already have A_CheckSight, which jumps if no player can see the calling actor. However, far more useful would be an action function which jumps if there is a line-of-sight between the calling actor and its target, or between the calling actor and any actor with a specific TID. For example:

Code: Select allExpand view
A_CheckLOS(int TID, int offset)

Jumps the specified amount of states forward if there is a direct line-of-sight between the calling actor and any actor with the specified TID. If TID is 0, the calling actor's current target is used its target.

If called repeatedly in the actor's See state, and when used in conjunction with A_ClearSoundTarget, it could have a number of useful applications.

Sorry, but I'm determined to make my Metal Gear mod :D
Last edited by Skippy on Fri Dec 21, 2007 6:03 am, edited 3 times in total.
User avatar
Skippy
is getting too old for this shiz
 
Joined: 20 Nov 2005
Location: Belfast, NI

Postby Shadelight » Sun Aug 06, 2006 12:43 pm

This sounds like a good idea, except it'll probobly end up with a "[no]" :(
User avatar
Shadelight
You must construct additional lumber.
 
Joined: 20 May 2005
Location: Labrynna
Discord: Shadelight#4920

Postby Graf Zahl » Sun Aug 06, 2006 12:56 pm

For current target check A_CheckSight.

For TIDs, no. That doesn't make sense in DECORATE's context.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Skippy » Sun Aug 06, 2006 1:42 pm

For TIDs, no. That doesn't make sense in DECORATE's context.

Agreed. It's probably far too specific to my needs to warrant inclusion, though it might be better suited to an ACS function.
For current target check A_CheckSight.

I'm not sure what you mean by this. From the Wiki:
Jumps if no player can see this object.
This can be used to make things vanish but ensures that no player will see the event.

This implies that the jump will only occur if the calling actor is outside the player's field of vision. That's not what I'm suggesting; I'm looking for a function that jumps if the calling actor can see its target (not necessarily the player, and not the other way round). Unless there's a functionality to A_CheckSight that isn't documented in the Wiki, that won't help me I'm afraid.
User avatar
Skippy
is getting too old for this shiz
 
Joined: 20 Nov 2005
Location: Belfast, NI

Postby Graf Zahl » Sun Aug 06, 2006 2:03 pm

Sorry. I constantly make that mistake. Reopened. ;)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Skippy » Sun Aug 06, 2006 2:29 pm

Thanks for that. I really think this would be a useful addition, especially when combined with other key action functions like A_ClearSoundTarget, A_Give/TakeInventory, Thing_Hate and Thing_SetGoal, as well as some canny ACS scripting to control 'alert levels' and the like. :wink:
User avatar
Skippy
is getting too old for this shiz
 
Joined: 20 Nov 2005
Location: Belfast, NI

Postby Skippy » Sun Oct 22, 2006 6:11 pm

Sorry for the mega--bump, but seeing as there's been a whole slew of feature suggestions added recently, I was hoping this one could be looked at again. From what I can tell the relevant checking routines are right there in the code alrady so it should be a realtively simple addition (please correct me if I'm wrong! 8-)). I also have a couple of other closely-related suggestions which I don't think warrant a separate thread, so I'll put them here.

ACS: CheckSight
Code: Select allExpand view
CheckSight(int tid1, int tid2)

Returns TRUE if there is a clear line-of-sight between any actors with TID of tid1 and any with TID of tid2.


My second suggestion is an additonal actor property for DECORATE: FOV (int angle). This property would determine the width of the angle in front of the actor within which they can see targets. The default would be 180, which appears to be the standard logic for enemies (as any time you venture further than level with them in their peripheral vision, they wake up). Values of, say, 30 would mean that enemies would only detect targets moving directly in front of them, and a value of 360 would be equivalent to setting the +LOOKSALLAROUND flag (cf the Archvile).

The three things I have suggested - DECORATE action function, DECORATE actor property, and ACS function - would with clever use open up many new possibilities for adding enhanced intelligence to enemies, and would also facilitate many new environmental features such as security cameras (in conjuntion with a looping SetActorAngle script, for example) and Half-Life style sentry guns. Your consideration is much appreciated.
User avatar
Skippy
is getting too old for this shiz
 
Joined: 20 Nov 2005
Location: Belfast, NI

Postby Risen » Wed Aug 22, 2007 10:19 am

Bump, yes, but I can't find any way to do what I want without a line-of-sight check.
I could probably manage if it were in Decorate, but ACS is preferred for my application.
User avatar
Risen
 
Joined: 08 Jan 2004
Location: N44°30' W073°05'

Postby Skippy » Wed Aug 22, 2007 7:12 pm

Considering the length of time this has gone unanswered, I wouldn't hold your breath. At this point I'd settle for the ACS CheckSight function alone, as I fear the field-of-view stuff would require a major rewrite of the monster AI. :cry:
User avatar
Skippy
is getting too old for this shiz
 
Joined: 20 Nov 2005
Location: Belfast, NI

Postby Risen » Thu Aug 23, 2007 6:21 am

It's best to have one suggestion per thread, so I'm not going to comment on the FOV stuff. That should be discussed elsewhere.
User avatar
Risen
 
Joined: 08 Jan 2004
Location: N44°30' W073°05'

Re: A_CheckLOS, ACS_GetSight

Postby Graf Zahl » Sat Jun 06, 2009 4:11 am

added
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_CheckLOS, ACS_GetSight

Postby Skippy » Sat Jun 06, 2009 5:54 am

Wow, incredible - thanks Graf! You're on a real killing spree today... :D

Could you explain usage please?
User avatar
Skippy
is getting too old for this shiz
 
Joined: 20 Nov 2005
Location: Belfast, NI

Re: A_CheckLOS, ACS_GetSight

Postby Graf Zahl » Sat Jun 06, 2009 6:24 am

A_JumpIfTargetInSight(state)


It makes no sense to use tids anywhere in here so it only checks the target of the calling actor. That's also the reason why this won't be added to ACS.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_CheckLOS, ACS_GetSight

Postby XutaWoo » Sat Jun 06, 2009 10:11 am

What's the difference between this and A_JumpIfTargetInLOS?
User avatar
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

Re: A_CheckLOS, ACS_GetSight

Postby Gez » Sat Jun 06, 2009 10:23 am

A_JumpIfTargetInSight jumps if the calling actor can see its target (the target is in sight).

The other function suggestion would jump if the calling actor can be seen by its target. That's the difference between "target in sight" and "in target's sight". :P

And finally, there is A_CheckSight which jumps if the calling actor can be seen by any player.
Gez
 
 
 
Joined: 06 Jul 2007

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests