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.

Tutorial TECHNICAL TIP - Understanding Demasting/Flag Graphical Errors and Reducing Problems

Discussion in 'TheBlackKnight's Mods and Guides' started by TheBlackKnight, Apr 7, 2014.

  1. TheBlackKnight

    TheBlackKnight Corsaire Flibustier Storm Modder

    Joined:
    Dec 2, 2013
    Messages:
    339
    Gender:
    Male
    Occupation:
    Professional Engineer Retired Army Officer
    Location:
    Libertatia
    All,

    This post is related to the graphical anomalies that can occur from demasting ships.
    It is somewhat from a revisit from old CoAS tutorial post by Jonesie85/Luke159 back in 2012.
    They made a basic description of how to disable dismasting which was good at the time because of all the errors and CTD being caused by specific ship models in GOF 1.2.

    The definition source of mast damage is located in AIShip.c (Program/SeaAI)
    If you change this code to the following values the masts will never fall (but sails continue to take damage):

    Code:
    switch (iDamageType)
        {
            case SHIP_MAST_TOUCH_ISLAND:
                fDamage = fDamage + 0.0;
            break;
            case SHIP_MAST_TOUCH_SHIP:
                //aref rCollideCharacter = GetEventData();
                fDamage = fDamage + 0.0;
            break;
            case SHIP_MAST_TOUCH_BALL:
                int    iBallType = sti(AIBalls.CurrentBallType);
                switch (iBallType)
                {
                    case GOOD_BALLS:
                        fDamage = fDamage + 0.0;
                    break;
                    case GOOD_GRAPES:
                        fDamage = fDamage + 0.0;
                    break;
                    case GOOD_KNIPPELS:
                        fDamage = fDamage + 0.0;
                    break;
                    case GOOD_BOMBS:
                        fDamage = fDamage + 0.0;
                    break;
                }
            break;
        }
    Now here is the "sticky wicky".
    If you do this you are in essence disabling the feature entirely.
    But, the problem that I have found in current demasting is the default values are set way TOO HIGH for cannon damage (regardless of cannon damage setting of CoAS, Inbetween, or Realistic)

    My recommendation is something closer to this:

    Code:
    switch (iDamageType)
        {
            case SHIP_MAST_TOUCH_ISLAND:
                fDamage = fDamage + 0.1;
            break;
            case SHIP_MAST_TOUCH_SHIP:
                //aref rCollideCharacter = GetEventData();
                fDamage = fDamage + 0.1;
            break;
            case SHIP_MAST_TOUCH_BALL:
                int    iBallType = sti(AIBalls.CurrentBallType);
                switch (iBallType)
                {
                    case GOOD_BALLS:
                        fDamage = fDamage + 0.025;
                    break;
                    case GOOD_GRAPES:
                        fDamage = fDamage + 0.0;
                    break;
                    case GOOD_KNIPPELS:
                        fDamage = fDamage + 0.1;
                    break;
                    case GOOD_BOMBS:
                        fDamage = fDamage + 0.025;
                    break;
                }
            break;
    Granted, in real life a lucky shot could quickly demast a vessel without a doubt.

    However, if you get into a large naval battle with non-realistic damage and/or very high levels of difficulty levels (enemy captains with high skills and ability to shoot at extreme distances), the frequency of demasting with the original file values can just keep getting worse until the whole screen can go black with graphical anomalies, so although this does not completely solve the problem, the above code does reduce the anomalies that occur, but not disable the function, and just make it bit more difficult to demast a ship.

    The primary reason this happens is due to the way the Storm Engine handles the demasting graphics procedure between the masts/sails (which are separated gm/texture files) and are combined into the sinking masts into the ocean as a single sail/mast model which "hang around".

    These bugs have never been completely eliminated, but were improved in the Storm Engine 2.8+ in POTEHO.
    Flag artifacting anomalies are linked the same problem, as they are normally tied to the masts.
    Flag anomalies can be corrected by relocating the flags on ship models to a different locator point on the model, but that requires fixing every ship that exhibits the problem and removes what sometimes would be the correct flag location for the ship in the first place.
    CTD and general crashes are usually linked to improper mast gm models that were never fully separated from the ship model itself or have some locator issues.
    The good news is many gm models have been updated since GOF 1.2, and most of these CTD have been mostly eliminated.

    The word of caution here is to be careful about just adding ship models from POTC, AoP:CT, CoAS, or POTEHO into another game directly without full testing the ship IN GAME. The results are not always clear cut, and results can vary.
     
    Last edited: Apr 7, 2014
    Hylie Pistof and Laurens DG like this.

Share This Page