• 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!

Engine Limitation Too many sound aliases

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
A routine check of "system.log" after some playing of PoTC showed some errors about "nightinsects". At the end of "RESOURCE\INI\ALIASES\sound_alias.ini" is this:
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
[nightinsects]
Nothing new has been added to "sound_alias.ini" but I'd found entries in "Greetings_alias.ini" for "Gr_Brothel's mom" and "Gr_Wench", which are commented out, and which I had uncommented so that the ladies of negotiable affection in Nevis Pirate Settlement would speak. I commented them both back out and the "nightinsects" errors no longer appeared. If I uncommented even one of them, the "nightinsects" errors were back.

What that means is, unless there's a variable somewhere which can be increased to allow more sound aliases, we've reached the limit. No more entries may be added to "Greetings_alias.ini" or "sound_alias.ini" unless, for each one that is added, one other is removed.
 
This is indeed an obnoxious hard limit in the game engine.

Yet another good reason to want to switch to Storm X or Maelstrom in the future.

This is one of the reasons @konradk wrote a new sound system in New Horizons.
I can't quite remember how it worked, but it's there and any sound that can moved to that does not take up the limited space in the ini files.
 
What that means is, unless there's a variable somewhere which can be increased to allow more sound aliases, we've reached the limit. No more entries may be added to "Greetings_alias.ini" or "sound_alias.ini" unless, for each one that is added, one other is removed.

A number of them in Greetings_alias.ini seem to have effective duplicates such as Gr_Quest_Smuggler_01 and Gr_Smuggler Agent or (Ewan Glover, Counterspy and David Fairweather). At first glance I would think changing the characters that use one to use the other would allow removal of the then redundant duplicate (they are aliases after all)? - unless I am missing something more subtle ?
 
A number of them in Greetings_alias.ini seem to have effective duplicates such as Gr_Quest_Smuggler_01 and Gr_Smuggler Agent or (Ewan Glover, Counterspy and David Fairweather). At first glance I would think changing the characters that use one to use the other would allow removal of the then redundant duplicate (they are aliases after all)? - unless I am missing something more subtle ?
This has finally been done in the latest update. It had to be done because some new greeting aliases have been added to support storylines under development.

As well as commenting out duplicates in "Greetings_alias.ini" and then using Windows Search to find and replace all uses of those duplicates with the one remaining alias, I found two aliases in "sound_alias.ini", "notebook_event" and "notebook_note". Of those, "notebook_note" is only used in "CCCdirectsail.c"; while "notebook_event" is a duplicate of "notebook_note" and is not used at all. I've commented both out and changed "CCCdirectsail.c" to use 'PlaySound("interface\notebook.wav")' instead, which is how the notebook sound is produced in other code.

That should allow for a few more greeting aliases. And now the inhabitants of brothels can have their voice greetings activated.
 
I have added a few greeting aliases, so far about 8 I think, for Devlin Opera. And I'm always on the lookout in the sound library provided to me by @Jack Rackham if there are good voice clips that I can make good use of and that fit like a glove in my storyline. Which in return means, that I don't add greeting aliases for the sake of adding them and have left a lot of characters without a voice so far.

An alternative is always to just play a voice clip through a dialog case. Which for example I would do if I felt like giving the 22 characters in my quest tavern a specific voice each. 22 greeting aliases would be way too much for characters that are not extremely relevant individually.

As for location sounds, I have added four pieces of music that are unused so far but I'd like to use them in the future of the quest. I don't know too much about location music though, and haven't even managed so far to change the sound of my quest tavern from standard tavern music to pirate tavern music.
 
Eight! You may need to lose some of them, I'm not sure that I've freed up that many. Check "system.log", see if there is any mention of "nightinsects", and if so then you'll need to lose some greetings. You'll certainly not get away with 22. (Possibly use aliases for just Bonnie and Blaze, and play voice clips in dialog files for everyone else? Especially for characters such as Haraldo who only use a single voice file. If you can remove these single-file aliases, it will free up more slots for other modders.)

For location sounds, have a look in "PROGRAM\sound\sound.c", where you'll find a few lines from @Jack Rackham such as:
Code:
if(CheckAttribute(loc,"id") && loc.id == "GB_Charleston_town_tavern") SetMusicAlarm("Rogers_gunroom");
Then, in "PROGRAM\sound\ALIAS\music_standard.c":
Code:
tmpref.Rogers_gunroom.f1.name = "MUSIC\wr_gunroom.ogg";
You could try doing something similar for your quest tavern.
 
Eight doesn't seem to be that much, but until recently I didn't know about any limit and I'm just late to the party while earlier stuff had the luxury of seemingly infinite greeting aliases. As far as I know the stock game has a lot of greeting aliases, and I assume they are still around and have a lot of potential to make more room. For example, I remember there were quite a few specific greeting aliases for quest soldiers that appear in stock game content. If there were just three english soldiers greeting aliases, each with the complete set of soldier phrases and each with a different english voices, and if they then were distributed equally between english colonies and quest soldiers, then this could maybe save some space. And do people like Ferro Cerezo and Faust Gasquet really need their own greeting alias?
 
Eight is a lot; the reason this thread exists is that I noticed the problem when I tried to add just two!

The stock game does have a lot of aliases and the reason you're getting away with what you have already is that I got rid of some duplicates. Looking at English soldier greetings, I can see that most of them are duplicates of "Gr_Oxbay Soldier", so that gives me some more to remove.

But do remember that you're not the only one developing a story before you use up all the aliases that I've freed. @Sebrian might need some for "Hoist the Colours". ;)
 
Hopefully we will move to a better engine at some point to avoid this issue entirely. :)

Edit: I can do a workaround in my story and probably in Singapore, by just doing some code trickery in the dialogue code for each npc to play a sound file every time you talk to a certain npc ...

Just like @BathtubPirate suggested above

An alternative is always to just play a voice clip through a dialog case. Which for example I would do if I felt like giving the 22 characters in my quest tavern a specific voice each. 22 greeting aliases would be way too much for characters that are not extremely relevant individually.
 
Last edited:
You could try doing something similar for your quest tavern.
Ah, I see, the tavern would normally have to be defined to be in the townsack of a pirate town for the pirate songs to play there?

Actually, would it be possible to just play the song "Fifteen men on a dead man's chest..." in a loop in a location? :p I think when the first music track in a location is over it starts again, but only after quite a long break. The only way I can think of is to have no location music at all, play the song through a quest case and delay another quest case by the duration of the song... And yes, the player will probably spend more time in the location than the two and a half minutes of the song.
 
Actually, would it be possible to just play the song "Fifteen men on a dead man's chest..." in a loop in a location? :p I think when the first music track in a location is over it starts again, but only after quite a long break. The only way I can think of is to have no location music at all, play the song through a quest case and delay another quest case by the duration of the song... And yes, the player will probably spend more time in the location than the two and a half minutes of the song.
Yes. Have a look at "PROGRAM\sound\sound.c", where @Jack Rackham has defined several "silent" sound types for his quest locations, e.g.:
Code:
        case "silent_loghouse":
            //used in Loghouse
            SetSoundScheme("silent_loghouse");
            SetMusicAlarm("silence");
            break;
So you'd probably want something like:
Code:
        case "silent_tavern":
            SetSoundScheme("tavern");
            SetMusicAlarm("silence");
        break;
Then, in the location definition, replace 'locations[n].type = "tavern";' with 'locations[n].type = "silent_tavern";'

Or you could put something like this into "sound.c":
Code:
        case "yo-ho-ho_tavern":
            SetSoundScheme("tavern");
            SetMusicAlarm("music_yo-ho-ho");
        break;
In "PROGRAM\sound\ALIAS\music_standard.c", add this somewhere:
Code:
tmpref.music_yo-ho-ho.f1.name = "MUSIC\YoHo2.ogg";
And then use 'locations[n].type = "yo-ho-ho_tavern";' for the location definition. That ought to make the song play permanently in your quest tavern.
 
Back
Top