The Diplomacy Bug

Ok this is another confirmation from my previous posts to show that the diplomacy bug is only caused through the Unofficial aspect of the Combined mod pack...

A completely new game with the cache cleared and only the build 23 unofficial patch loaded and absolutely nothing else in the mod folder...

Washington wanting to be friends...

http://files.upit.me/1298250565.jpg

...I agreed and then the screen went back to the game.

Then up came the Mongols a few turns later...

http://files.upit.me/1298248162.jpg

...this was after previous meeting the Mongols as an initial greeting.

many presses of the esc key brought up the completion of the Washington conversation...

http://files.upit.me/1298273075.jpg

pressing the back key simply resumed the game with NO conclusion or goodbye etc...

So there you go zero other mods and a cleared cache with a new game and build 23 with only the unofficial patch used.

This happened earlier in the same game but a blank screen of Napoleon came up...

http://files.upit.me/1298309179.jpg

The game continued and I met Rammy...

http://files.upit.me/1298315369.jpg

many esc presses and then Washington felt the need to butt in, even though I hadn't spoken to him since the last time I posted...

http://files.upit.me/1298323351.jpg
 
Gosh, no wonder I couldn't find it... that's a complicated series of steps! :lol:

Thank you for that confirmation, this means we've narrowed the problem down to about ten folders and ~130 files, just gotta track it further now. To help isolate the issue... does anyone remember when you first experienced the bug? January... December...? This might help rule out recent additions.

I've looked through some files and I think we can rule out:

  • Attila's Mods
    • Top bar
    • Action panel brings up tech tree if there's a tech to choose
    • Plot help tooltip
  • Copasetic's UI Tweaks
    • City banner additions
    • SHIFT key shows tiles being worked by a hovered city
  • Dan's Railyard
    • Only XML edits for a new building.
  • HoverInfo
    • Added very recently and only affects the unit flags.
  • Flag promotions
    • Only affects unit flags.
I'm less certain about these:

  • Sneak's great scientist fix?
  • Libraries like Alpaca's or Whys'?
  • Declarations of friendship give research.
    • Requires Philosophy, which is not yet researched in the demonstration at Writing. I wonder if the AI had Philosophy? I've been wondering if there's some hard-coded function call hidden to us that forces the AI to try and offer a research agreement without checking if it can actually do so.
 
[Testing in v4.23]
After looping in rename/edit files - load game - click next turn - see result - exit to main menu,
I found the function TradedResources(iResourceID), in \ Unofficial Patch \ Attila Mods \ UI \ InGame \ TopPanel.lua, line 26,
and function UpdateData() in TopPanel.lua, line 130 are related to the diplomacy bug.

If comment out the whole contents in TradedResources(), just return 0, 0, 0;
bug won't happen(but luxury counter on top panel stop working:lol:).

Looks like when AI offer deal, TradedResources() will be called,
and if UI:GetNumCurrentDeals() > 0, TradedResources() will read current deal records,
then bug happens.

But by comparing codes in TradedResources() with the codes which access deal records in DiploCurrentDeals.lua and TradeLogic.lua in vanilla game,
I think the operation on deal records did nothing wrong.

For TradedResources() will be called by UpdateData() on
Events.SerialEventGameDataDirty,
Events.SerialEventTurnTimerDirty
and Events.SerialEventCityInfoDirty.

Maybe access records on wrong time point triggers this bug,
I tried to make it can only update luxury counter during Player's turn.

Put a check on the part do update resources in UpdateData(), line 310 - 363
if( Players[Game.GetActivePlayer()]:IsTurnActive() ) then
Balabala...​
end

Diplomacy Bug haven't happened so far... Keep playing...
 
Game.GetActivePlayer() usually does the trick, because the diplomacy window can only ever come up for the human player

A more throrough piece would be:
Code:
local iPlayerID = Game.GetActivePlayer();
if iPlayerID:IsHuman() then
 blablabla
end
 
Do you work as or are you studying as a programmer kaomarket? Your bug reports are incredibly helpful! :D

The UpdateData function runs only for the active player. I think kaomarket's point is it runs during AI turns, which might somehow be resulting in the bug.

I've updated the beta with a check added to refresh resources only during the player's turn, let's see if this fixes it in the long term.
 
I'm playing 4.22, having a very good time with WWGD v5, and like the way the balance is working out all around.

Two bugs:

1. The tooltip for some of the buildings in the queue are incomplete, not stating what the buildings offer (water mill, stable, barracks, paper maker, temple - but granary's there!).

2. Odd diplomacy big: AI asks for OB. I try to change the deal to a one-way sale. The screen shifts to the AI (with whom I am of course at peace) offering me terms for a peace treaty (including my ally). When I click out and offer OB on my terms, the game proceeds smoothly.

I'm playing with:

Attila v13
Cap RR Boost v1
CivWillard v1
Copasetic v4
Free Research v3
Improved Notifications v6
Info Addict v10
TCB v4.22 (beta)
WWGD v5
 
Did you disable the file indicated in the Reporting Bugs thread?

If using the "What Would Gandhi Do" mod:
  • Action: Rename "InfoTooltipInclude.lua" from the WWGD folder to "_InfoTooltipInclude.lua"
  • Reason: I've included the important parts modified by the WWGD mod in the Unofficial Patch version. With the automatic tooltip system in the Unofficial Patch, I've begun a complete rewrite of the tooltip code. This is a work in progress I've completed for building tooltips, and will extend to units, promotions, etc. The auto-tips system solves all current and future tooltip typo errors, and will eventually allow automatic translation of most mods into all languages.
If you encounter other mods modifying this file, please post about it in the Beta Testing forum and I'll see what I can do.
Not really sure about #2.

These mods are already in the unofficial patch, including them twice might cause weird issues, especially since I updated and enhanced the first three:

  • Capital Railroad Boost
  • Attila Mods
  • Copasetic Research Tweaks
  • Seek's Free Research Balance
 
Did you disable the file indicated in the Reporting Bugs thread?

Not really sure about #2.

These mods are already in the unofficial patch:

  • Capital Railroad Boost
  • Attila Mods
  • Copasetic Research Tweaks
  • Sneak's Free Research Balance

No on #1, and will do. I just has a worker ask if he should build a vilage (!) atop a TP, which I assume has to do with #1 as well. I will also delete the above-mentioned separate mods.
 
Sorry to nitpick, but Sneaks and I are different people.:rolleyes:

To be fair, it really should be

alpaca's Free Research mod
alpaca's Custom Notifications

He did a lot of the heavy listing, then we tweaked his codes to our needs :P
 
That's true, though I try to put details like that in the readmes when possible. With some mods I can't put all the authors in the folder name because there's lots of them... flag promotions has 5 contributors! :lol:

One thing I could do is just leave the author names off entirely, if you think that'd be better.
 
For folders, just leave the names off. Tends to make life easier when moving around files, and every less character in file paths is one less chance for error.
 
Not really sure about #2.
[/LIST]

If I counter to an AI request for OB, I continue to get peace treaty offers. In addition, it sometimes rolls into another AI, who also offers me something. Naturally I ignore all this, hitting "back," and all's well. The game never freezes in these circumstances.

In what may be a WWGD bug (I'll mention it there as well), CS that have been at war with each other don't make peace after the AI and I do. By war, I mean actually fighting... as opposed to at war half a continent apart. The latter do make peace, as expected.
 
If I counter to an AI request for OB, I continue to get peace treaty offers. In addition, it sometimes rolls into another AI, who also offers me something. Naturally I ignore all this, hitting "back," and all's well. The game never freezes in these circumstances.

This sort of bizzare behavior from the game is what's so puzzling. I've tried bottom-up searches from the base code, seeking where the problem might be. I've also attempted top-down searches by trying to rationalize what might be causing this behavior and searching for what would interact with that behavior.

Either way I'm stumped, but hopefully just by process of elimination we can gradually narrow down the problem. :crazyeye:
 
I have played quite a number of turns on a large Pangea map with build 4.25 and Info Addict and CivWillard. Even though I have had plenty of Civ interaction through the diplomacy panel I have not as yet come across the diplomacy bug.

I will keep playing and keep you advised.

Just a small point - when you used to list the beta mod to download in the first post I could see that it was updated as I saw the version number. I did not know that it had changed from build 4.23 until I decided to chance a download from what is now the link. It is only when it is downloaded that I now get to see the version number.
 
Back
Top Bottom