Mod/tweak to prevent AI's from contacting you and interrupting?

damnyankees

Warlord
Joined
Jul 31, 2006
Messages
281
This is probably the single thing which most prevents me from playing on bigger maps; turns take long anyways, the last thing I need is for 10 AI's to interrupt the turn with stupid requests/declarations. And if I'm not sitting in front of my computer, the turn will just be delayed until I notice the communication and click "no".

Has anyone come up with a fix for this? 99% of communications started by AIs are either totally pointless (requests for stuff) or can just be notifications which pop up on the side (denouncing, declarations of war). There is no need for any of this stuff to result in a popup screen which stops the game from running. This seems like a pretty simple thing to fix, but I can't find anyone who has done it.

All I want is to be able to play knowing that if my next important decisions is 10 turns from now, I can walk away from the computer, knowing it is running those 10 turns without interruption. If I need to talk to an AI, I'll instigate it myself.
 
This seems like a pretty simple thing to fix,

Unfortunately all of those AI initiated popups are buried deep in the C++ code that forms the game core DLL. While it would be possible to remove the ones you personally don't want and recompile the DLL and build a mod that uses it, trying to understand the spaghetti code and come up with a generic solution that can be tailored by players as they want is a serious amount of code and effort
 
You could try to change the singleplayer diplomacy to multiplayer diplomacy.
I tried once but failed because I seriously don't have enough knowledge of Lua.
 
Unfortunately all of those AI initiated popups are buried deep in the C++ code that forms the game core DLL. While it would be possible to remove the ones you personally don't want and recompile the DLL and build a mod that uses it, trying to understand the spaghetti code and come up with a generic solution that can be tailored by players as they want is a serious amount of code and effort

Someone just pointed me to the Quiet Diplomacy mod which apparently does this. Are you familiar with it?

https://steamcommunity.com/sharedfiles/filedetails/?id=309175632

Seems like I wouldn't be able to run both this, and your DLL mod, at the same time though, right?
 
If you're still looking to do it yourself, the codeblock you would be interested in is

Code:
bool CvDiplomacyAI::IsValidUIDiplomacyTarget(PlayerTypes eTargetPlayer)
Setting this to always return false should make your life a lot easier.

Code:
void CvDiplomacyAI::DoContactPlayer(PlayerTypes ePlayer)
Is the function that calls the IsValidUIDiplomacyTarget for most of the cases where the AI wants to contact you (however, war declaration is handled separately from the other cases).
 
If you're still looking to do it yourself, the codeblock you would be interested in is

Code:
bool CvDiplomacyAI::IsValidUIDiplomacyTarget(PlayerTypes eTargetPlayer)
Setting this to always return false should make your life a lot easier.

Code:
void CvDiplomacyAI::DoContactPlayer(PlayerTypes ePlayer)
Is the function that calls the IsValidUIDiplomacyTarget for most of the cases where the AI wants to contact you (however, war declaration is handled separately from the other cases).

Is this simple to do for non-modders? I've never modded anything, but I'd be willing to do this on my own game if I had any idea how to do it.
 
Seems like I wouldn't be able to run both this, and your DLL mod, at the same time though, right?
Yup, the Highlander Rule* (still) applies to DLL mods.


Spoiler * :
At any one time (*que Sean Connery voice-over*) There Can Be Only ONE !! (*end que Sean Connery voice-over*)
 
Is this simple to do for non-modders? I've never modded anything, but I'd be willing to do this on my own game if I had any idea how to do it.

If you know how to compile the DLL properly, then this by itself is fairly easy to do (just make sure the function return false no matter the case).
 
Top Bottom