• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Tavern_2 from New Horizons

Sounds other than music appear to be defined in "RESOURCE\ALIASES\sound_alias.ini". Various sounds are defined in there, including sounds for gunshots (which work), ambient sounds such as people talking in a tavern (which work), and locator-based sounds such as the fireplace (which don't work). Besides, if the game calls for a sound which either isn't defined or doesn't have the actual sound file which the definition wants, there's a message in "system.log". There's even a message if the file does exist but it's the wrong format and the game can't play it. There are no messages for the fireplaces which aren't making sounds.
I think that's exactly the problem, because there is a limit to the number of stuff that can be defined in those alias ini files.

If I recall, there are also sounds defined in an alias.c file in PROGRAM\SOUNDS or something. Those are supposed to NOT have that problem.
But those ones don't work for 3D sound. So ideally a lot of sound should be moved to the alternate system so that the 3D sounds can function again.
Or something like that. I can't quite remember all the specifics; it was a long time ago and I was not heavily involved... :oops:
 
I have the unmodded game on my hard drive, normally used only as a base from which to create a new NH install, but it means I was able to check this. There should be two fireplaces in Oxbay, one in the town and one in the tavern, and I can't here fireplace sounds at either of them. Possibly there's something odd about my system, which would then perhaps be why I can't hear fireplace sounds in NH either.
There's a 'TraceAndLog' command right after the 'while' line, currently commented out, which shows both the original "locatorName" and the derived "locatorType". When I uncommented it, it showed that the type was being correctly set to "fireplace". Moreover, in NH, this tavern is in Havana town centre, which should have a couple of locator based sounds of its own, including a fountain, and I don't hear any sound from that either. Sound locator "fountain01" was correctly truncated to locatortype "fountain" - in fact, the report from that 'TraceAndLog' was what made me check the fountain.

Well, fountain makes sense to have no sound, because there does not appear to be a fountain alias defined in the NH sound_alias.ini file. As for fireplace, if the locator name is correct, there is an alias for that, so I suspect, looking at the numbers, that the distances and volume might be messed up. These values are defined differently in COAS, so perhaps that is the problem.

Looking at the ensuing conversation, the sounds dropping out is likely due to the older fmodex being used and its channel limitations and what FMOD terms, "virtualization," of the sounds. This could probably be resolved some through the use of priority values and distance rework in the sound alias to have those more appropriately mix/virtualize sounds in a manner where wanted sounds stay, unneeded sounds get culled by priority/distance, to reduce desired sounds from automatically becoming virtualized arbitrarily because of the channel constraints. The newer FMOD allows for more channels and I have reworked some priority for ship sounds, which is why we get better sound results in ship battles now :)
 
Well, fountain makes sense to have no sound, because there does not appear to be a fountain alias defined in the NH sound_alias.ini file.
There is indeed a definition for a fountain. The figures appear to be the same as those in GoF.
Code:
[fountain]
;minDistance was 3.0
minDistance = 3.0
maxDistance = 16.0
volume = 0.3
name = AMBIENT\LAND\water_fountain_02.wav
As for fireplace, if the locator name is correct, there is an alias for that, so I suspect, looking at the numbers, that the distances and volume might be messed up. These values are defined differently in COAS, so perhaps that is the problem.
I'll try putting in the figures from GoF. If that doesn't work, I'll try the figures from AoP, which are different again.
Looking at the ensuing conversation, the sounds dropping out is likely due to the older fmodex being used and its channel limitations and what FMOD terms, "virtualization," of the sounds. This could probably be resolved some through the use of priority values and distance rework in the sound alias to have those more appropriately mix/virtualize sounds in a manner where wanted sounds stay, unneeded sounds get culled by priority/distance, to reduce desired sounds from automatically becoming virtualized arbitrarily because of the channel constraints. The newer FMOD allows for more channels and I have reworked some priority for ship sounds, which is why we get better sound results in ship battles now :)
That might help with a different sound problem in NH, which is cannons sometimes going temporarily silent during a sea battle. (And will probably go better in a different thread in the PoTC section - in fact, I'm seriously considering moving the last few posts to such a thread. ;)) But the fireplace sounds don't drop out, they never even start.
 
There is indeed a definition for a fountain. The figures appear to be the same as those in GoF.
Code:
[fountain]
;minDistance was 3.0
minDistance = 3.0
maxDistance = 16.0
volume = 0.3
name = AMBIENT\LAND\water_fountain_02.wav

I'll try putting in the figures from GoF. If that doesn't work, I'll try the figures from AoP, which are different again.
That might help with a different sound problem in NH, which is cannons sometimes going temporarily silent during a sea battle. (And will probably go better in a different thread in the PoTC section - in fact, I'm seriously considering moving the last few posts to such a thread. ;)) But the fireplace sounds don't drop out, they never even start.

Ha! My mistake on the fountain...I was looking at POTC alias when I was attempting to figure some theories as to why it didn't work. I do see it in NH.

Either the source changed to correct something I am unaware of, or it still might be the "virtualizing" of the sound because of the low volume and if there are too many other simultaneous sounds, based on their distance, priority, volume settings, FMOD will start allocating a preference, and cull sounds that are deemed not-as-important, due to the constraint of channel resources/mixing capabilities of the product.

But, so far, it appears that the script code is looking for the locators, and is sending the message, so it "should" work. One other thing, is that sometimes, the sound file itself, though it plays in other software, doesn't always work in FMOD. I had that problem with some .ogg music files, that were fine in VLAN, but my newer FMOD would not play them at all. I simply "converted" them to .ogg (yes, you read that correctly...ogg to ogg), and voila! They worked, LOL

ETA: Just as an example theory for the fireplace. The min distance is 15.0, meaning that is the distance defined where the sound will be full strength < 15, and start to fade due to distance > 15, maxDistance = 70.0, which is where the sound > 70 can't be heard, volume = 0.5 so very low. Since no priority listed, it defaults to midway = 128. If there are a bunch of other sounds going on, and this sound can be heard a long distance, but is faint at .5 volume, it will likely get culled. If the min distance were small, like 2, max small like 8, and volume cranked to 3 or 4, in theory, if you are very close to this locator, you should hear it because presumably it will gain precedence, and if the other sounds don't have a crazy min/max of 200/1000, then they should get culled. However, if all the other sounds still have a large min/max, they will still take precedence and if you are at the channel limits, then fireplace will still get virtualized/culled from the output...so we would still be stuck wondering.

ETA #2: As for sea sounds, a hint is that the sail sound priorities are all messed up...they are the biggest culprit for cannon sounds getting virtualized/culled during battles. Any sound that has a priority setting that supercedes another sound, no matter how distant or faint, they ALWAYS take the channel, no matter what, and that is why cannons get culled.
 
Last edited:
But the fireplace sounds don't drop out, they never even start.
That is actually what I meant when I said "dropping out". I meant "completely dropping out of the game as if they don't exist".

And PROGRAM\sound\ALIAS\sounds_english.c is the "new system" that I meant.
If I understand correctly, that was created to circumvent the game engine limitations.
But by the looks of it, the programmer who created that only created the new system and didn't do the whole conversion from the existing old sounds to the new ones.
In other words: we may have the solution already, but it hasn't been utilised yet.

If so, then this could all be corrected by taking stuff from RESOURCE\INI\ALIASES\sound_alias.c and moving it into PROGRAM\sound\ALIAS\sounds_english.c instead.
 
So, does fly_ball alias in Ball_FlyNearCamera play in NH? If so, I see it calls Play3DSound and that message is slightly different:

SendMessage(Sound,"lsllllllfff",MSG_SOUND_PLAY, name, SOUND_WAV_3D, VOLUME_FX, false, false, false, 0, x, y, z);

The static sounds are played: SendMessage(Sound,"lsllllllfff",MSG_SOUND_PLAY, locatorType, SOUND_WAV_3D, VOLUME_FX, false, true, true, 0, stf(locator.x), stf(locator.y), stf(locator.z));

They are the same sound type, SOUND_WAV_3D, one is looped, the other not. But the difference I am curious about is that false, false, false in the one that presumably works, and the false, true, true that doesn't. Of those 3 parameters, the second is loop or not, but the 3rd one is "cached" or not. Now, in the source I have, which is updated beyond POTC/NH, that cached parameter is ignored, but perhaps it is not in the older version, and has some sort of relevance to something. Also, if fly_ball works, then that parameter does not indicate whether it is an alias or not, so my thought is to change the SetStaticSounds to false, true, false and see what effect that has for fireplace?

Or, just upgrade and be done with it...LOL It all works in the newer.
 
And PROGRAM\sound\ALIAS\sounds_english.c is the "new system" that I meant.
If I understand correctly, that was created to circumvent the game engine limitations.
But by the looks of it, the programmer who created that only created the new system and didn't do the whole conversion from the existing old sounds to the new ones.
The reason that only some sounds are in "sounds_english.c" is that they're voices. In English. ;) The provision is made, but not used, for alternative voice files in different languages to be recognised depending on which language is selected for the game.

The first entries in "sound_alias.ini" are footstep sounds, e.g. "step_sand", "step_grass" etc. I can hear my footsteps, so they're OK. The last entry in "sound_alias.ini" is "nightinsects". I can hear those, but not tied to locators, even though the trace command in 'SetStaticSounds' indicates that there should be some locators for them, probably near lamps. Before the definition for "nightinsects" is a comment:
Code:
; ===== this insect file should go last so we can tell if we've exceeded the number of alias names.  system.log will have errors on this name if we do
So the first thing in "sounds_alias.ini" is working, the last thing in "sounds_alias.ini" is working, and "system.log" isn't showing the errors mentioned by that comment.

so my thought is to change the SetStaticSounds to false, true, false and see what effect that has for fireplace?
I already tried that, though for a different reason. While I still thought that locator-based sounds such as fireplaces worked in the stock game (i.e. before I actually tried the stock game), I had a look at the definition of 'SetStaticSounds' in the stock version. It doesn't use "true" or "false", it uses "1" and "0", which means its version of the command is:
Code:
SendMessage(Sound, "lsllllllfff", MSG_SOUND_PLAY, locatorType, SOUND_WAV_3D, VOLUME_FX, 0, 1, 0, 0, stf(locator.x), stf(locator.y), stf(locator.z));
I tried putting that into the NH version and the fireplace still didn't make any sound, not surprising after I found that the ones in the stock game didn't make any sound either.

Basically, either my system is doing something funny and it may be that all these sounds will work on someone else's PC; or locator-based sounds never worked even in the stock game. That can be tested by anyone who wants to start up NH, either the standard storyline or FreePlay as a British corsair or merchant, and go into Speightstown tavern to listen to the fire there.
 
The reason that only some sounds are in "sounds_english.c" is that they're voices. In English. ;) The provision is made, but not used, for alternative voice files in different languages to be recognised depending on which language is selected for the game.
Maybe those are the only one in there because they're the only ones that were really necessary,
because the modder who rewrote the sound system is also one of the people who implemented the translation system.

But I've got a very distinct memory of "too many entries in the INI files" > "some sounds stop working".
 
Back
Top