Jump to content
Sign in to follow this  
stwf

New Sound Manager svn patch

Recommended Posts

Is there much left before this can be added to SVN? Would be nice to have it in asap so it can be as well tested as possible before release, and it definitely sounds like it will be ready for the Alpha 11 release, so best to get it in soon :) It's definitely wise to fix any possible major bugs and preferably add the above directionality, but apart from that?

Share this post


Link to post
Share on other sites

I agree, I'd like to hear a warning sound when one of my units is under attack, and maybe see a ping on the minimap to show where it is happening. Battle sounds could probably travel further than other less critical sounds, but not to the other side of the map.

I do think you would want to hear attacks and such offscreen, but I do agree they shouldn't be very loud. I would think you would want them just loud enough that you are aware of them, but not in your face present. Maybe the volume could depend on how far away the attack was? Like Pureon mentioned, if they are totally across the world I don't think you should hear them.

Share this post


Link to post
Share on other sites

That's what the current implementation does. It's only 'realistic' if you imagine you're in a (silent) helicopter high above the ground watching through binoculars, i.e. not very realistic at all :). (And it's not good for playability since off-screen objects will usually sound about the same as on-screen objects, which is confusing and unhelpful and unintuitive.)

Ah, I knew the current sound scheme was something like realistic 3D, but I thought it was an unintentionally flawed 3D, due to the overall lousiness of the system. I guess some HUD-like sounds (EUS, ear-up-speaker, anyone?) would never make sense as 3D too.

Share this post


Link to post
Share on other sites

What about the music not working after a match ends?

That as well :) Those are some of the bigger reasons why the sound system is being rewritten after all :)

Share this post


Link to post
Share on other sites

Yes to all questions... Works on Mac (I'm developing it on a mac), and can play the music continually.

Here is a new diff file that fixes the build on Windows... All it needed was to add 'precompiled.h' to all of the files and I got it to build in VC++10. Try it out if you like. No directional code yet. So if you'd rather wait a few more days for that it's fine...

new_sound_manager_3.diff

Edited by stwf

Share this post


Link to post
Share on other sites

I tested the patch under Ubuntu 12.04 and, after doing some quick tests, it seems it is working fine :).

There are just some additional compiler warnings when building:

==== Building lowlevel (release) ====

Config.cpp

CSoundManager.cpp

COggData.cpp

CSoundData.cpp

../../../source/soundmanager/data/CSoundData.cpp:20:2: warning: #import is a deprecated GCC extension [-Wdeprecated]

CSoundItem.cpp

CSoundBase.cpp

../../../source/soundmanager/items/CSoundBase.cpp:141:6: warning: unused parameter ‘position’ [-Wunused-parameter]

../../../source/soundmanager/data/CSoundData.cpp: In static member function ‘static CSoundData* CSoundData::soundDataFromFile(OsPath&)’:

../../../source/soundmanager/data/CSoundData.cpp:83:42: warning: ‘answer’ may be used uninitialized in this function [-Wuninitialized]

CBufferItem.cpp

CStreamItem.cpp

SMSoundGroup.cpp

JSound.cpp

../../../source/soundmanager/js/SMSoundGroup.cpp:158:6: warning: unused parameter ‘TimeSinceLastFrame’ [-Wunused-parameter]

../../../source/soundmanager/js/SMSoundGroup.cpp: In member function ‘bool CSMSoundGroup::LoadSoundGroup(const VfsPath&)’:

../../../source/soundmanager/js/SMSoundGroup.cpp:193:1: warning: unused variable ‘el_replacement’ [-Wunused-variable]

../../../source/soundmanager/js/JSound.cpp:92:6: warning: unused parameter ‘argc’ [-Wunused-parameter]

../../../source/soundmanager/js/JSound.cpp:160:8: warning: unused parameter ‘argc’ [-Wunused-parameter]

../../../source/soundmanager/js/SMSoundGroup.cpp: At global scope:

../../../source/soundmanager/js/SMSoundGroup.cpp:114:13: warning: ‘void HandleError(const wstring&, const VfsPath&, Status)’ defined but not used [-Wunused-function]

JAmbientSound.cpp

../../../source/soundmanager/js/JAmbientSound.cpp:83:8: warning: unused parameter ‘argc’ [-Wunused-parameter]

JMusicSound.cpp

../../../source/soundmanager/js/JMusicSound.cpp:72:8: warning: unused parameter ‘argc’ [-Wunused-parameter]

==== Building mongoose (release) ====

==== Building mocks_test (release) ====

==== Building AtlasObject (release) ====

==== Building AtlasScript (release) ====

==== Building Collada (release) ====

==== Building AtlasUI (release) ====

==== Building ActorEditor (release) ====

Linking engine

==== Building pyrogenesis (release) ====

==== Building test (release) ====

main.cpp

Linking test

../../../source/main.cpp: In function ‘void Frame()’:

../../../source/main.cpp:381:10: warning: unused variable ‘pos’ [-Wunused-variable]

../../../source/main.cpp:382:10: warning: unused variable ‘dir’ [-Wunused-variable]

../../../source/main.cpp:387:9: warning: unused variable ‘down’ [-Wunused-variable]

Share this post


Link to post
Share on other sites

I get basically the same errors in VS2010 with the latest patch, are you sure it's a new one?


1>------ Build started: Project: simulation2, Configuration: Release Win32 ------
2>------ Build started: Project: engine, Configuration: Release Win32 ------
1> CCmpSoundManager.cpp
2> COggData.cpp
2>..\..\..\source\soundmanager\data\COggData.cpp(49): error C2065: '_O_BINARY' : undeclared identifier
2>..\..\..\source\soundmanager\data\COggData.cpp(49): error C3861: '_setmode': identifier not found
2>..\..\..\source\soundmanager\data\COggData.cpp(50): error C2065: '_O_BINARY' : undeclared identifier
2>..\..\..\source\soundmanager\data\COggData.cpp(50): error C3861: '_setmode': identifier not found
2>..\..\..\source\soundmanager\data\COggData.cpp(119): error C2057: expected constant expression
2>..\..\..\source\soundmanager\data\COggData.cpp(119): error C2466: cannot allocate an array of constant size 0
2>..\..\..\source\soundmanager\data\COggData.cpp(119): error C2133: 'pcmout' : unknown size
2> CSoundData.cpp
1>C:\Users\Ben\devel\ps\source\lib/external_libraries/openal.h(34): fatal error C1083: Cannot open include file: 'AL/al.h': No such file or directory
2>..\..\..\source\soundmanager\data\CSoundData.cpp(20): fatal error C1083: Cannot open type library file: 'c:\users\ben\devel\ps\source\soundmanager\data\csounddata.h': Error loading type library/DLL.
2>
2> CBufferItem.cpp
2>..\..\..\source\soundmanager\items\CBufferItem.cpp(42): error C2057: expected constant expression
2>..\..\..\source\soundmanager\items\CBufferItem.cpp(42): error C2466: cannot allocate an array of constant size 0
2>..\..\..\source\soundmanager\items\CBufferItem.cpp(42): error C2133: 'al_buf' : unknown size
2> CSoundBase.cpp
2>..\..\..\source\soundmanager\items\CSoundBase.cpp(18): warning C4627: '#include "CSoundBase.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CSoundBase.cpp(19): warning C4627: '#include "soundmanager/CSoundManager.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CSoundBase.cpp(20): warning C4627: '#include "soundmanager/data/CSoundData.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CSoundBase.cpp(24): warning C4627: '#include "lib/timer.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CSoundBase.cpp(266): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?
2> CSoundItem.cpp
2>..\..\..\source\soundmanager\items\CSoundItem.cpp(18): warning C4627: '#include "CSoundItem.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CSoundItem.cpp(19): warning C4627: '#include "soundmanager/data/CSoundData.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CSoundItem.cpp(66): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?
2> CStreamItem.cpp
2>..\..\..\source\soundmanager\items\CStreamItem.cpp(18): warning C4627: '#include "CStreamItem.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CStreamItem.cpp(19): warning C4627: '#include "soundmanager/data/COggData.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\items\CStreamItem.cpp(93): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?
2> JAmbientSound.cpp
2>..\..\..\source\soundmanager\js\JAmbientSound.cpp(18): warning C4627: '#include "JAmbientSound.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JAmbientSound.cpp(19): warning C4627: '#include "maths/Vector3D.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JAmbientSound.cpp(21): warning C4627: '#include "lib/utf8.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JAmbientSound.cpp(22): warning C4627: '#include "ps/Filesystem.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JAmbientSound.cpp(24): warning C4627: '#include "soundmanager/CSoundManager.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JAmbientSound.cpp(98): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?
2> JMusicSound.cpp
2>..\..\..\source\soundmanager\js\JMusicSound.cpp(18): warning C4627: '#include "JMusicSound.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JMusicSound.cpp(19): warning C4627: '#include "maths/Vector3D.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JMusicSound.cpp(21): warning C4627: '#include "lib/utf8.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JMusicSound.cpp(22): warning C4627: '#include "ps/Filesystem.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JMusicSound.cpp(24): warning C4627: '#include "soundmanager/CSoundManager.h"': skipped when looking for precompiled header use
2> Add directive to 'precompiled.h' or rebuild precompiled header
2>..\..\..\source\soundmanager\js\JMusicSound.cpp(86): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?
2> Generating Code...
========== Build: 0 succeeded, 2 failed, 16 up-to-date, 0 skipped ==========

Share this post


Link to post
Share on other sites

hmm, wow that was a mistake. I did upload the wrong one. I apologize for the time wasted...

The good news is that the directionality is done and will get uploaded tonight. I think the overall workings of it should get tweaked over a couple of iterations, the first pass is handled like this.

Objects on the screen or in the a 10% buffer area around the screen are laid out as they appear horizontally on the screen with the sides of the screen at 60 degrees off center, all at a constant distance that is equal to the height of the camera. The volume rolloff is handled is set as exponential, so the higher the camera is the quieter all of the placed sounds are. The only other modification is that items in the 10% buffer around the screen get triple volume rolloff as items on the screen, so they will always sound quieter than similar sounds on screen.

Anything outside of the 10% buffer just isn't played, although I do support the eOmnipresent flag that plays the sound at the same location as the listener.

Also I added a flag eDistanceless that will play a sound at a location whether or not it is on the screen. Sounds with this flag set get pinned to 70 degrees maximum right or left of center, since the object would be to get the user to scroll the map to the right or left, not to look behind themselves!

As always all comments or questions welcome...

Share this post


Link to post
Share on other sites

Works very well. Only issues I saw:

1) Menu > Settings > Enable Music has no effect (unticking still plays music)

2) When asking units to move into an area off screen, there is no audio verification that the click happened (maybe user clicks need to be omnipresent?)

3) Some music and voices and actions and such are louder than others - this really needs to be balanced by the sound guys!

Other than those, works nicely. Directional sound appears to be working nicely, and when I move away sounds stop, sounds aren't bleeding through the FoW/SoD, and nothing too far off screen is playing. So looks like all the current issues with the Alpha 10 sound system have been fixed.

Nice job! :-) Once you finish the windows build fixes, lets start the work to get this reviewed and committed. Post your patch on the trac ticket, mark with "patch review" tags, and then bug someone to review it :-)

Share this post


Link to post
Share on other sites

Brilliant work! :D

3) Some music and voices and actions and such are louder than others - this really needs to be balanced by the sound guys!

Does the Gain value work in the new sound manager? In most cases it should already be set to balance the sounds. Otherwise I can go through and make changes after it's committed.

Share this post


Link to post
Share on other sites

Brilliant work! :D

Does the Gain value work in the new sound manager? In most cases it should already be set to balance the sounds. Otherwise I can go through and make changes after it's committed.

In this case make sure you use vorbisgain (supposing 0 A.D. is compatible with it) to do it, to avoid losing audio quality.

Other audio suggestion here.

Share this post


Link to post
Share on other sites
Definitely agree that a new sound system is worth a slight delay... also on that matter, where does programming stand with battle tracks?

I.e. how likely are they to be introduced in A11?

http://www.wildfiregames.com/forum/index.php?showtopic=16140entry241354

Might be possible to get battle detection in and update the sound system. Just posting this here for reference.

[edit] Just realized that's not public, so that link isn't much good for you. :(

Share this post


Link to post
Share on other sites

Here is the assertion I keep getting, on the Windows build only

From the message "path uses both slash and backslash", Looks like somewhere there is a mismatch with path separators (which is slash for mac, linux and backslash for windows )

Share this post


Link to post
Share on other sites

Tried current git, it fails to build on Ubuntu 12.04:

In file included from ../../../source/ps/Game.cpp:48:0:
../../../source/soundmanager/CSoundManager.h:14:23: fatal error: OpenAL/al.h: File or directory not found
compilation terminated.

(error message translated to english by me)

Share this post


Link to post
Share on other sites

OK, I forget the code was in a branch. It builds fine now, there are still these warnings:


../../../source/soundmanager/data/CSoundData.cpp: In static member function ‘static CSoundData* CSoundData::soundDataFromFile(OsPath&)’:
../../../source/soundmanager/data/CSoundData.cpp:78:42: warning: ‘answer’ may be used uninitialized in this function [-Wuninitialized]
CSoundItem.cpp
CSoundBase.cpp
../../../source/soundmanager/items/CSoundBase.cpp: In member function ‘virtual void CSoundBase::setLocation(const CVector3D&)’:
../../../source/soundmanager/items/CSoundBase.cpp:147:19: warning: unused variable ‘loatArr’ [-Wunused-variable]
Camera.cpp
CBufferItem.cpp
CStreamItem.cpp
SMSoundGroup.cpp
TextRenderer.cpp
../../../source/soundmanager/js/SMSoundGroup.cpp: In member function ‘void CSMSoundGroup::UploadPropertiesAndPlay(int, const CVector3D&)’:
../../../source/soundmanager/js/SMSoundGroup.cpp:157:18: warning: unused variable ‘screenWidth’ [-Wunused-variable]
../../../source/soundmanager/js/SMSoundGroup.cpp: At global scope:
../../../source/soundmanager/js/SMSoundGroup.cpp:231:6: warning: unused parameter ‘TimeSinceLastFrame’ [-Wunused-parameter]
../../../source/soundmanager/js/SMSoundGroup.cpp: In member function ‘bool CSMSoundGroup::LoadSoundGroup(const VfsPath&)’:
../../../source/soundmanager/js/SMSoundGroup.cpp:266:1: warning: unused variable ‘el_replacement’ [-Wunused-variable]
../../../source/soundmanager/js/SMSoundGroup.cpp: At global scope:
../../../source/soundmanager/js/SMSoundGroup.cpp:188:13: warning: ‘void HandleError(const wstring&, const VfsPath&, Status)’ defined but not used [-Wunused-function]
JSound.cpp
../../../source/soundmanager/js/JSound.cpp:91:6: warning: unused parameter ‘argc’ [-Wunused-parameter]
../../../source/soundmanager/js/JSound.cpp:159:8: warning: unused parameter ‘argc’ [-Wunused-parameter]
ParticleEmitter.cpp
JAmbientSound.cpp
HeightMipmap.cpp
../../../source/soundmanager/js/JAmbientSound.cpp:84:8: warning: unused parameter ‘argc’ [-Wunused-parameter]
Color.cpp
ColladaManager.cpp
JMusicSound.cpp
../../../source/soundmanager/js/JMusicSound.cpp:73:8: warning: unused parameter ‘argc’ [-Wunused-parameter]
...
==== Building pyrogenesis (release) ====
Creating obj/pyrogenesis_Release
main.cpp
../../../source/main.cpp: In function ‘void Frame()’:
../../../source/main.cpp:378:10: warning: unused variable ‘pos’ [-Wunused-variable]
../../../source/main.cpp:379:10: warning: unused variable ‘dir’ [-Wunused-variable]
../../../source/main.cpp:384:9: warning: unused variable ‘down’ [-Wunused-variable]

Share this post


Link to post
Share on other sites

Thanks to historic_bruno and others I have fixed all of the problems and will be pushing the final version up tonight. It's functionally the same as the current version but without the warnings and assertions on Windows.

Brilliant work! :D

Does the Gain value work in the new sound manager? In most cases it should already be set to balance the sounds. Otherwise I can go through and make changes after it's committed.

Yes, the gain being set through the xml files is being honored although I'll take another look and double check. But if not thats a bug I can fix. So that should be enough to rebalance the sound.

In this case make sure you use vorbisgain (supposing 0 A.D. is compatible with it) to do it, to avoid losing audio quality.

Other audio suggestion here.

http://www.wildfireg...40

Might be possible to get battle detection in and update the sound system. Just posting this here for reference.

[edit] Just realized that's not public, so that link isn't much good for you. :(

Since we're nearing the end of Phase 1 of this system, to get something stable and working. I'd love to move on and start adding new features and support. Most of these things will require developer support, so its more up to the community which ones they want and will implement (or be willing to lose control of)...

Edited by stwf

Share this post


Link to post
Share on other sites

OK, the long awaited final version of the first pass of the sound manager is here. Should build and run cleanly on Mac, linux and Windows. I'll keep on the lookout for bug reports... fingers crossed...

patch12.diff

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...