[rvSinceForever?]Allied monsters do not attack enemy players

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

[rvSinceForever?]Allied monsters do not attack enemy players

Post by Captain Ventris »

I'm not sure if this is REALLY a bug, per se, but a Player's allied monsters rarely, if ever, target enemy players online, even if that player is the only available target. They will just walk right on past, not attack in melee, nothing, they will just continue to follow their owner as if no targets are present. Strangely, the occasional monster WILL target the enemy player, but that is a rare case. This just seems weird, and it makes me sad.
User avatar
Osiris Kalev
Posts: 290
Joined: Sun Aug 20, 2006 11:06 pm
Location: Australia, Elsewhere Within
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Osiris Kalev »

It wasn't always like that. Back in the 2.1.5 days, they certainly did.
Last edited by Osiris Kalev on Sun Apr 19, 2009 4:22 am, edited 1 time in total.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Captain Ventris »

Osiris wrote:I wasn't always like that. Back in the 2.1.5 days, they certainly did.
I wasn't sure how far it went back, heh. It hasn't concerned me until recently. I reported this on Skulltag, and Torr told me ST and ZDoom weren't much different in this respect, and I was told by others to just report it here.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Captain Ventris »

So, no interest? Could there be something server-related that might cause such monster-apathy?
User avatar
Rachael
Posts: 13946
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Rachael »

I don't know how the devs feel about it, but digging through the enemy code hasn't yielded much for me, yet. I haven't had as much time as I'd like, though.

I'm sure it's just a simple fix somewhere, but figuring out what it is would take a bit of analyzing the code and seeing what went wrong. It would help a lot knowing when the code broke in the first place, so that I can see what changes were made that caused this behavior.

I'm very much interested in getting this bug fixed, though.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Captain Ventris »

The thing is, I never noticed it until testing ZDoom Wars on Skulltag, the first time I had seen such an interaction online. I have no idea when it started. I made a bug report for this on the Skulltag forums, thinking it might be an ST thing, but Torr said he thought "ST and ZDoom are similar in that respect", so I came here.

If this isn't true for the latest version of ZDoom, I would be mighty curious to find out why there was a change in Monster Target selection.

EDIT: Furthermore, the player classes involved have weapons that constantly A_AlertMonsters, making this even stranger.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Macil »

Captain Ventris wrote:So, no interest? Could there be something server-related that might cause such monster-apathy?
Well ZDoom doesn't use servers like Skulltag, so probably not.

I think the friendly targeting code has some problems. I've seen many friendlies walk right by enemies and merely wander with seemingly no target.
User avatar
Rachael
Posts: 13946
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Rachael »

Graf, if I modify the enemy AI code, so that friendly monsters attack any player they consider to be an enemy, is it safe to just modify the code directly or am I going to need to make flags/compatibility options/A_Look flags/whatever to prevent mods from breaking?

In its current form, in deathmatch, friendly monsters will attack enemy players if the player hits them first, and also, they will attack enemy players' friendly monsters, but they will not attack the players unprovoked.

Also, they give no consideration to team deathmatch, I don't know if that's implemented in ZDoom though.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Graf Zahl »

I don't think such a change needs a compatibility option.
User avatar
Rachael
Posts: 13946
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Rachael »

Okay.

As a friendly monster, do we prefer monsters as targets, in deathmatch, or do we prefer players? Those are the two easiest ways to code this thing, unless I can also code it so that it considers the player object itself among the monsters but that will be subject to distance checks, blockmap search, etc.

The fix I have in now prefers monsters - it searches for monsters first, and if it doesn't find any it does a fall-through to the normal player routine that unfriendly monsters use, but there is an additional check to make sure the monster is not attacking his master, or if he doesn't have one, any players at all.
User avatar
Rachael
Posts: 13946
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Rachael »

Okay, since I got no response yet, I am just going to upload my fix. If you guys don't like it, I can always either change it, or you can change it, whichever way you like it.

Notable files changed are p_enemy.cpp and p_enemy_a_lookex.cpp. I don't know if either code does not get used so I updated both just to be sure.
Attachments
Completes.zip
Complete files - just drop these in and they'll work.
(23.73 KiB) Downloaded 26 times
diffs.zip
diff files - made with SVN diff against GZDoom r323 (should still be the same on the present version of ZDoom)
(1.67 KiB) Downloaded 23 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Graf Zahl »

Fix added.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Captain Ventris »

Oh, didn't notice this. Thanks a bunch, Priestess!
User avatar
Rachael
Posts: 13946
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [rvSinceForever?]Allied monsters do not attack enemy players

Post by Rachael »

Not a problem.
Post Reply

Return to “Closed Bugs [GZDoom]”