REGoth-project / REGoth

OpenSource-Reimplementation of the zEngine, used by the game "Gothic"
GNU General Public License v3.0
628 stars 63 forks source link

Update audio engine #366

Open frabert opened 6 years ago

frabert commented 6 years ago

Provides a more backend-independent audio system Also fixes some sounds being played at half speed (chapter introductions)

tomedi commented 6 years ago

Tested your build. The chapter music works fine, but it seems that musiczones got somehow messed up. When you enter Khorinis, for example, music doesn't switch until you reach the place in front of Vatras. Also, I had the impression that just by turning the Hero, it had an impact on the music (directly in front of Lobart, there was a weird switching in between the lobart and the regular world theme).

frabert commented 6 years ago

@ShFil119 I addressed most of the criticisms, thanks. @tomedi I don't think those issues could be introduced with this PR. If you toggle the debug music zones draw, you can see that indeed the city zone starts in front of Vatras's place

frabert commented 6 years ago

I'm marking this as WIP, I'd like to make some more updates like making the AudioWorld live in the BaseEngine instead of the World (there are no ties between it and the AudioWorld), to allow stuff like playing music and sound effects before a game is started

frabert commented 6 years ago

@ShFil119 Done addressing the new reviews.

During testing Gothic 1 I noticed that some sounds are played even though they should not be heard, like In Extremo (which is now playing correctly 👍 ) that starts right as the player is spawned. Maybe it's got something to do with the maximumDistance. More investigation is needed

frabert commented 6 years ago

Last commit should fix the issue, marking as ready for review & merge

tomedi commented 6 years ago

The game crashes when you load a savegame after you started a new game. crashlog_music.txt

frabert commented 6 years ago

Can you confirm this is not present in master? I cannot reproduce this on my machine

Also this looks like it's got something to do with bgfx/3d rendering, I'm not sure what could have introduced it from this PR

tomedi commented 6 years ago

@frabert Oh, I'm sorry... This crash is indeed present at the latest master-build. Just stumbled over it because I was testing your branch.

frabert commented 6 years ago

That's a bug on its own right, anyway. I remember seeing something similar some time ago but could never pinpoint it to something precise, it happens sometimes when sometimes calls btVector3::normalize apparently