Possible fix for CTD when returning to Main Menu in BAT

Lemon Merchant

Not Quite Sonic
Retired Moderator
Joined
Jun 27, 2008
Messages
8,773
Location
Red Sector A
I have been doing some research recently, and I've come upon a possible fix for the un-reproducible crash to desktop experienced by some BAT users, when returning to the Main Menu in-game.

For those of you afflicted with this problem, please ensure that these two DLL files are present in your BTS folder in a Vista or Win 7 installation:

msvcr71.dll
msvcp71.dll

These files should be present, but are not always installed under Win 7, or Vista. They are available for download on various websites. Please choose a safe, and reputable site from which to download, and please scan the files for viruses before use. Safety first. :)

Also, please make sure that you have the latest version of DirectX 9 installed to further reduce issues. It can be downloaded directly from Microsoft's download area.

The BUG team still cannot reproduce the CTD on our machines, but others have mentioned that the lack of the two DLL files above seems to exacerbate the condition, and make crashes more frequent. As always, YMMV.

Please post if it does, or does not solve your issue.

Thank you,
-LM
 
So looking for art to use I downloaded and installed the new version of VD. It CTDs to me on going to the menu. Running a debug dll throws a few dozen asserts. First and easiest to fix is that the new global types are not defined; I think this is causing the crash. Also not all the modules are being loaded correctly (not sure how to fix that though). So my advice is to update to the new version of VD, use a debug dll, and fix all the missing symbols in GlobalTypes.xml

Start simple and obvious. Have Emperor Fool compile you a debug dll if you don't know how to do that.

In the long run I think it would also be worth it to demodularlise everything, modules just ask for problems in my opinion and can't be properly checked by civchecker. This is probably too much work though. I seriously think fixing the missing symbols in GlobalTypes.xml will solve this problem though. It's also strange you guys have been getting reports of this for so long, yet no one bothered to run a debug dll on it :rolleyes:
 
Thanks Phungus. I'll give that a try.

EDIT:

I spent the morning and most of the afternoon testing this. I even "bothered" to build a debug DLL.

1. I cannot see any errors using the debug DLL. Unless I missed something in the compile...

2. I cannot get BAT to exhibit the CTD on Main Menu using the debug DLL, or the standard BTS or BULL DLLs. I have been trying to make this happen for weeks using both VD 8 and VD 9 builds of BAT. I have tried it on my main machine, my laptop, and two of Andrea's non-work machines. These computers all have different architecture and OSes.

3. Since repairing VD 8, I have not been able to make BAT crash using those files.

4. I cannot get VD 9 to crash. I have played a total of 5 games with VD 9, to test its' stability, both with and without the BULL DLL. To date, I have had no issues whatsoever.

Since I am female, and therefore by default, incredibly stupid, I have discussed this with EF, and he has not been able to make BAT crash in this way. Also, by a rough guess on the downloads, and reported problems, the number of people using BAT outweighs the number of users reporting this issue, leading me to believe that this does not happen to everyone. The only conclusion that I can draw is that it is a machine configuration problem, and not the fault of sloppy coding, incompetence, rushing a release, or just plain apathy when it comes to testing. Other users on Windows forums are reporting issues when the two DLL files I mentioned in my OP are not present, and they are not installed during the normal Windows 7 setup process.

If I sound like I'm getting a little ticked off at the continuous veiled criticism and implication that we're being careless and sloppy, and can't be bothered to test our mod before release, it's because I am.
 
I didn't read this till now, since I did not know you added some more comments due to them being appended in an edit.
If I sound like I'm getting a little ticked off at the continuous veiled criticism and implication that we're being careless and sloppy, and can't be bothered to test our mod before release, it's because I am.
Until I read this paragraph I had no idea you were ticked off, as the rest of the post is pretty direct and too the point, with little or no emotional inflection in the writing. Other posts of yours come across quite vividly though, but I think you may need to work on expressing brooding or animosity for your writer's voice. Of course flatly stating it works, but I don't think that's what you were trying to do at the time. Then again a strong voice in writing isn't really a needed skill, so it's not really important, I suppose.

I spent the morning and most of the afternoon testing this. I even "bothered" to build a debug DLL.

1. I cannot see any errors using the debug DLL. Unless I missed something in the compile...

2. I cannot get BAT to exhibit the CTD on Main Menu using the debug DLL, or the standard BTS or BULL DLLs. I have been trying to make this happen for weeks using both VD 8 and VD 9 builds of BAT. I have tried it on my main machine, my laptop, and two of Andrea's non-work machines. These computers all have different architecture and OSes.

3. Since repairing VD 8, I have not been able to make BAT crash using those files.

4. I cannot get VD 9 to crash. I have played a total of 5 games with VD 9, to test its' stability, both with and without the BULL DLL. To date, I have had no issues whatsoever.

Not much you can do about user specific issues then. I've tried to get some people to give me logs when they report bugs in the LoR bug reports thread that I am unable to reproduce. No one has bothered to follow up, but there have been 3 reports of a certain behavior that leads me to believe there is some conflict caused by some user's video cards (or possibly not updating the drivers on those video cards) and a model somewhere in the mod. What I can tell you is VD (and by extension BAT) crashes on me using a normal BtS dll, or the dll in BAT, but it does not crash when using a debug dll, abut the debug dll throws all sorts of asserts while initializing the XML. Specifically it has problems with the artstyles. Based on your experience I think it's a good bet some systems just don't like the modular loading of BtS that VD uses. My computer is very old though, so I don't think it's important to get things to work for my system (plus I can get it to work by just using a debug dll).

I'm still confused as to how using a debug dll when starting up VD will complain on my system, and wol't on others. It just seems so strange, and I haven't come across similar issues before, and I read and browse the civ4 forums alot. Normally I'd chalk this up to "user error", but I have double checked since reading this, and my custom assets are empty, and the BtS/Warlords/Vanilla assets are unmodified. I just don't know. On a side note how did you fix the 8.0 VD art bugs without a debug dll or civchecker? Before I knew about a debug dll or civchecker I used to have to just blindly search for the causes of crashes, and it took forever and was tedious.
 
@Phungus:

I've explained my reasons in PM, but I want to post this publicly for all to read.

I was not specifically angry with you. I was angry with a number of people, and unfortunately, I chose to vent my anger at you in this thread. It was unfair, unwarranted, and inconsiderate on my part to single you out as the object of my derision. I was out of line, and I was wrong, and I sincerely apologize for my comments and behavior.

-LM
 
Lemon I believe if you got the balls to throw a punch a punch, you better have the intestinal fortitude to take a punch. How many times have you seen me pull a punch?

I do not think your apology is warranted, though since you want to make it, I of course accept it, but just be aware I don't believe you have any reason to apologize in the fn' first place.
 
Thought I'd chip in here as someone else who has worked on repairing VD 8.0 and BAT, though in this case for Mac.

I mean no offense to avain but the xml for VD is very disorganized and extremely frustrating to debug. I had to do so without any sort of debug DLL as they do not work on the Mac. However, Lemon Merchant, avain and Geomodder have done outstanding jobs with the latest versions of BAT and its components and so much of the criticism they've been getting is based on hearsay about previous versions. Very unfair.

I would also say that the crash on exit is very likely to be a user specific problem, probably related to Windows as Lemon Merchant suggests. This is because the entire time I maintained BAT for Mac I never got a single report of such a crash - and Lemon Merchant has done a much more thorough repair job than I ever did.
 
This CTD when exit to main menu happens to me as well, but I have WinXP. I have the latest BtS patch, and just installed the latest BAT 2.3. I checked and verified that the two files you mentioned are present in my installed directory. Is there any other possible reason for WinXP (since your solution mentioned only Vista/7)?
 
This CTD when exit to main menu happens to me as well, but I have WinXP. I have the latest BtS patch, and just installed the latest BAT 2.3. I checked and verified that the two files you mentioned are present in my installed directory. Is there any other possible reason for WinXP (since your solution mentioned only Vista/7)?
I'm going to assume that the reason it happens in XP, is the "other" reason that it happens in Vista/7.

The fact is that it doesn't happen on a repeatable basis on everyone's machine. It happens on none of the ones in my house, and EF can't make it happen either. :(

Every time I play, I frequently exit to the MM to reload to try to make it happen, and it won't. I believe it's either a DX9 issue, or a driver problem, but we just don't have enough data, atm.

If I do find a cure for the problem that really works, I'll be the first to post it, because frankly, it really annoys me that I can't fix it. Lemon Labs is on the job, and I ask for your patience whilst I figure this out. :)
 
Hi Lemon,

Just FYI, I've made sure I have the latest DirectX 9.0c that is available for my gfx card, as well as updated my gfx driver to the latest available. That didn't help though, it still crashed when I tried to go back to main menu. It's not a big deal when I am already in the middle of the game because I usually do not need to go back to main menu. It's only when I have to start the game all over when looking for a good starting map/position.

I am not sure if it makes any difference, but here's my PC's spec:

WinXP Pro with DirectX 9.0c
3 GB RAM
ATI Radeon HD4800 (latest driver)
Civ4 BTS patch 3.19 with BAT 2.3 (as mod)

While I am at this, I would like to say thank you to you and your team for making this mod. It's awesome and definitely enhanced my gameplay while it does not change the game's mechanism (when I don't want to play any mods). Kudos to you all and keep up the good work!
 
This bug isn't just limited to BAT, some AND users report it, as well as occasional RoM users, and I think I heard a complaint or two from the FFH forums as well...

I suspect that what is happening is that the game hasn't de-initialized the active game while it's trying to load the new game, so it has 2 games in memory, which exceeds the 3gb limit and it crashes. I doubt there will ever be a solution for it. (short of getting the executable code) I just rest easy knowing Civ5 will never have this problem. ;)
 
This bug isn't just limited to BAT, some AND users report it, as well as occasional RoM users, and I think I heard a complaint or two from the FFH forums as well...

I suspect that what is happening is that the game hasn't de-initialized the active game while it's trying to load the new game, so it has 2 games in memory, which exceeds the 3gb limit and it crashes. I doubt there will ever be a solution for it. (short of getting the executable code) I just rest easy knowing Civ5 will never have this problem. ;)
I didn't know this. This is sort of wonderful, albeit in a warped and tragic way. I've been going bonkers trying to figure out why this only happens for some people, and not me. If it's a memory issue, all of my (our) systems have 4 GB in them, and most use 64 bit Windows, so there is virtually no possibility of running out of RAM. Thanks for posting that information Afforess! :)

In a really bizarre twist, I can crash vanilla BTS by going to the MM on the old Vista 32 bit laptop (now Win 7), but never BAT...

Maybe Stephen Hawking could explain this... :mischief:
 
If it's a memory issue, all of my (our) systems have 4 GB in them, and most use 64 bit Windows, so there is virtually no possibility of running out of RAM.

Not true. 64-bit allows Civ to use all 32 bits (~3.25GB) of ram, instead of the 2gb that 32 bit has, but because Civ 4 was written in 32bit code, you can have 16gb (one user of AND did, and still had this problem) but Civ stops using ram at 3.25gb.
 
Not true. 64-bit allows Civ to use all 32 bits (~3.25GB) of ram, instead of the 2gb that 32 bit has, but because Civ 4 was written in 32bit code, you can have 16gb (one user of AND did, and still had this problem) but Civ stops using ram at 3.25gb.
Hmmm. I know about the 3.25 GB cap, but I never expected that I would ever reach it with BAT. My memory usage display normally pegs out at about 3 GB when playing a huge map in the late game. I haven't played RoM in about a year, and that is one of the largest mods around... Maybe I should do a memory use comparison one of these days.

It will be interesting to see how much memory the complete release of BAT 3 will use. If the use becomes excessive, I may have to release a separate "Lite" version, like Phungus did with LoR.
 
Thanks Avain. I've already folded VD 9.1 into the new BAT, and I'm testing it out now. :)
 
I was installing BTS on my new laptop recently, and had crash to desktop when exiting to main menu and sometimes randomly. I made some changes and after that no more ctd.

Bad installation:
1. Install Civ IV
2. Install BTS
3. Install patch 3.19
4. Install BAT Mod 2.3 by exe installer
5. Numerous CTD

Uninstallation:
1. Uninstall BTS using Perfect Uninstaller
2. Uninstall Civ IV using Perfect Uninstaller
3. Delete Civ IV folder manually

Good Installation:
1. Update graphic card drivers (old ones was from April-May)
2. Install Civ IV and patch 1.74
3. Install Warlords and patch 2.13
4. Install BTS and patch 3.19
5. Install BAT Mod 2.3 by exe installer

BTS still don't recognize my Geforce 330M, so first start is at low resolution and details, but i change it in options and everything working great, no more CTD. Anti-aliasing doesn't work, even with nHancer, but it's hardly a problem.

Many turns without CTD, Rutpak.

P.S. System is windows 7 32-bit, 3GB of RAM, processor i3-330m.
 
Thank you for the details on your solution, Rutpak. I'm not sure why BTS can't see your graphics card, since it's a brand new one. Have you downloaded the latest DirectX 9 from Microsoft? Even though your card probably supports DX 11, and Windows 7 uses DX 11, BTS actually needs the newest DX 9 to work properly with Windows 7.

Good luck, and thank you again. :)
 
Good Installation:
1. Update graphic card drivers (old ones was from April-May)
2. Install Civ IV and patch 1.74
3. Install Warlords and patch 2.13
4. Install BTS and patch 3.19
5. Install BAT Mod 2.3 by exe installer

And what would one with the CivIV Complete package do, seeing that the installer only allows you to install all expansions in one go?
 
Top Bottom