Summary: Minimize the gold clause when exchanging
                 Project: Freeciv
            Submitted by: silene
            Submitted on: Tue 31 Dec 2013 03:20:26 PM CET
                Category: ai
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



In ai/default/advdiplomacy.c:suggest_tech_exchange, the AI computes how much
the technologies of both players are worth. It then suggests the first two
technologies such that the difference of their worth, once converted to gold,
can be paid by the players. Notice I just said "first".

As a consequence, the AI sometimes suggests really dumb treaties. (No, I won't
pay 300 gold and one of my technologies, for some technology I can research in
just two turns! [1]) This patch alleviates the issue by not stopping at the
first two technologies. Instead, it suggests the technology exchange that
minimizes the gold clause.

That way, the subjectivity of how much a technology is worth as gold no longer
matters: the treaties seem much more sensible when the AI asks for tens of
gold only rather than hundreds.

And just so that there is no misunderstanding, I do not change the way
technologies are evaluated, just the way they are selected. For instance, if
only one treaty was possible before the patch, this is the treaty that will be
suggested after the patch.

[1] This may indicate a bug in the function used to evaluate how much the
technologies are worth. Still, I think the patch is relevant, even if this
hypothetical bug were to be fixed.


File Attachments:

Date: Tue 31 Dec 2013 03:20:26 PM CET  Name: tech_exchange.patch  Size: 2kB  
By: silene



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to