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

Solved Heap Corruption, Random Crashes

Do you have error logging enabled? The how to is in the FAQ.

I have sometimes gotten a CTD at the stores or just after, but it is a feature of beta 2, not this patch. Getting a ctd every time is most unusual.
 
Error logging appears to be enabled but no error file found. What is the file called and where is it saved? Here is a part of my engine.ini file incase something is wrong:
Code:
[script]
debuginfo = 1
codefiles = 1
runtimelog = 1
 
wow... modified my ini file a bit and now it seems to have made the compile and sys. dumb (see attachment).
 

Attachments

  • Dumb files.zip
    1.4 KB · Views: 338
0_0! I loaded my previous save and it loaded fine but the sea textures were gone! The was basicly white. so i sailed to port royal and accessed the store but it did not crash. SO i loaded my current save and the sea textures were gone aswell. I tried bot dll file but both result the same (the log too indicated that it could not find textures)
 
Sigh. It sounds like your install has gotten corrupted. Try a good defrag and reinstall. POTC for some reason tends to frag a hard drive.
 
Corrupt?! You mean that a single dll file corrupted the install? really weird because the textures were still loaded when the issue appeared. Will defrag it with gamebooster when i have time
 
I've been busy this past month decompiling parts of the engine and battle_interface. But I still haven't found a perfect fix. The code where it happens involves seven textures, and eight models (vertex buffers) corresponding to something like the compass in sailing mode. The exact script class eludes me, but the cause seems to be a race condition leading to deleting this script class twice. By putting a debugger breakpoint at battle_interface+E120 and stepping through the code, the crash/corruption seems to be avoided.

I finished modifying engine.exe so that the breakpoint script command causes an actual software interrupt. Some of the stuff in the language reference shows how to add watches to view the current script interpreter command.

It's gonna be a while until I can dedicate more time to this, so I'm uploading the OllyDbg ".udd" module disassembly comments, modified engine, and the unfinished script reference. In case anybody else wants to have a go at it.
 

Attachments

  • module_comments_odbg110.7z
    413.1 KB · Views: 336
  • ENGINE_breakpoint_mod.7z
    433 KB · Views: 377
  • PotC Script Language Reference 0.02.7z
    12.1 KB · Views: 327
You were gone for a while there. Welcome back! :cheers

(IF) I understand what you are saying methinks I ran into that ctd just this morning. Will certainly be testing your modded engine.exe.

Happy coding! :type1
 
I have yet to read this entire thread; apparently I missed out on something pretty important here due to lack of time before. :facepalm

Anyway, what's the final verdict here? Should any of this be included in the next modpack update? If so, which file(s)?
 
More players need to test these files. As far as I know I am the only one using them. :rumgone

I used to avoid sea battles because of CTDs. Boarding battles were the worst. Only by not looting corpses or chests would I have any chance of making it through a battle without a CTD, and even then it would usually crash after the battle was over anyway. :ko
Now I can kill and loot and have a bloody good time with no fear of CTDs. :ship

The files I am using are the BL_bypassFDC0 and the ENGINE_breakpoint_mod.
 
The patched modules still have side effects. I don't recommend including them, without warnings. There's three patches floating around, two for Intel graphics in the other thread, and bypass fdc0 at the top of this thread as an attachment.

It's going to be a couple more weeks before I can get back to working on it again every day.

I made some small progress this past month. I figured out how to decode compiled scripts. I used the first half of "seadogs.b" for a test, and the core reference section 2.2 has been added to. It's not meant for fixing bugs directly, but it reveals interesting things about how the interpreter works that will come in handy.
 

Attachments

  • compiled script vs original.7z
    12.8 KB · Views: 300
  • PotC Script Language Reference 0.03.7z
    12.9 KB · Views: 283
....which hurts game performance, but keeps the game running longer and with fewer graphical anomalies.
I just popped this file into my game, but it then took a REALLY long time to load. Exceptionally long. Does that sound quite normal?
 
You're sure you're only using the patched "battle_interface.dll" (from BI_bypassFDC0)? It sounds like you also used the engine breakpoint mod.

Switch back to the original engine.exe, and the game will return to normal speed. Because I was tracking down heap corruption, the engine breakpoint mod has full heap checking enabled. For me, heap checking was necessary to find problems. For anyone trying to play the game, it severely hurts performance without any benefit.
 
Nope, I only used the battle_interface.dll . When I swapped it back to the unmodified one, the performance was back to normal. Didn't touch the ENGINE.exe file.
 
Agh, that's bad news. Is a new game as slow as a saved game with it?

Are you also using ENB graphics? It might not be a good mix.

Another reason could be your video card has an amount of video memory under 64MB? If that's the case, then the patch probably shouldn't be used.

The workaround for heap corruption leaks video memory, instead of scrambling the game's memory. It trades a big lasting problem for a small temporary one. So, the higher the graphics usage the sooner the game might slow to a crawl and/or freeze. Every time the game is restarted, all the video memory is available again. But, the heap corruption eventually scrambles enough that the saved games become unreadable.

I normally run it at 1024x768 32bit, high texture quality and fullscreen on an MSI Wind U135DX netbook with 256MB video memory. I've only tested things with vanilla/unmodded PotC, though.
 
I never got as far as starting a new game. The splash screen remained for a long time and then I closed the game before I got into the main menu.
Indeed I am using ENB, so maybe that it is?

I doubt it is my video card though; I upgraded my Dell laptop with all the best stuff I could find.
I've got an ATI Mobility Radeon HD 5650 with a total memory of 4079 MB according to DXDIAG.
 
I have been using both and really have not noticed longer loading times. ATI 6950 with 2GB of ram.
 
Back
Top