• 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 Boarding: Inconsistent Crashes Related to Looting

Half of my problem is that one moment the bug seems to be recurring consistently, and then I’m freely looting. It seems to be different for every ship.

I’ll do some more work tomorrow, but I’m too tired now. I did notice this, though...
Loc_ai\LAi_boarding.c said:
DeleteBattleInterface();
StartBattleLandInterface();
Whereas a few other functions elsewhere, relating to boarding, are like this...
DeleteBattleInterface();
InitBattleLandInterface();
StartBattleLandInterface();
As for the backdrop - there is nothing there until after looting a body, which is interesting.
 
Last edited:
Peculiar; don't know why that would be.

You can try adding the extra line, but I'd be surprised if that were related. Might even be stock game code, that.

I do recommend not changing too much at the same time, otherwise it becomes very hard to figure out which change actually had which effect. :facepalm

Half of my problem is that one moment the bug seems to be recurring consistently, and then I’m freely looting. It seems to be different for every ship.
I suspect the timing has something to do with it as well.
For all intents and purposes, it is probably quite random and, indeed, inconsistent.
Bugs that cannot be consistently reproduced are a definite pain to sort out. :(
 
I do recommend not changing too much at the same time, otherwise it becomes very hard to figure out which change actually had which effect. :facepalm
I always back-up the files, and I’ve reverted those I have changed for the time being. ;)
I suspect the timing has something to do with it as well.
Which might suggest it’s a regular update, such as checking the status of the sails (without regard as to whether or not it actually repairs them). In fact, their actual status may well play a big part in it, which might be why there are no problems on one ship, but the next one in the same fleet crashes every time. For instance, it’s one thing to have a few pocks but if a mast is down then it could change how it’s all equated. Bear in mind that the weird backdrop only ever seems to show the sails.
 
Last edited:
Which might suggest it’s a regular update, such as checking the status of the sails (without regard as to whether or not it actually repairs them). In fact, their actual status may well play a big part in it, which might be why there are no problems on one ship, but the next one in the same fleet crashes every time. For instance, it’s one thing to have a few pocks but if a mast is down then it could change how it’s all equated. Bear in mind that the weird backdrop only ever seems to show the sails.
Sounds plausible to me. Lots of variables involved.
 
Also... if you look closely at the sails in the image - notice the holes? That’s clearly not random, the game is actually trying to run the environment, and seemingly it only happens during an inventory screen. The way I see it is that if I’m just moping around my deck then I can see everything for as far as my scope will allow me, but during boarding the logic is different. End of the day, the game is trying to update things as it normally would but it in the case of boarding it is being prevented from doing so, and as a result it either bails because it can’t do something or it is being passed a variable which was not declared properly or at all. So... what needs to be done is to either allow the environment to continue doing stuff, and it would certainly be interesting to have a battle raging in the background while boarding, or everything needs to be paused - and I think that’s the key, something is not being paused and by the looks of things it’s the sail updates.

Having said this, it might not solely be the sails which update, but rather when the environment updates it is the first thing which happens, and maybe it stops straight away either because the code tells it to or an error kicks in. Therefore, it might crash because the game wants to carry on updating or the error is too serious.

One thing which might be worth checking is to see how often a crash occurs when other ships are in the area.
 
Last edited:
I always assumed that those sails were always there to begin with, showing in the 3D space coordinates of the 3D Sailing Mode ships.
But normally, the deck location is around the (0,0,0) point of the 3D Sailing Mode, so the chances of you being near those sails are remote.
Still, it does happen sometimes and that is when you see them.

No clue if that is true at all. But as it didn't seem to do any harm, that has always been my personal explanation for it.
 
Ah yes, I have noticed on the map that the ship is placed at the centre. Well then, maybe the sails are showing at that location but the rest of the ship is where it is supposed to be, and hence the problem? Thing is, now that I’ve noticed the sails I always look for them, and it seems as though they’re always there after looting.

So actually, if my theory was right about the game not being able to link the amount of sail cloths with the actual status of the sails... well if the sails are in one place and the cargo in another, then it could be relevant after all.

Anyway, I am seriously out for now, I said this an hour ago! :ko
 
Last edited:
If they really do only show after looting, try switching to the Blue Interface and/or disable Dynamic Interfaces in the game menu.
I wonder if that makes a difference.

Specifically, I wonder if the transparent background of the looting interface might be responsible for triggering it then.
 
@Mere_Mortal: Did you already try to completely abort the repair functions you found yesterday?
Would be good to know if doing that indeed does solve the potential for CTDs or if it is not actually related after all.
Then at least we would know where to continue digging.
 
Not yet, I woke up today obsessed with the idea of controlling 1,937 ships at once.

I’m still not sure if adding InitBattleLandInterface() has done anything useful. I think things are more stable at the moment for whatever reason, but I expect it’s just a matter of luck because sometimes all is well then suddenly I can’t even open a chest. I’ll run through it again in a bit.
 
What is “FCoHS”? Are those files currently used in boarding?
FCoHS = Friendly Contact on High Seas; a mod that should allow you to call friendly ships, visit them and interact with their captain/crew.
Someone started on it, but it was never finished. It is disabled with a toggle at the bottom of PROGRAM\globals.c .
The files were left in because it was "half working" at the time, with the hope that one day somebody might care enough to finish it.
But at the moment everything in there is 100% unused and serves no purpose.
 
@Mere_Mortal: Did you already try to completely abort the repair functions you found yesterday?
Would be good to know if doing that indeed does solve the potential for CTDs or if it is not actually related after all.
Then at least we would know where to continue digging.
I nearly forgot about this. Yes, it does.

Rammed a big ship with undamaged sails, hoisted and got boarded. No crashes.
Reloaded, rammed it again and lost a mast, got boarded. Crashes on looting.
Then I placed the following code and repeated the process. No more crashes.

utils.c
Code:
void procActionRepair()
{
   if (bAbordageStarted) return;
I’m not making any promises, but it’s looking very good so far.
 
Last edited:
:facepalm

Okay, so I just did it again...

Got broadsided at point-blank by 24-pounders and lost all of my masts.
I looted a good few bodies but then it crashed a few seconds after one of them.

Friggin’... I don’t think that’s got it. I tried it about 3 or 4 times, it systematically did not crash when I had full masts and did when I lost one. Then I placed that code and tried 3 or 4 times again and it did not crash once through 4 decks every time. Now it’s crashing again. :unsure
 
Last edited:
Only thing I can suggest is putting in plenty Trace lines to see what happens.
For all we know, there could be multiple reasons for crashes and your change did fix one of them?
 
I don’t know enough about the repair logic to even begin to understand where to put a trace.
Maybe the safest thing to do is completely prevent any repairs taking place at all during boarding?
It might also be an idea to disable direct-sail as well since the ship doesn’t even know where it is.
And... is repairing and direct-sail linked? I see errors show up about the location, or lack thereof.
 
Back
Top