• 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 The cannon's sounds get stuck when ships broadside

DF5

Sailor Apprentice
Storm Modder
I found there is a problem of all the games made by storm engine:When a ship fires a boradside, the cannon's sounds will get stuck. I think the key point is the bad optimization of storm engine. Each cannon which is firing must plays a wav file one time. When a lot of cannos fire, the bandwidth of computer will be overload, so some cannon's sounds will be ignored. I think it's better to mix the sperate sound files to one file for broadside. Is there any way to do like this?:eek:
 
Last edited:
You mean that the sounds are played too quickly, making for a "wall of sound"?
Or am I misunderstanding?
 
I meand that The sound system gets overloaded when firing a broadside - each cannon's firing is played individually, which overloads the sound engine and only 2-3 sounds get played. Perhaps this could be revised so that a broadside has its own sound file?
 
I don't think I've ever even noticed that problem. Whenever I fire a broadside, I hear a LOT of cannons.
Sometimes when they all fire at the same time and I have a ship with many cannons, it can sound a bit "much" though.

It may be possible to change this, but I don't think that would be a quick job.
The code that plays the sound would need to be moved and I'm not sure where to move it for NPC ships.

There would also need to be different sounds for different numbers of cannons and different calibres.
It would also be very hard to get a timing that seems right for low and high cannon skills.
So there would end up being a LOT of individual sounds indeed. Those would all need to be made.

Also, the underlying code is very, very different between AoP and PotC.
So if something is indeed to be done for this, it would have to be for PotC I think.
We can mark it as a "Feature Request" for that game, if you like. :doff
 
I can confirm that this has plagued me right from Build 13. On any ship with more than 10 guns in a broadside, at least some sounds are lost. Even on my system I'm using now, the problem exists...almost as much as on my old system.

It definitely seems to be, as DF5 suggests, to do with the individual files not keeping up. Mine are coming off an SSD so I'm sure it's not a drive speed issue, but it's feasible it could be more a graphics thing slowing it. My sound card is Apple Core with Cirrus, my old one a legacy Realtek with Realtek software, so completely different but both suffer the same which also prompts me to think that's not it either...my CPU is well within specs so I doubt it's that.

It certainly harms submersion in the game for me, so I too would love to see research into this as a feature request for other games :)

EDIT: For me, the 42iber sound DOESN'T get affected by this...occasionally it might, but rarely. Nor does the 68iber. In fact, now I think about it, the worst for it seems to be long 24ibs and long 12ibs...I'm sailing a 3rd Rate Poseidon at the moment and I only hear 10 or so guns per broadside...yet when I come across larger ships mounting long 32's (like the Flying Dutchman), almost all their guns are audible. I have a War Pinnace which mounts long 9's and that's unaffected too. I know other games use sound channel options (ie 128, 256 and so on) to control this...is it the same here?
 
Last edited:
There was a thread a long time ago about the sound issues of the Storm engine. From my alleged memory it is extremely primitive and can only handle maybe 12 sounds at once.
 
That would certainly explain the problem...but not why some experience it and others don't? :shrug
 
Again ,I think, its skills its about. Low cannon skills will make the cannons fire at different time,
high skills and all cannons fire at the same time. I have no problem with the cannon sounds.
 
Ansel, if skill is low and the guns fire off slowly, the problem doesn't occur; it's only when they fire in quick succession that I get it, at least. So in a way, having lower skill could actually be a way of solving the problem...
 
Ansel, if skill is low and the guns fire off slowly, the problem doesn't occur; it's only when they fire in quick succession that I get it, at least. So in a way, having lower skill could actually be a way of solving the problem...
Makes sense, no? Plenty sounds all having to play at the same time = problem.
I ever recall Captain Murphy mentioning to have similar issues with Unity.
Dozens of sounds at the same time is probably a tough nut to crack for any engine.
 
So, is any way to limit the speed of cannon's firing while the cannon skill's level is high? I think that all cannons fire at the same time is also not realistic. It's better to limit the time to 2 seconds or more during which all cannons fire off, no matter how high the cannon skill is. Is there any code to modify it?:eek:
 
Last edited:
Probably this section from PROGRAM\SEA_AI\AICannon.c:
Code:
// calculate delay before fire
float Cannon_GetFireTime()
{
   aref aCharacter = GetEventData();

   float fCannonSkill = stf(aCharacter.TmpSkill.Cannons);
   float fFireTime = 1.3 - fCannonSkill;
   fFireTime = fFireTime * Bring2RangeNoCheck(3.0, 1.0, 0.0, 1.0, stf(aCharacter.Ship.Crew.MinRatio));
   fFireTime = frnd() * fFireTime * 6.0;
   if(iRealismMode == 0) { fFireTime = fFireTime * ARCADE_MULT_CANNONS; } // NK
   aCharacter.canfiretime = fFireTime; // NK 05-04-18
   return fFireTime;
}
 
I'm not familiar with C++, and only know about Visual Basic. if just enlarge the value of fire time, it will also affact the speed to be more slow in low cannon skill. I think it's more appropriate to add some code of condition judgment to give a limitation, just like this in VB:if firetime < 2 then firetime=2 end if. but I'dont know how to translate them to C++.
 
Last edited:
I know Warscape engine is designed to handle up to 320 sounds at once, so it's clearly possible...just begs the question if it's possible here. Pieter, is it the float time which I'd need to change to slow the firing down?
 
There are all sorts of options on how to tweak that.
You could try by increasing that value of 1.3 .
 
Probably this section from PROGRAM\SEA_AI\AICannon.c:
Code:
// calculate delay before fire
float Cannon_GetFireTime()
{
aref aCharacter = GetEventData();

float fCannonSkill = stf(aCharacter.TmpSkill.Cannons);
float fFireTime = 1.3 - fCannonSkill;
fFireTime = fFireTime * Bring2RangeNoCheck(3.0, 1.0, 0.0, 1.0, stf(aCharacter.Ship.Crew.MinRatio));
fFireTime = frnd() * fFireTime * 6.0;
if(iRealismMode == 0) { fFireTime = fFireTime * ARCADE_MULT_CANNONS; } // NK
aCharacter.canfiretime = fFireTime; // NK 05-04-18
return fFireTime;
}
One thing to note here, there is no guaranteed minimal delay in this function. There is multiplication by frnd(), which can get arbitrary close to zero and no additions since then...
 
I've got an idea. Inseart a code to limit the fFireTime not to be too small. that will not affact low cannon skill to fire.
Code:
    float fCannonSkill = stf(aCharacter.TmpSkill.Cannons);
    float fFireTime = 1.3 - fCannonSkill;
    if (fFireTime<0.6) {fFireTime=0.6}
    fFireTime = fFireTime * Bring2RangeNoCheck(3.0, 1.0, 0.0, 1.0, stf(aCharacter.Ship.Crew.MinRatio));
    fFireTime = frnd() * fFireTime * 6.0;

or make the fCannonSkill to be multiplied by a coefficient witch is between 0 to 1.
Code:
    float fCannonSkill = stf(aCharacter.TmpSkill.Cannons);
    float fFireTime = 1.3 - fCannonSkill*0.5;
    fFireTime = fFireTime * Bring2RangeNoCheck(3.0, 1.0, 0.0, 1.0, stf(aCharacter.Ship.Crew.MinRatio));
    fFireTime = frnd() * fFireTime * 6.0;
 
Last edited:
Back
Top