A_JumpIfSpeciesinSight

Moderator: GZDoom Developers

User avatar
Ravick
Posts: 2002
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

A_JumpIfSpeciesinSight

Post by Ravick »

Well, the name sucks, I know...

A command that will check if the is any actor with the given specie in the actor's FOV. The main usage woul'd be to prevent a monster to hit his fellows, but could be used in lots of other things that are not players, targets, masters, etc.

[edit] It would need a distance check, of course, because FOVs gets bigger in distance and it would make monsters near useless in distance. But it could be done by the own modder with A_RadiusGive to inform his monsters if they are close to his fellows.[/edit]
User avatar
Enjay
 
 
Posts: 26508
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_JumpIfSpeciesinSight

Post by Enjay »

Oh, this could possibly be used to do something that I have been trying to do for ages - have enemies respond to seeing their buddy killed. If a dying enemy spawned [species] another enemy could be given this pointer in their spawn state and if they then "see" the spawned [species] they could jump to their see state. Yes?
mi123645
Posts: 19
Joined: Thu Aug 16, 2012 3:51 pm

Re: A_JumpIfSpeciesinSight

Post by mi123645 »

I'm bumping this because I think this is a feature that is definitely needed. Having Marines accidently mow down other Marines then mowing them down again isn't going to work for me. And A_JumpIfTargetLOS/A_JumpIfInTargetLOS isn't working for me.

I've noticed that they do avoid shooting each other with the +Friendly flag, but I need them as enemies unfortunately.
User avatar
Enjay
 
 
Posts: 26508
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_JumpIfSpeciesinSight

Post by Enjay »

Using [wiki]Thing_Hate[/wiki] will override friendliness if that is any use to you.
mi123645
Posts: 19
Joined: Thu Aug 16, 2012 3:51 pm

Re: A_JumpIfSpeciesinSight

Post by mi123645 »

I am using Thing_Hate, but I forgot to specify that I need them to be counted as kills towards the player (which +friendly removes).
User avatar
Ravick
Posts: 2002
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: A_JumpIfSpeciesinSight

Post by Ravick »

Sorry for bumping this (again, I didn't see that it was bumped once, hehe). I just want to ask if this suggestion has a chance of being implemented. :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_JumpIfSpeciesinSight

Post by Graf Zahl »

I don't think so.

This can't be done efficiently because you have to perform a sight check with every single actor of the species. This can cause serious performance issues in some scenarios.
User avatar
GooberMan
Posts: 1336
Joined: Fri Aug 08, 2003 12:57 am
Location: Helsinki, Finland

Re: A_JumpIfSpeciesinSight

Post by GooberMan »

Really? You mean there's no way to sort actors by sector?
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: A_JumpIfSpeciesinSight

Post by Ghastly »

GooberMan wrote:Really? You mean there's no way to sort actors by sector?
This isn't by sector. This would be going through line of sight.
Gez
 
 
Posts: 17831
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_JumpIfSpeciesinSight

Post by Gez »

Speaking of line of sight: monsters have a 180° FOV when asleep, 360° FOV when woken up. (Monsters with the LOOKALLAROUND flag have 360° FOV even when asleep.)
User avatar
GooberMan
Posts: 1336
Joined: Fri Aug 08, 2003 12:57 am
Location: Helsinki, Finland

Re: A_JumpIfSpeciesinSight

Post by GooberMan »

Ghastly_dragon wrote:This isn't by sector. This would be going through line of sight.
Alright, let me spell out for you what I mean then.
  • Actor has a cone of sight
  • Actor collects sectors visible in cone of sight
  • Actor parses those sector's actors to see if a species is in its line of sight
It might even be more efficient to only consider subsectors, but that sounds like too fine grained a place to store an actor list.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_JumpIfSpeciesinSight

Post by Graf Zahl »

GooberMan wrote: [*]Actor collects sectors visible in cone of sight
That alone would cost more than just checking all actors of the requested species.
User avatar
GooberMan
Posts: 1336
Joined: Fri Aug 08, 2003 12:57 am
Location: Helsinki, Finland

Re: A_JumpIfSpeciesinSight

Post by GooberMan »

Sounds like there could be some very good speed wins there by optimising that. Especially if agressive use of SIMD is employed. It should come down to nothing more than a series of dot products.

Really need to get some clearance to do some ZDoom code from my employer. I've done visibility systems before (that needed to run on a PS2).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_JumpIfSpeciesinSight

Post by Graf Zahl »

That'd be great. This is something nobody here has good experience with and a lot of interesting features had to be 'no'd.
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: A_JumpIfSpeciesinSight

Post by Nash »

Hey GooberMan, if you ever get that code working... just wondering, would it help in situations with large, wide open world-style maps with few 1-sided lines to block the view?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”