Unciv
Unciv copied to clipboard
AIs can offer trades with Gold they don't have
Platform Android 11
Version 4.0.8
Describe the bug I declared war and started destroying AI units up & down. After 10 turns they offered me a trade of 612 golds for peace. But when I went to trade menu I saw something like this on AIs side: Gold 300+ Gold -612
Which means AIs can give copies of gold that they don't have. This is a major issue cause this means that AIs cannot calculate their golds properly. So, good trades from players are rejected.
might be caused by: https://github.com/yairm210/Unciv/blob/f613bba7d4fe2301a93efae83915f7355d7b587b/core/src/com/unciv/logic/trade/TradeEvaluation.kt#L44
Oh, yairm210 fixed this issue with a commit and shared it in Discord. I might have forgot about this issue.
@alexban011 sorry for forgetting to close the issue. Can you reproduce it? If not I will close this.
Oh not this maybe. The one yairm fixed was AIs offering 2 Open Borders as counteroffer trade maybe. So, this issue might still be remaining. In that case I think we need to look at Civ 5 mechanics. Does it happen on Civ 5 also? Or just unciv. Why was such a comment was left that It's fine even with negative gold? Is it arbitrary or Civ 5 mechanics?
I didn't try to reproduce. But I don't understand that part either. In what case would it be ok for those to be negative? Maybe for displaying it in the offer?
I personally feel betrayed when AIs can offer gold they don't have and I suffer from lack of gold. I don't see why it should be allowed unless it is a Civ V behaviour.
Maybe it’s something silly like the author couldn’t find any proper way about how AI would react when they have nothing to offer in trade and thought that negative gold is ok for the time being.
The closest thing I found about this in Civ 5 is that the AIs get -100 to -400 gold per turn, but people pointed out its a bug in the display code and they don't actually have that amount.
This has to be a bug and if it makes its way to the trade decision of AIs it probably is very bad.
At a quick glance I can't tell what could make it give negative numbers. Maybe its a display bug here as well? Probably not. Maybe it has been fixed in the meantime?
I'll try to look into it closer someday
I'm pretty sure this is fixed - do you see this still happening? If not I'll close this issue
I'm pretty sure this is fixed - do you see this still happening? If not I'll close this issue
Well, I don't think there was any fix PRs. The lines that @alexban011 mentioned still exist in the source.