OldUnreal / UnrealTournamentPatches

Other
975 stars 29 forks source link

Feature Request: Zone-only sounds #1615

Open Nathkel opened 2 weeks ago

Nathkel commented 2 weeks ago

This may require a rewrite of the UT99 sound method, but whats needed is the chance to filter sounds that are not within its zone of origin. Now in almost all "action" sounds, like shots fired, bots gibbed, etc, you want the sound to carry (preferably by wall deflection rather than radius from origin, but that's secondary). But for ambient sounds, these should be reduced greatly based on, for example, whether you are inside or outside. In a virtual reality, when you're inside a building, ambient sounds should be muffled by insulation, walls, and furnishings. The best way, it seems, to achieve this without disturbing the current sound emanation is to disable sounds that are outside the zone when the player is within another. This would require that ZoneInfo actors have an additional setting, "ZoneSoundFilter", a boolean. And that AmbientSound keypoints have an additional boolean setting, "ZoneOnly." Any sound marked as ZoneOnly (when used in an AmbientSound generator) is not processed when the player is in a zone whose ZoneSoundFilter is set to true. Of course UT99's sound engine would have to accommodate this new process.

SeriousBuggie commented 2 weeks ago

Such changes will not work for old clients for sure. So that mean different experience for old and new clients. Actually old clients will be preferable by players, since allow better hear enemy.

Maybe that can be make optional. Not sure. If that possible at all.

Nathkel commented 2 weeks ago

Yes i agree, we dont want to break old maps. Hopefully methods can be added rather than changed. Perhaps a coded check for patches 469e or greater might help.

SeriousBarbie commented 1 week ago

Couldn't that be done by scripting? Untested code:

Event Zone.ActorEntered(actor Other) {
    Super.ActorEntered(Other);
    if (PlayerPawn(Other) == None) Return;
    Spawn(class'SomethingThatPlaysAmbientSoundForPlayer', Other, Other.Name));
}

event ActorLeaving(actor Other) {
local SomethingThatPlaysAmbientSoundForPlayer SoundMaker;
    Super.ActorLeaving(Other);
    if (PlayerPawn(Other) == None) Return;
    foreach AllActors(class'SomethingThatPlaysAmbientSoundForPlayer', SoundMaker, Other.Name)
    {
        SoundMaker.Destroy();
        break; // there can only be one
    }
}

Of course the sound/music has different time offsets for different players, but that should not be a problem for looping ambient sounds. Also that class'SomethingThatPlaysAmbientSoundForPlayer' must check periodically if PlayerPawn is still in that zone - maybe he teleported out or died.