TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

Soundloop script not working as intended #359

Closed Duchenkuke closed 3 years ago

Duchenkuke commented 6 years ago

On the discord server we just discovered a bug that comes with one of the gg default scripts.

its about "Soundloop.lua"

It doesnt work as intended. It loops the sound but there is no change in the volume when the player gets closer to the sound origin (entity)

I think this should be fixed

AmenMoses commented 6 years ago

Try it with Mono 48Khz WAV files. Positioning only seems to work with specific sound files. (The engine noise I used for the Truck works btw)

tarkus1971 commented 6 years ago

As AmenMoses says, a MONO .wav file will work, does it work now if:

Sound is on player left and attached to a moving entity moving left to right and then the player rotates does the sound move as the player rotates, it never used to ?

AmenMoses commented 6 years ago

No, sound attached to moving entities does not move with the entity. The source location of the sound is set at the point where the PlaySound or LoopSound commands are issued, I have been toying with the idea of adding a MoveSound Lua command because the engine really has no idea what the game designers intent is with regards to sound source and simply 'fixing' it so sounds always move with the entity could very well be seen by some as a new 'bug'!

By putting sound positioning under direct Lua control then all sorts of things become possible.

AmenMoses commented 6 years ago

@LeeBamberTGC , why does sound positioning not work for Ogg files?

LeeBamberTGC commented 6 years ago

The OGG playback system is completely different to the WAV system which is much more flexible. If you want 3D sounds, best to convert them to WAV MONO (see the wav format of the stock audio files for info).

tarkus1971 commented 6 years ago

@amenmoses - a movesound.lua would be awesome

AmenMoses commented 6 years ago

@LeeBamberTGC , Still don't quite get why some WAV files work and some don't, for example the metal door open sound in the Sci-Fi DLC doesn't work even though it is Mono WAV. Also is the volume 'fall off' factor editable? In testing I have sounds 10,000 units away from the player that are still audible, even if the factor could be set globally that may be useful.

LeeBamberTGC commented 6 years ago

Perhaps you can provide a small FPM using stock WAV files so I can reproduce the issue? All things being equal, identical WAV formats should produce the same result during playback.

LeeBamberTGC commented 5 years ago

Will be closing this task if the issue cannot be reproduced. All valid WAV files we have worked fine with the sound zone.

plemsoft commented 3 years ago

duplicate.