Quake2 PHS Issue - Sound Emits from Last-Known Position

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
jitspoe
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Quake2 PHS Issue - Sound Emits from Last-Known Position

Post by jitspoe »

I've noticed an issue with Quake2 engines; sounds from entities are played when the entity is outside of the PVS but inside the PHS, as expected. The problem is, when the entity is outside of the PVS, the position does not update to the client, so the sound emits from the last known position.

For example, you're in a room, and a player runs out of that room into the room in front of you (still in the PHS, but outside of PVS), you would hear him moving in the room in front of you, wherever his position cut off from going outside of the PVS. He could then run all the way around to the room behind you (outside of the PVS, but still in PHS), but it would sound like he was still in front of you.

I thought maybe this was just something I broke in Paintball2, but I tried firing up the old Q2 mod version of it, and it seems to have the same issue. I guess this was always broken? It can be particularly bad in some cases of Paintball2, since everybody respawns at the beginning of the round. Somebody could have been in your base at the end of the round, then at the beginning of the next round, it sounds like he's running around in your base, but is nowhere to be seen.

I'm considering not sending sounds outside of the PVS (less bandwidth would be used as a bonus), but that might make things sound emptier... Alternatively, I could find a way to send positions for sounds on entities that are outside of the PVS but inside the PHS (means more data would have to be sent, which I'm not really a fan of...)

Has anybody else dealt with this issue?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Quake2 PHS Issue - Sound Emits from Last-Known Position

Post by Spike »

*checks the code*
the server should probably consider using the SND_POS flag for svc_sound messages when the entity is not known to the client (because its pvs culled but not phs culled).
Yes, this will likely require unicasting within the sound builtin instead of multicasting.
jitspoe
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: Quake2 PHS Issue - Sound Emits from Last-Known Position

Post by jitspoe »

This is also an issue with the footstep events (and anything else that might emit sounds that's not an explicit sound message).
Post Reply