Better BAT AI

Hey, I'm sorry if this was answered here or somewhere else, but I've been having a problem with the mod. The interface fails to load when I start games. There is some text at the top that says: "BugInit - Cannot find XML file for mod init". I tried uninstalling and reinstalling it and the same thing happens. Please help!

EDIT: Looks like it was some weird redundant overlap of old files, sorry to bother you
 
Last edited:
Running into a problem using it with the GOG Galaxy installer. I used the zip version and installed into the Mods folder in "My Documents". Everything seems to launch fine, but when I first begin a game I receive the error

Directory from CvAltRoot.py is not valid or does not contain CivilizationIV.ini

It looks like the mod is still running and the game can play, but naturally the error worries me.

I have found two CvAltRoot.py files in the mod, located in these two directories:

D:\tjare\Documents\My Games\Beyond the Sword\MODS\Better BAT AI\Info
D:\tjare\Documents\My Games\Beyond the Sword\MODS\Better BAT AI\Assets\Python

Inside both files I have tried modifying the directory line so that it finds CivilizationIV.ini

rootDir = "D:/tjare/Documents/My Games/Beyond the Sword"

That directory most definitely does contain CivilizationIV.ini, so I'm wondering what's wrong.
 
IIRC, I think that particular file needs to be moved to the programs dir of Civ, and then once moved over, the MyGames file needs to be deleted. Hopefully, Lemon or another can verify what I posted, but I'm fairly certain that's how I got mine to run. Although, as a point of declaration, I have the complete version from disc, not the GOG version.
 
Oh good. No worries :D
 
I downloaded the source code and found that it contains CvGameCoreDLL.sdf. This file is autogenerated and useless for people to download as the compiler will overwrite it anyway. The problem is the size. It's a 53.9 MB file and all the other files use 12.3 MB combined. While the internet speed is quite decent these days, it's still wasteful. The question is if it matters enough to bother re-releasing the source. It's more like a reminder for the next release.
 
I downloaded the source code and found that it contains CvGameCoreDLL.sdf. This file is autogenerated and useless for people to download as the compiler will overwrite it anyway. The problem is the size. It's a 53.9 MB file and all the other files use 12.3 MB combined. While the internet speed is quite decent these days, it's still wasteful. The question is if it matters enough to bother re-releasing the source. It's more like a reminder for the next release.
Oh, thank you. I've been planning a new release soon. I'll be sure to leave this out this time. Thanks for the head's up. :)
 
I have recently just started playing civ4 again after a substantial hiatus. I came across the better bat ai mod from quill18, and installed it. It worked right out of the gate on all three of my computers. However, when I run the game a second time (load a saved game or start a new one) after I have quit, I get a bunch of .ini errors. The game still plays, but the screen is taken up with the text that says various .ini failed to load. I am going to try to upload a file of the error.

My current way around this is to uninstall the mod and then reinstall it every time. Another weird thing is that on the install, I have to click "run better Bat AI now" checkbox, otherwise I get the same errors when I start it up.
 

Attachments

  • 99A64EB3-4B3D-47CE-A565-38048E8F76EF.jpeg
    99A64EB3-4B3D-47CE-A565-38048E8F76EF.jpeg
    2.5 MB · Views: 268
Try installing into your "My Documents\My Games\Beyond the Sword\Mods" folder instead of installing it in the game's direct mods folder where you have it now. You might be running into a permissions issue.

Where did you download the mod from?
 
I downloaded it from the link in this thread. I’ll try installing it in he my documents folder.
The weird thing is that I did this on all three computers I have and I get this issue on only two of them. One works perfectly fine.
 
Sounds like a permissions issue to me.
 
I just started using this mod, great work Lemon you really outdid yourself!! The AI is so much better than before! Thank you!
 
You're welcome. I'm glad you're enjoying it. :)
 
Lemon, first of all, thank you (and the other contributors) so much for all the great work on this modpack. It really is packed with a lot of great stuff and really improves the game so thank you!

Secondly, I really would like some help getting the AI Autoplay function working (which I believe was a part of Better BTS (by jdogg5000) which was merged into this collection).
When I run Better BTS MOD, the AI Autoplay keystrokes of (CTRL-SHIFT-X) and (CTRL-SHIFT-M) work great but when I run Better BAT AI they have no effect at all and so I am not able to Autoplay while in Better BAT AI.

Can you ( or anyone else) please let me know what I am doing wrong? Is there something I need to do to enable AI AutoPlay functionality in Better BAT AI? Or if I am wrong about Autoplay being a part of Better BAT AI, then can someone point me to some guidance on how I might go about merging that functionality?

Basically, I am just trying to run AutoPlay with Better BAT AI
Any help provided will be much appreciated. Thanks in advance!
 
I must confess that I have always been baffled by AI Autoplay. I have no idea how it is supposed to work. I'll take a look at the keystroke thing, but it may take a little while. I'm starting a new job in the morning and I will be pretty tied up for about a week. Maybe someone else more familiar with the problem can answer in the meantime.
 
I must confess that I have always been baffled by AI Autoplay. I have no idea how it is supposed to work. I'll take a look at the keystroke thing, but it may take a little while. I'm starting a new job in the morning and I will be pretty tied up for about a week. Maybe someone else more familiar with the problem can answer in the meantime.

Lemon, Wow thank you for the lightning fast reply! I appreciate you taking a look at it when you get a chance and I look forward to your reply.

And Congratulations and good luck on your new job! Cheers!
 
I've taken a look. The AI Auto Play module is not registered with the BUG event manager. BBAI does this in a file named CvCustomEventManager.py – looks like that file hasn't been merged into Better BAT AI. To remedy this, it should suffice to
import AIAutoPlay
in Assets\Python\BUG\BugEventManager.py and to add the line
AIAutoPlay.AIAutoPlay(g_eventManager)
to the configure function in the same file. May want to put a
if getChtLvl():
check in front to make AI Auto Play unavailable when playing without cheats.
The ChangePlayer component (Ctrl+Shift+P, Ctrl+Shift+L) has the same problem and can be fixed in the same way:
import ChangePlayer
plus
ChangePlayer.ChangePlayer(g_eventManager)
This is all based on how K-Mod integrates the BBAI modules – and I've done a quick test in Better BAT AI.
 
I've taken a look. The AI Auto Play module is not registered with the BUG event manager. BBAI does this in a file named CvCustomEventManager.py – looks like that file hasn't been merged into Better BAT AI. To remedy this, it should suffice to
import AIAutoPlay
in Assets\Python\BUG\BugEventManager.py and to add the line
AIAutoPlay.AIAutoPlay(g_eventManager)
to the configure function in the same file. May want to put a
if getChtLvl():
check in front to make AI Auto Play unavailable when playing without cheats.
The ChangePlayer component (Ctrl+Shift+P, Ctrl+Shift+L) has the same problem and can be fixed in the same way:
import ChangePlayer
plus
ChangePlayer.ChangePlayer(g_eventManager)
This is all based on how K-Mod integrates the BBAI modules – and I've done a quick test in Better BAT AI.


f1rpo,
This is fantastic! your solution worked perfectly and took me less than 5 mins to implement.

Thank you so much for taking the time to look into this and for providing very clear instructions on how to implement a solution. Really appreciate the assistance (and learning opportunity)! Cheers!
 
I'm getting some errors in the logging can anyone help?
 

Attachments

  • xml.rar
    18.9 KB · Views: 50
  • PythonDbg.rar
    271 KB · Views: 47
  • LSystem.rar
    1.8 KB · Views: 48
  • audio.rar
    2.1 KB · Views: 53
Top Bottom