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

Fixed Levelling: Sailing Skill Increases through Save/Load

jsv

Freebooter
Storm Modder
I'm attaching the save. It has an intriguing property: when I load it, make a new save and then load the new save, my sailing skill goes up by 2-4%. I'm well on my way to becoming the best sailor in the world by mashing f5-f6-f5-f6... :aar
 

Attachments

  • -=Alfonso=- QuickSave 29.zip
    706.9 KB · Views: 115
Still have that problem with sailing skill going up after saving/loading...
 
Later today than. I don't have other saves from that game at hand and I'd like to check if they all are affected or it's this one that is particularly lucky :)
 
Later today than. I don't have other saves from that game at hand and I'd like to check if they all are affected or it's this one that is particularly lucky :)
To ensure we don't forget about it, I've split the above posts to their own Bug Tracker entry.
If you cannot replicate it, we can always archive it as such. But at least it serves as a reminder. :doff
 
It's 100% reproducible on both my PC's from that save I've posted in the other thread. I just want to check if I can figure out when it had started.
Nothing like that in new games I start, so far.
 
It's 100% reproducible on both my PC's from that save I've posted in the other thread.
Thanks for reminding me of that post; I have now copied it so it appears at the top here as well. :doff
 
I've looked at older saves... It seems the bug first appeared pretty early in the game, after my first sailing out.
It was a smuggling run around Puerto Rico. No bug before it, no bug at sea, already a bug when I'm back in town.
 
I've looked at older saves... It seems the bug first appeared pretty early in the game, after my first sailing out.
It was a smuggling run around Puerto Rico. No bug before it, no bug at sea, already a bug when I'm back in town.
Maybe you could enable the various debug toggles at the top of PROGRAM\Leveling.c?
This sounds like quite a mysterious effect to me, but if I understand correctly, that should at least give us more data.
Then hopefully @Levis can make some sense of it.
 
I'll try to debug it tomorrow, but something is really broken in sailing skill levelling. I start another smuggler-from-Puerto-Rico game and again I'm doing a Silk run to Oyster Beach.
The entire day my sailing remains 2+0%. Then, just as I approach the mooring point, sun sets and it suddenly jumps to +23%. I moor and it's 24% already. I wait until 18:01 next day and it's +73%
By this time the save/reload bug is already here.
 
Maybe you could enable the various debug toggles at the top of PROGRAM\Leveling.c?
This sounds like quite a mysterious effect to me, but if I understand correctly, that should at least give us more data.
Well, repeating the loading-saving-loading process with tracing on gave me somewhat underwhelming results. This:
Code:
!!! Reload to QC_brothel (index=158)
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
XP ERROR: NEGATIVE OR ZERO XP
repeats on each load, and that's all.

That error is generated in AddXP:
Code:
if(_exp <= 0)
{
     _exp = -(_exp);
     if(DEBUG_EXPERIENCE>0) { Trace("XP ERROR: NEGATIVE OR ZERO XP");}
}

Then hopefully @Levis can make some sense of it.
Let's hope. To me it only tells that the game doesn't hold experience one can acquire in a brothel in particularly high regard. :rumgone
 
Last edited:
Ah, my bad. Had to set the debug variables to 2. Here we go:

Code:
!!! Reload to QC_brothel (index=158)
POSTINIT: state is 1
POSTINIT: restore events for Alfonso Palomo
POSTINIT: restore skill XP for skill Sailing for Alfonso Palomo
XP LOG: Called AddXPtoSkillsMain with Exp: 555
XP LOG: AddXP to skill: Sailing Old Skill Exp: 11439 increase with: 555 needed for next level: 12118
XP LOG: chance of increasing importance: 0 for skill: Sailing
XP LOG: Start InitAutoSkillsSystem for Morys Biddulph id: Morys Biddulph2
XP ERROR: NEGATIVE OR ZERO XP
XP LOG: Start InitAutoSkillsSystem for Roger Hayes id: Roger Hayes2
XP ERROR: NEGATIVE OR ZERO XP
XP LOG: Start InitAutoSkillsSystem for Celestine Maupassant id: Mistress
XP ERROR: NEGATIVE OR ZERO XP
XP LOG: Start InitAutoSkillsSystem for Valentina Malter id: QCbartender
XP ERROR: NEGATIVE OR ZERO XP

From the character dump:

Code:
directsail1 =
  closestdist = 2.4000397
  closestisland = QuebradasCostillas
sailingminutes = 15
basetime = 1
directsailencountergroup = 3
postevent =
  skills =
    sailing = 555
Obviously, that postevent stuff should be cleared at some point after restoring and it isn't
 
Last edited:
hmmm....will look at it... it should indeed clear after its done
 
download this to your program folder.
 

Attachments

  • Leveling.c
    66.6 KB · Views: 146
Is this what it looks like? I started a new game this morning at level5 and here it is at level10.
POTC4 2015-12-10 15-06-12-92.jpg
 
it causes your xp to rise way to quickly indeed ...
 
OK, that fixes the save/load problem. I'll do some actual playtesting on weekend to see if there is any more strangeness about sailing skill growth, but I think we can close this one as fixed.
 
The 'postevent' attribute was not cleared in RestoreCharacterEvents. It the case of the above quicksave there was only sailing experience stored in that attribute, but potentially... @Levis would know better, but I think all kinds of nasty surprises were possible.
 
Back
Top