Is AI gifting units to City-States?

LastSword

Prince
Joined
Feb 24, 2013
Messages
1,064
And some extras:
Is AI gifting units to City-States? (answered)
Is AI making use of theming bonuses? (to precise: not randomly) (answered)
Is AI making any use of Building Cost Purchasing Discount?
Is AI purchasing great people with Faith?
Which policies/tenets are completely useless for AI?
 
Is AI making use of theming bonuses? (to precise: not randomly)

Yes there is extensive logic for getting the best theming bonus it can - and it uses it. (This one I know for sure, as I dug deeply into that code for my "Great Works can produce other yield types mod" - eg science in a university, nothing in a bank vault.)

Edit: If you're using my DLL, from FireTuner you can call pPlayer: DoSwapGreatWorks(iYieldType) to see how the AI would arrange the Great Works for pPlayer to maximise iYieldType
 
Is AI gifting units to City-States?

Probably not. Both Gift Unit and Gift Tile Improvement are commands (not missions) and those are typically UI only. Also, there are no direct call of the gift to minor methods from the AI logic.
 
Thanks for the answers.
I think I can write some logic about Purchasing Buildings/SS parts and unit gifting on my own. Theming bonuses would be out of my possibilities.

Btw, is v44 the newest one? I am getting lost in all your mods. :crazyeye: I assume you are not working on requests (I am a bit curious if ScienceBoost from Great Scientist can be based on birth turn).
 
Is AI purchasing great people with Faith?

This is tricky to answer due to the number of variables. The AI includes all the logic for deciding which GP (or unit or building) to faith purchase, and the logic allows for many variations (enhanced religion, post-industrial, need for combat units, etc), but whether as a result of many factors (did the AI spend the faith on something else first, does it consider that it needs a specific GP right now, etc) that logic results in the actual purchase of a GP is hard to tell.

Again, if using my DLL you could hook the CityTrained event and see if anything gets printed over the course of a game

Code:
function OnCityTrained(iPlayer, iCity, iUnit, bGold, bFaith)
  if (bFaith) then
    local pPlayer = Players[iPlayer]

    if (not pPlayer:IsHuman()) then
      print(string.format("Turn %i, %s bought a %s with faith in %s",
             Game.GetGameTurn(), pPlayer:GetName(),
             pPlayer:GetUnitByID(iUnit):GetName(), pPlayer:GetCityByID(iCity):GetName()))
    end
  end
end
GameEvents.CityTrained.Add(OnCityTrained)
 
(I am a bit curious if ScienceBoost from Great Scientist can be based on birth turn).
It could. The science (and culture, if not all yields) for every turn for every player is stored as part of the replay data (for drawing graphs), and units know the turn they were created on.

Do I take requests, not usually.

The latest version of the DLL is v45, but there are only minor differences to v44 (mainly in the CSD included code)
 
Gift Tile Improvement ... What?
From the CS popup, for an allied CS, spend 200 gold, point at a tile with a resource and they will improve it for you.
 
Which policies/tenets are completely useless for AI?
Given how bad the AI is, probably all of them ;)

Is AI making any use of Building Cost Purchasing Discount?
The AI doesn't purchase buildings, that logic is disabled. (Unless you're using CSD where it's been re-written and re-enabled.)
 
Given how bad the AI is, probably all of them ;)
Heh, that's why I added "completely".

The AI doesn't purchase buildings, that logic is disabled. (Unless you're using CSD where it's been re-written and re-enabled.)
Ok, I am wasting your time, but since your dll includes "all the source code of the CSD", will AI purchase buildings just with your dll?
 
since your dll includes "all the source code of the CSD", will AI purchase buildings just with your dll?

The CSD purchase code (written by Gazebo, not me) is embedded into the main CSD code - you can switch it off within CSD, but to switch it on you also have to switch on the main CSD code (if that makes sense). I'm not sure what effect enabling the CSD code within the DLL without the CSD mod loaded would have - but probably not a good one!

You need to set DIPLOMACY_CITYSTATES=1 before any of the others have any effect. DIPLOMACY_CITYSTATES_HURRY is the purchase code sub-switch, the other two sub-switches should be obvious as to what they do
Code:
<!-- Changes for the City State Diplomacy mod by Gazebo -->
<!-- See also: "Diplomacy - City States" -->
<Row Class="6" Name="DIPLOMACY_CITYSTATES" Value="0"/>
<!-- The quests sub-feature of DIPLOMACY_CITYSTATES -->
<Row Class="6" Name="DIPLOMACY_CITYSTATES_QUESTS" Value="1"/>
<!-- The resolutions sub-feature of DIPLOMACY_CITYSTATES -->
<Row Class="6" Name="DIPLOMACY_CITYSTATES_RESOLUTIONS" Value="1"/>
<!-- The hurry sub-feature of DIPLOMACY_CITYSTATES -->
<Row Class="6" Name="DIPLOMACY_CITYSTATES_HURRY" Value="1"/>
 
The AI however does randomly get GP from that one Patronage policy.
 
Top Bottom