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

Regarding known midnight bug

Vallador

Landlubber
Avast ye! So, I've scoured about every page looking for more info about this issue and what I found was the very helpful workaround of simply staying the night at the inn rather than put out to sea close to midnight. That's all good and well; I can do that. I understand the issue is caused by loading the World Map while the game is processing your crew rations as they relate to days at sea and morale. (it simply CTDs, no message box) My question (and I apologize if it's been addressed, but I did look quite hard for it) is this: do we have a workaround or fix for this same issue when the player isn't near an inn?

Specifically, let's say I'm out to sea and all is well. I engage some scurvy knaves and take their booty, as I am wont to do. Sometimes when I return to the WM, I come up with the midnight bug and I have to try to time entering 3D Sailing close to midnight, use time compression until morale is calculated, go back to WM, sail a wee bit closer to the nearest island, and repeat until "land ho" when I can get to the port then the inn. It's peculiar because waiting until the calculation in 3D will only tide me over until the next one if I go back to WM, even though in my estimation the WM should have had just under 24 game hours to load itself.

I'm not a modder, and I know things aren't simple, but is there a reasonable way to disable the calculation that causes the crash? I've poured over the IS.h and BS.h and experimented tweaking the values to try and disable any crew ration/morale related items, but to no avail.

Sorry for the long post. Let me close by saying thank you all very much for this tremendous effort making the game better and for any and all help in advance.

Cheers, mates!

EDIT: I'm working with Build 13/3
 
I am sorry to say that I have no knowledge of this issue at all. As far as I know there is no fix. Perhaps Pirate_KK knows something... <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Here's the thread that put me on the scent for the root of the problem. Thanks anyway, Pieter!

<a href="http://www.piratesahoy.com/forum/index.php?showtopic=10762" target="_blank">http://www.piratesahoy.com/forum/index.php?showtopic=10762</a>
 
we need more new members like you. answering the same questions all the time is quite annoying.

maybe turning off the rations would work. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
I've personally never seen this issue in my game play either. And I've used Build 13 (all 3 versions) and I'm currently using Build 14 A6. And I've played some games for a very long time. Morgan Terror is the only other person I've seen identify this as the "midnight bug". Has anyone else experienced this?

kevin
 
Well, I was up to my eyepatch in code for the better part of yesterday afternoon and I'm slowly narrowing down what the problem is not. Thanks, Morgan, but no dice. I'm actually becoming less convinced that the crash is caused by daily calculations. Now again, I don't mod so you'll have to tell me if my logic is sound. I've tried disabling "FOOD_ON" in BS.h, changing all values under the Rum and Food sections in IS.h to 0, as well as eliminating all of the code in <i>PROGRAM\WorldMap\DailyCrewUpdate.c</i> that relates to rations and morale. In <i>PROGRAM\Calendar.c</i> I've gone so far as to eliminate the code calling for any daily calculations altogether. This appears to have the desired effect of removing the calc... but not the crash. I changed the setting in IS.h so prisoner ransoms would no longer increase daily and went further to enable stock ransom (disabling modded ransom).

I'm going to test a number of things and try to pin down the one thing that knackers it all up and the one thing that makes it better. My current theory is that when I capture another ship something goes screwy. But there's something that rectifies it in town other than selling it off (tavern stay, selling goods, something) because I keep two ships with me in a permanent capacity, and I can sail on ad infinitum with them AFTER I did whatever corrects it. Just out of curiosity, does anyone know what happens behind the scenes with a tavern stay? More than just the passage of time, what values are changed or reset specific to taverns and not the daily updates? Also, in case daily calcs is not a red herring, have I missed anything pertinent that is updated at midnight?

Anyway, thanks again, all. I'll let you know what I find out from my testing today. Yarr.

EDIT: BTW, I did a clean reinstall of stock, followed by B13 Full, then Update 3 Full, and didn't change any BS or IS settings and still had the problem. Didn't have time to try it in a new game, what with the nature of the first bit of the game but I might do that today. Doesn't quite matter imo if the new game doesn't have the problem because that stills leaves us without knowing what caused the problem and how to keep it from happening again.
 
Vallador,
Your trouble shooting may be simplified by turning on <a href="http://www.piratesahoy.com/forum/index.php?showtopic=9234" target="_blank">error logging</a>.

Have you done this yet?

After you get a crash, you can go to error.log (or compile.log or system.log) and see what was going on.

kevin
 
Ha! Good call, Kevin, should have known there'd be something like that I could use. <img src="style_emoticons/<#EMO_DIR#>/urgh.gif" style="vertical-align:middle" emoid=":urgh" border="0" alt="urgh.gif" />

In any case, I've pinned it down to tranferring crew from a captured ship!! Still need to do more testing to see exactly what it doesn't like and I'll certainly be using the error log to help. At this point, if no crew is taken, everything seems good to go. I'll get back to you if I find that it makes a difference whether it's taking crew for my ship, for another ship in my squadron, for a ship in my squadron that has officers besides the captain, etc. Also, I still need to isolate the condition for "reset," be it just stepping on land, going to shop/shipyard/tavern, or what.

More testing to do! Cheers and I'll post more when I have it. <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
it's got nothing to do with exchanging crew on to an officer's ship, only your own. i know this, because i never use a second ship, and i still get the bug sometimes. it would also explain why i get it so often, as i exchange crew quite a lot.
 
Thanks for trying to narrow this down! I don't really know anything about it, but all information you can get us should help! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
Thanks, your investigation is very helpfull! I tried to check that problem at the weekend, but only stopped on midnight calculations...

pirate_kk
 
Well, I've changed my mind yet again (captain's prerogative). I think crew swapping was a red herring but this time I think I'm on to something. Of course I've thought that every time. <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

Try this out for me, someone (ideally one who's had the bug and one who hasn't): if you have other ships, do a Ship-to-Ship and take on as much as you possibly can. Try to max out your hold, e.g. 1432/1432 on my 'Vette. If you're solo, just plunder without selling until yer hold be burstin' with swag. Head to the WM and let me know if our unpleasant surprise is waiting.

What tipped me off was trying to find out which events in town cured the bug. As it turns out, if you're bugged, the game will seize at midnight <i>anywhere</i> except 3D Sailing, including standing on the dock OR in your rack at the tavern sleeping. Selling at the Store stops the crash and so does <i>meeting with the shipwright</i>, even if you don't repair, sell, or buy cannons. When you open the menu to do said things, you'll get a log message saying something to the effect of "Too little room! Your purser has made an emergency sale of X from {ship name}!"

What I find hard to believe is that only three people have ever maxed out their holds and written about it here. Something to ponder. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

I don't have the time or patience to test this rigorously, but from my admittedly limited tests: maxing cargo space is the only thing that I've found thus far that has reliably produced the error, and it is consistently corrected by reducing your ship's cargo. This explains why it occurs after long battles; the longer the battle, likely the more booty you'll be making off with. This explains the confusion with the tavern. Most times you'll be selling or going to the shipyard (for the mysterious auto-sale) as well which fixes everything.

What I'm still working on is what it has to do with daily updates, if anything, and why 3D Sailing is immune.

Making progress to be sure, lads! Hopefully, I'm at least closer now than I have been with my theories. Cheers.

EDIT: In what program are .b files best viewed? The last one generated by one of the error logging options happens to be entitled <i>shiphold.b</i> and I'm dying to know what it says. Word processors produce jibberish.
 
<!--quoteo(post=214222:date=Sep 13 2007, 04:57 PM:name=Vallador)--><div class='quotetop'>QUOTE(Vallador @ Sep 13 2007, 04:57 PM) [snapback]214222[/snapback]</div><div class='quotemain'><!--quotec-->EDIT: In what program are .b files best viewed? The last one generated by one of the error logging options happens to be entitled <i>shiphold.b</i> and I'm dying to know what it says. Word processors produce jibberish.<!--QuoteEnd--></div><!--QuoteEEnd-->

I think those *.b files are generated by one of the settings in engine.ini. I think I fixed it by setting tracefilesoff=0 (or maybe it was codefiles=0?). These *.b files appear to be copies of the *.c files renamed with a different extension.

My engine.ini settings:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->tracefilesoff = 0

[script]
debuginfo = 1
codefiles = 0
runtimelog = 1<!--c2--></div><!--ec2-->

kevin
 
You only need to open C-files, H-files, INI-files or TXT-files. B-files are generated by the program itself as KevinAtlanta says and it's caused by one of the debug settings in engine.ini being on. I don't remember which. I think it was tracefilesoff as Kevin says. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Well, gents, I think I'm going to hang it up on this one. I'm not savvy enough with the code yet to do anything productive to actually fix the bug. Thanks for all the help; this is truly one of the best modding communities out there, especially because of the dedication and helpfulness of the modders. So as it stands right now:

<b>Midnight Bug Workaround:
Do not fill any ship's hold to maximum capacity. Transfer cargo or Discard it if necessary.</b>
 
<!--quoteo(post=214753:date=Sep 19 2007, 04:47 PM:name=Vallador)--><div class='quotetop'>QUOTE(Vallador @ Sep 19 2007, 04:47 PM) [snapback]214753[/snapback]</div><div class='quotemain'><!--quotec-->Midnight Bug Workaround:
Do not fill any ship's hold to maximum capacity. Transfer cargo or Discard it if necessary.<!--QuoteEnd--></div><!--QuoteEEnd-->

Thank you very much. <img src="style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" /> Believe me, you did a great job to find what really causes that bug. Since we know what causes that serious problem, I can check the code, trying to find things connecting 'full cargo hold' with 'midnight', then remove the bug.

pirate_kk
 
Back
Top