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.

Solved Heap Corruption, Random Crashes

Discussion in 'Technical Help' started by amplificar, Aug 28, 2012.

  1. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    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.
     
  2. JackSwarrow

    JackSwarrow Sailor Apprentice

    Joined:
    Aug 11, 2011
    Messages:
    52
    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
    
     
  3. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
  4. JackSwarrow

    JackSwarrow Sailor Apprentice

    Joined:
    Aug 11, 2011
    Messages:
    52
    wow... modified my ini file a bit and now it seems to have made the compile and sys. dumb (see attachment).
     

    Attached Files:

  5. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    Can you try another save? That one looks kind of odd.
     
  6. JackSwarrow

    JackSwarrow Sailor Apprentice

    Joined:
    Aug 11, 2011
    Messages:
    52
    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)
     
  7. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    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.
     
  8. JackSwarrow

    JackSwarrow Sailor Apprentice

    Joined:
    Aug 11, 2011
    Messages:
    52
    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
     
  9. amplificar

    amplificar Opcode Assemblar Storm Modder

    Joined:
    Aug 20, 2012
    Messages:
    32
    Gender:
    Male
    Occupation:
    Technician
    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.
     

    Attached Files:

  10. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    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
     
  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
    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)?
     
  12. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    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.
     
  13. 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
    Got both of those files now. Other people, please test too! :whipa
     
  14. amplificar

    amplificar Opcode Assemblar Storm Modder

    Joined:
    Aug 20, 2012
    Messages:
    32
    Gender:
    Male
    Occupation:
    Technician
    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.
     

    Attached Files:

  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 just popped this file into my game, but it then took a REALLY long time to load. Exceptionally long. Does that sound quite normal?
     
  16. amplificar

    amplificar Opcode Assemblar Storm Modder

    Joined:
    Aug 20, 2012
    Messages:
    32
    Gender:
    Male
    Occupation:
    Technician
    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.
     
  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
    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.
     
  18. amplificar

    amplificar Opcode Assemblar Storm Modder

    Joined:
    Aug 20, 2012
    Messages:
    32
    Gender:
    Male
    Occupation:
    Technician
    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.
     
  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
    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.
     
  20. Hylie Pistof

    Hylie Pistof Curmudgeon Staff Member QA Tester Storm Modder

    Joined:
    Jan 15, 2010
    Messages:
    13,768
    Gender:
    Male
    I have been using both and really have not noticed longer loading times. ATI 6950 with 2GB of ram.
     

Share This Page