Computer Trading Cities and Corps for not much

kijedi

Chieftain
Joined
Sep 21, 2010
Messages
22
Not sure why this is happening - sometimes it trades resources for nothing literally and I have traded the AI 5 cities (theirs) for 1 tech of mine -Same with Corporations is this something that is a known issue?
 
Not sure why this is happening - sometimes it trades resources for nothing literally and I have traded the AI 5 cities (theirs) for 1 tech of mine -Same with Corporations is this something that is a known issue?

If you have examples where the AI is clearly offering a bad trade post the save game with instructions on what to offer to which AI to reproduce the issue, and I'll look into it.
 
Techs are valuable. The AI might once in a while decide that it is so valuable, that it is worth 5 cities.
Or maybe those cities had already a high rev index, or where under heavy influence fro your culture?

The AI did actually get better at tech trading already. I remember times when it gave away a tech for gold, around 5 times my per turn income. Now it wants other techs for it, with generous amounts of gold being the pocket change in bigger tech deals.
 
Here is a file I saved to show you guys...

Speak with the Manchurian and ask what he wants for all (6) of his tradable cities at once - He will reply Superconductors only - This is absolutely not a fair trade - Like I stated I was also trading corporations for next to nothing as well - at this point in the game I have more than 10 corps already - and many times they offer resources and they want nothing back - not even a resource - (sometimes...)
 

Attachments

Here is a file I saved to show you guys...

Speak with the Manchurian and ask what he wants for all (6) of his tradable cities at once - He will reply Superconductors only - This is absolutely not a fair trade - Like I stated I was also trading corporations for next to nothing as well - at this point in the game I have more than 10 corps already - and many times they offer resources and they want nothing back - not even a resource - (sometimes...)

If a resource enables nothing (or appear not to given the AI's tech level) it considers it to be valueless and will trade it for nothing. Thus if a resource enables no units and no buildings, and doesn't appear to itself give a direct benefit it will be considered valueless. I suspect the AI is missing some cases of 'direct benefit', but given a specific case it's easy enough to look into via an illustrative save.

I'll look at this one later today in regard to the cities, but I **do** have a theory. That theory is to do with how late in the game you are (all the AI tuning has basically been done only up to about the Industrial era). I suspect that ciy values are increasing only slowly through eras (like broadly proportional to population or something), but tech values are increasing exponentially. The result is that tech values will eventually dominate city values and any modern tech will buy any city. Obviously if I'm right then this is a a major issue! Hopefully it'll be obvious when I come to look at your example later today...

Edit - found a couple of problems, a fix for which will be pushed to SVN later today:

1) The code assessing a tech's trade value tried to determine if it is a valuable tech relative to the 'average' tech, but was using a constant for the average value that didn't scale with the value of currently researchable techs. The effect is to tend to inflate tech values more the deeper you go into the tech tree

2) The value placed on cities for trade purposes was essentially just a multiple of population + infrastructure costs (sum of build cost of all buildings) + some added value for culture level, religions present, etc. This doesn't really capture he way cities scale in value as they get more productive, in terms of what they contribute to the civ each turn (gold, research, production, ...). I will add in a multiple of their total commerce output + total yield output per turn, which should scale properly.
 
Cool - It also does this with Corporations (which is how I have soooo many) and I was trading the AI many of its units(like heavy tanks and battleships) for dirt cheep as well (including 1 tech for 15 units for example)- sometimes.

Is there an easy way to implement the fix once you program it?
 
Cool - It also does this with Corporations (which is how I have soooo many) and I was trading the AI many of its units(like heavy tanks and battleships) for dirt cheep as well (including 1 tech for 15 units for example)- sometimes.

Is there an easy way to implement the fix once you program it?

The fix will be there when you upgrade - it's in the DLL code, so it'll automatically upgrade with the DLL.

Can you give me specific example in regard to the corporations? (ideally a save to work with). So far I have specifically addressed the way it values techs and cities only (actually I'm still trying to get an acceptable implementation - my first try gave decent results, but the performance costs were too high)
 
Is there an easy way to implement the fix once you program it?

You need to use the SVN (http://forums.civfanatics.com/showthread.php?t=429816)
Once set up, you can just hit the "update" button and it will update your C2C file. These are the most actual versions of the game (Don't confuse them with the releases. A release comes out every 1-2 months, but the SVN might update several times a day.)
 
Can you give me specific example in regard to the corporations?

Yes - actually use the same filesave I uploaded - go to Kublai Kahn and see what he wants for his two Corps - he will give both of them for only 1 tech. This is after I upgraded to the new DLLs and updated in game after it asked.
 
Can you give me specific example in regard to the corporations?

Yes - actually use the same filesave I uploaded - go to Kublai Kahn and see what he wants for his two Corps - he will give both of them for only 1 tech. This is after I upgraded to the new DLLs and updated in game after it asked.

Ok, I didn't touch the evaluation of corporations yesterday, so the fact it hasn't changed is no very surprising (I did touch techs, but the biggest change as to cities).

I'm not very familiar with corp trading (as a mechanic). What does it actually do? Automatically transfer the headquarters to your capital or something?
 
Ok, I didn't touch the evaluation of corporations yesterday, so the fact it hasn't changed is no very surprising (I did touch techs, but the biggest change as to cities).

I'm not very familiar with corp trading (as a mechanic). What does it actually do? Automatically transfer the headquarters to your capital or something?


I also have to initiate the trades but it gives waaaay too much for little. As I stated above go to Kublai Kahn and see what he wants for his two Corps - he will give both of them for only 1 tech. This is the simplist way to see the trade happen. Thanks by the way - this Mod is SICK
 
I will shortly be pushing some changes that at least start to address this. The gist of the changes is as follows:

  • The code was just evaluating what the thing being received was worth to the receiver, and NOT taking any account of what its loss cost the sender. For most trades this is ok (you don't LOSE a tech when you trade it, or your map, and so on), but for some (corporations, cities, and to a much lesser extent resources [the AI never trades its last away]) it's a BIG deal.
  • Corporation evaluation was just broken - it took no account of what the corporation actually gave when evaluating its trade value (assumed it was just a constant times num relevant resources times city count). Also took no account of competing coprporations in adjusting the effective value. The new code counts the full output value of the corp in all cities that have, and half ion those that do not (since you can spread it to them). It adjusts the value for competitors as follows: <value> := <value>*3/(numCompetitors+3)
  • Corporation evaluation under-valued production and food by a factor of several.

The first of these is an important generic issue (not corporation-specific), so the fix will also impact city trades (tend to make them more expensive), and to a much lesser extent resource trades

With the fixes you'll find in your save game that:
  • Manchuria wants both your techs for one city, and will not recognize any valid trade for more than 1
  • Kubla Khan will still trade one of his corporations for your tech, but not the other. Looking at the numbers this actually seems fine to me (it's a vetry low value corp for you as you already have 5 competitors!) an its production per turn across his entire civ is only about 270 gold. For a tech with a cost of > 50K this seems like an ok trade

It may need further tweaking, and if you wan to make a case to me that it' still under-valuing corporations I need some strategic justification (it basically considers them worth about 100 turns of their output now)
 
I will shortly be pushing some changes that at least start to address this. The gist of the changes is as follows:

  • The code was just evaluating what the thing being received was worth to the receiver, and NOT taking any account of what its loss cost the sender. For most trades this is ok (you don't LOSE a tech when you trade it, or your map, and so on), but for some (corporations, cities, and to a much lesser extent resources [the AI never trades its last away]) it's a BIG deal.
  • Corporation evaluation was just broken - it took no account of what the corporation actually gave when evaluating its trade value (assumed it was just a constant times num relevant resources times city count). Also took no account of competing coprporations in adjusting the effective value. The new code counts the full output value of the corp in all cities that have, and half ion those that do not (since you can spread it to them). It adjusts the value for competitors as follows: <value> := <value>*3/(numCompetitors+3)
  • Corporation evaluation under-valued production and food by a factor of several.

The first of these is an important generic issue (not corporation-specific), so the fix will also impact city trades (tend to make them more expensive) and corporations to monopolize resources and commerce, and to a much lesser extent resource trades

With the fixes you'll find in your save game that:
  • Manchuria wants both your techs for one city, and will not recognize any valid trade for more than 1
  • Kubla Khan will still trade one of his corporations for your tech, but not the other. Looking at the numbers this actually seems fine to me (it's a vetry low value corp for you as you already have 5 competitors!) an its production per turn across his entire civ is only about 270 gold. For a tech with a cost of > 50K this seems like an ok trade

It may need further tweaking, and if you wan to make a case to me that it' still under-valuing corporations I need some strategic justification (it basically considers them worth about 100 turns of their output now)

Thanks for addressing this - It still seems as if I can simply go for Science and just build as many cities as possible as I did and then just trade some of my techs to various Civs and eventually build up a monopoly of Corps / have them build my armies for me than buy them with a few techs or 4000 dollars (for 10-15 units tanks, subs etc.) and than buy out their cities with other techs and look at my savegame - I've dominated the game because of this strategy. It feels like cheating to me so I would argue that trading citites (which may have wonders or even uranium etc. for 1 or two techs seems waaaay to easy...
 
Koshling, you didn't mention any consideration being taken of other losses from a city being sold, most obviously a loss of a resource in its radius/being made in the city. Since you mention that you've changed it so that the AI has a value for the loss/gain of that resource, does it take into account things like that? I assume it doesn't understand about, say, the strategic value of chokepoints.
 
Koshling, you didn't mention any consideration being taken of other losses from a city being sold, most obviously a loss of a resource in its radius/being made in the city. Since you mention that you've changed it so that the AI has a value for the loss/gain of that resource, does it take into account things like that? I assume it doesn't understand about, say, the strategic value of chokepoints.

It takes account of the resources in evaluating the value of the city, so indirectly it does take that into account. It has some understanding of choke points when choosing city build locations, but currently not when evaluating their trade significance (well spotted!)
 
Back
Top Bottom