ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.69k stars 622 forks source link

Breakables that emit a ambient_generic will keep reproducing the sound on re-connection even when broken. #2945

Open metita opened 4 years ago

metita commented 4 years ago

So today on latest beta I joined a server that was on cs_italy, for some reason the Jukebox was not there because it got destroyed but the Opera was still being played, we tested it with @PM32 and we both managed to successfully reproduce the bug.

1) Connect to a map like cs_italy 2) Break the Jukebox with an ambient_generic attached to it 3) Reconnect while the round is being played still. 4) You will keep hearing the Opera even when the breakable is not there anymore.

BlackShadow commented 4 years ago

Didn't you report this at #2942 ?

CS-PRO1 commented 4 years ago

Didn't you report this at #2942 ?

@BlackShadow I believe those are different bugs. #2942 was about an error message when breaking the object This one is about the music playing again after reconnection even tho the object was broken

metita commented 4 years ago

@BlackShadow Both different things.

rtxa commented 4 years ago

As I understand it, this has something to do with how ambient_generic works.

When flag "Start silent" isn't set, the sound will play because the sound is set with SND_SPAWNING (means that the message will be sent when a player connects).

So, despite you broke the radio and the sound stops for already connected players, because is in the MSG_INIT string, the sound will play always you connect.

I'm not sure how can be this fixed without breaking or affecting anything. If you decide to do this manually, by leaving on "Start silent" flag, then the problem will persist. If you have turn on the radio and a new player connects, he will not hear the radio. Unless

Maybe this can be fixed from inside the map by making the ambient_generic starts silent and get played only to players connecting through game_playerjoin (code changes need to be done to do this only to this players because)

I dont think there's an easy fix, because I'm pretty sure ambient_generic was mostly used for ambient sounds (that's why it doesnt have that thing implemented or feature) It's something not expected I will say, wasn't made for multiplayer whereplayers connects and disconnects frequently.

metita commented 4 years ago

@rtxa I know that maybe the main purpose of ambient_generic was not aimed to things like the Jukebox, but you gotta think that the problem here is the func_breakable, I mean, if you broke the breakable the ambient_generic should not be initiated if I reconnect to the server, there has to be a way to detect if a ambient_generic comes from a breakable and then don't allow it to be re-enabled if not flagged somewhere.

rtxa commented 4 years ago

Yep, not an easy fix and requires more work, testing and changes in some maps. Because of that, Valve developers will not bother with it.

I think it would be better to keep this in the ambient_generic instead of connecting the func_breakable. If ambient_generic has been stopped (triggered in this case by a func_breakable) and a new player connects, stop the sound. Also a new flag should be added for this new functionality to not break anything and I don't know how to name it.

This also can fix a problem in HL1 with crossfire bomb. When the bomb is on and a new player connects to the server, he will not hear it.