A_JumpIfSpeciesinSight
Moderator: GZDoom Developers
A_JumpIfSpeciesinSight
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]
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]
Re: A_JumpIfSpeciesinSight
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?
Re: A_JumpIfSpeciesinSight
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.
I've noticed that they do avoid shooting each other with the +Friendly flag, but I need them as enemies unfortunately.
Re: A_JumpIfSpeciesinSight
Using [wiki]Thing_Hate[/wiki] will override friendliness if that is any use to you.
Re: A_JumpIfSpeciesinSight
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).
Re: A_JumpIfSpeciesinSight
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49053
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_JumpIfSpeciesinSight
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.
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.
Re: A_JumpIfSpeciesinSight
Really? You mean there's no way to sort actors by sector?
Re: A_JumpIfSpeciesinSight
This isn't by sector. This would be going through line of sight.GooberMan wrote:Really? You mean there's no way to sort actors by sector?
Re: A_JumpIfSpeciesinSight
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.)
Re: A_JumpIfSpeciesinSight
Alright, let me spell out for you what I mean then.Ghastly_dragon wrote:This isn't by sector. This would be going through line of sight.
- 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
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49053
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_JumpIfSpeciesinSight
That alone would cost more than just checking all actors of the requested species.GooberMan wrote: [*]Actor collects sectors visible in cone of sight
Re: A_JumpIfSpeciesinSight
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).
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).
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49053
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_JumpIfSpeciesinSight
That'd be great. This is something nobody here has good experience with and a lot of interesting features had to be 'no'd.
Re: A_JumpIfSpeciesinSight
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?