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.

High Priority Levelling: Some Captains Not Correctly Initialized until Too Late

Discussion in 'Build Testing List' started by salonikasurf, Jan 13, 2016.

  1. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    @salonikasurf and @Hylie Pistof: I have merged the two threads together, because it is pretty much confirmed now that they are due to the same problem.
    It seems that the "correctly initialize characters" system that occurs ashore does NOT work in 3D Sailing Mode.

    Coast Raiders (random ships surrounding islands) and Worldmap encounters should be OK.
    But any quest characters may get affected by this, especially Treasure Quest Pirates, Governor Ship Hunting Quests and Convoy Quest Enemies.

    There are two possible solutions:
    1. Somehow ensuring that all captains at sea DO go through the Levelling system
    2. Planned Feature - Use Generic Captain and Ship Generation Functions | PiratesAhoy!

    The first requires someone to figure out why this isn't already happening.
    Ideally that someone should be @Levis, since it is his system, after all.

    The second needs doing sooner or later anyway because the current way is messy to say the least.
    But that requires some good time and effort spent and has a risk of temporarily breaking stuff.

    Can we deal with having this bug in the Beta 4 public release, to be fixed later?
     
  2. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    I would say yes for now. I want to continue with this former Captain and see how he progresses.
     
    Pieter Boelen likes this.
  3. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I think after that first "reset", he'll probably be fine. :yes
     
  4. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    I just got another one and this one was a rascal before and after I hired him. For some reason he seemed to work ok.
     
    Pieter Boelen likes this.
  5. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Was that another Treasure Quest pirate?
    My suspicion would be that it does weird things the first time and then not the second.
    This is because technically the same character gets reused and never gets reset.
     
  6. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    Ayup! He was a treasure quest Pirate Captain too.
     
    Pieter Boelen likes this.
  7. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  8. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    So I just finished taking the Marauder frigate off Martinique. It went smoothly except for the constant "sail ho!" messages that had ships popping up all over the place and had the Marauder bouncing all over the map. Until we were finally able to close and capture her. Sigh. The ship was undamaged after the battle. This makes me think this is somehow related to quest ships as other regular ships I captured stayed damaged.
     
  9. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    You know you can toggle all DirectSail updated with the [0]-key (the zero that isn't on the Numpad), right?
    That should at least avoid updates while you don't want them.

    Really? Again??? I know why that happened and it was definitely related to certain quest ships.
    The problem was when SetBaseShipData gets called for ships AFTER the battle, which isn't meant to be happening.

    But I already changed several things so that:
    1. ALL ships gets initialized right at the start of the game
    2. I removed one piece of code that used to call this again and messed things up
    3. Levelling does also call this function for any captain that wasn't properly initialized, BUT I recently added code to initialize any and all captains upon being logged into sea

    In other words: I already did a whole bunch of things to prevent this! I'm running out of things to change. o_O

    My suggestion:
    - Start a new game with the 31 Mar 2016 release that I posted just now (this isn't enforced for you, but I think I have to recommend it for this one anyway)
    - Keep an eye on whether this happens again, paying special attention to any quest ships (includes Governor Ship Hunting/Smuggling Coastguard/Escort Quest Enemy)
    - If it does happen, try to make the ship surrender so that you can post a savegame

    If I have a savegame that is definitely from a new game on the latest modpack update, then that confirms the problem is still not fixed.
    Hopefully I can then test it to see why it is still not *** working.
     
  10. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    My current install is 27 March with the latest zips. Would there be anything in the latest one that this one does not?

    I was intending to just keep playing this install until the public release, then starting over.
     
  11. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Probably there is not. I think I put all my fixes for this in the last zip.
    But I don't remember that for sure.

    In any case: still sounds weird and wrong. Dammit. :modding
     
  12. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I have to remember to get rid of that message then tomorrow.

    If you also happen to have a save with that self repairing ship, I could do a final check on that one as well.
     
  13. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    Ok. Here are 2 saves. One as we leave port and another just after the battle ends.
     

    Attached Files:

    Pieter Boelen likes this.
  14. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Problem confirmed. AGAIN! Looks like the captain IS properly initialized, but then it happens again later anyway which is NOT intentional.

    So now I'm again tracking down what function is responsible for doing this.

    This is just beyond annoying.
     
  15. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I now pretty much know what code is responsible for doing this. And I cannot even begin to describe how RIDICULOUS this shit is.
    The problem is that 'LAi_Create_Officer' was rewritten by @Levis to completely redo a character's initialization.

    When boarding a ship, that function gets called on the captain through @Maximus' 'CreateTwinCharacter' function.
    WHY does it do that? I have absolutely NO CLUE. But the combination messes things up quite nicely.

    The only solution I can think of is to replace this code in PROGRAM\Loc_ai\LAi_boarding.c:
    Code:
    // KK -->
       if (!IsFort && !IsTown)
         refEnCharacter = CreateTwinCharacter(boarding_enemy);
       else
         refEnCharacter = boarding_enemy;
    // <-- KK
    
    With this:
    Code:
    // KK -->
    //   if (!IsFort && !IsTown)
    //     refEnCharacter = CreateTwinCharacter(boarding_enemy); // PB: This causes an unintentional reset of the captain
    //   else
         refEnCharacter = boarding_enemy;
    // <-- KK
    
    I did that in attached file for testing purposes.

    Problem is that I do not know AT ALL if it is safe to do this.
    I assume there must have been a reason for that function and with this change it goes completely unused.

    Long story short:
    This is STUPIDLY COMPLICATED. Everything has been modded to death and different people's code does NOT work together the way it is meant to.
    That has really messed up consequences and apart from rewriting from scratch and cleaning everything up, I can think of no real solution.

    The attached file MAY solve the problem. Or it could cause even worse problems. I really do not know.

    But one thing is certain: This isn't even funny anymore. Holy crap, what a BLOODY MESS! :sick
     
  16. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    On second thought, I think my earlier suggestion is probably not very wise. File removed.
    This will require yet more deliberation.... :modding
     
  17. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I think extracting attached file to your PROGRAM folder should be a safer solution.

    This time I just got rid of these two lines:
    Code:
         if(!CheckAttribute(Fightincabin,"quest.officertype")) Fightincabin.quest.officertype = GetRandomOfficerType(); //Levis let's use a global function so we can easily add types later.
         LAi_Create_Officer(rand(8), &Fightincabin);
    
    So enemy captains you hire will have whatever officer type they had when they were still the captain.
     

    Attached Files:

    Hylie Pistof and ANSEL like this.
  18. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    Please don't take this wrong, but this is what I was talking about months ago when I was complaining about there being too many big changes coming too fast. It takes time to test stuff properly.

    I don't know, should it just be released as is and then continue with patches?
     
  19. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    There has definitely been too much stuff added that wasn't thought through properly nor finished.
    Unfortunately that only became apparent far too late and the person who was working on it vanished.
    So last minute I have to clean up the mess that was left. Definitely no good at all.
     
  20. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands

Share This Page