1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Need Help The cannon's sounds get stuck when ships broadside

Discussion in 'Storm Coding' started by DF5, Dec 28, 2015.

  1. DF5

    DF5 Powder Monkey Storm Modder

    Joined:
    Jul 28, 2009
    Messages:
    48
    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: Dec 30, 2015
  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    You mean that the sounds are played too quickly, making for a "wall of sound"?
    Or am I misunderstanding?
     
  3. DF5

    DF5 Powder Monkey Storm Modder

    Joined:
    Jul 28, 2009
    Messages:
    48
    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?
     
    Robert Nutter likes this.
  4. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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
     
    Robert Nutter likes this.
  5. Robert Nutter

    Robert Nutter Serving Victoria Provisional QA Tester 3D Artist Storm Modder

    Joined:
    Sep 22, 2008
    Messages:
    699
    Gender:
    Male
    Occupation:
    Historical Visualisation
    Location:
    London, England
    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: Dec 29, 2015
  6. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,754
    Gender:
    Male
    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.
     
    Robert Nutter likes this.
  7. Robert Nutter

    Robert Nutter Serving Victoria Provisional QA Tester 3D Artist Storm Modder

    Joined:
    Sep 22, 2008
    Messages:
    699
    Gender:
    Male
    Occupation:
    Historical Visualisation
    Location:
    London, England
    That would certainly explain the problem...but not why some experience it and others don't? :shrug
     
  8. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,754
    Gender:
    Male
    Dunno. I have always experienced the sounds cutting out.
     
  9. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    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.
     
    Robert Nutter likes this.
  10. Robert Nutter

    Robert Nutter Serving Victoria Provisional QA Tester 3D Artist Storm Modder

    Joined:
    Sep 22, 2008
    Messages:
    699
    Gender:
    Male
    Occupation:
    Historical Visualisation
    Location:
    London, England
    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...
     
  11. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    It maybe be a question about how good the computer is?
     
  12. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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.
     
  13. DF5

    DF5 Powder Monkey Storm Modder

    Joined:
    Jul 28, 2009
    Messages:
    48
    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: Dec 30, 2015
  14. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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;
    }
    
     
  15. DF5

    DF5 Powder Monkey Storm Modder

    Joined:
    Jul 28, 2009
    Messages:
    48
    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: Dec 30, 2015
  16. Robert Nutter

    Robert Nutter Serving Victoria Provisional QA Tester 3D Artist Storm Modder

    Joined:
    Sep 22, 2008
    Messages:
    699
    Gender:
    Male
    Occupation:
    Historical Visualisation
    Location:
    London, England
    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?
     
  17. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    There are all sorts of options on how to tweak that.
    You could try by increasing that value of 1.3 .
     
  18. jsv

    jsv Freebooter Storm Modder

    Joined:
    Nov 5, 2013
    Messages:
    303
    Gender:
    Male
    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...
     
  19. DF5

    DF5 Powder Monkey Storm Modder

    Joined:
    Jul 28, 2009
    Messages:
    48
    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: Dec 30, 2015
    Robert Nutter and Pieter Boelen like this.

Share This Page