"Eye in the sky" to control AI - is that possible?

kipkuhmi

Warlord
Joined
Aug 8, 2007
Messages
131
Hi everybody,

I've implemented several new leader traits, and now I would like to know if it's also accepted by the AI. For example, there's a new trait "progressive", which cuts the costs for unit upgrades down to 50%.

Now my questions:

1.
Is there a any possibility to look into the AI factions as if they were my own faction? I.e., seeing the city info screens, the costs for building new units, the calculations of where the different revenues come from etc.?

2.
Can I assume that basically human and computer players are treated the same in cpp units?
I.e., if I alter, say, the procedure "getVotes()" in "CvPlayer.cpp", is that automatically set alike for humans as for AI players?
(I always thought this was the case, but then I discovered that a trait which was working fine for a human faction didn't show any effect as a computer trait. But maybe I just made a programming mistake ...).
 
1.
Is there a any possibility to look into the AI factions as if they were my own faction? I.e., seeing the city info screens, the costs for building new units, the calculations of where the different revenues come from etc.?
Yes, easiest way is to put them on your team (I think that works, but possibly not entirely exposing them) or go into the world builder and give yourself a ton of espionage points with them.

2.
Can I assume that basically human and computer players are treated the same in cpp units?
I.e., if I alter, say, the procedure "getVotes()" in "CvPlayer.cpp", is that automatically set alike for humans as for AI players?
(I always thought this was the case, but then I discovered that a trait which was working fine for a human faction didn't show any effect as a computer trait. But maybe I just made a programming mistake ...).
No, you can't assume that :)

Unfortunatey there are several instances where the human is treated differently, particularly in the AI decision making processes. Also, just because something 'works' for a human player doesn't mean it will work for the AI as the AI may have no clue how to take advantage of it. For instance if you were to give tanks the ability to build roads the AI wouldn't build tanks with the intent of using them to build roads. With Civics & traits it is a bit more complicated unless the civic/trait is providing a simple boost like +1 commerce per tile with 2 or more commerce. For example; having a trait that makes all workers cost 50% less to produce will not make that AI civ produce more workers, they will simply produce them quicker when they do decide to produce them.
 
Thanks for the answers, and sorry I didn't answer earlier. I was busy with another aspect of my mod.

@Seven05

From what I've understood looking at the game core structure and at your thoughts, I think I can presume that one has to seperate two aspects: first, if a new trait is theoretically working in the first place for an AI faction, second, if the AI faction uses it. In my special problem I was more concerned with the first question, but it's good you mention the second also.

One of my new traits is the "Progressive" one, and I think it matches perfectly with the situation that you described:

"Progressive" cuts down the cost for unit upgrades down to 50%. A very practical thing when you need many modern units very fast. However, when I test it in a game, the two AI leaders who were made "progressive" (Roosevelt, Napoleon) always turn out relatively weak. That's, as I suppose, because they *could* modernize their units for very little money, but as I haven't modified the AI scripts so far, they don't "know" of that possibility yet.

On a another trait, "Informed" (which doubles your espionage points), you can see the opposite effect. You can steer the leader's tendency towards using espionage as a means of politics, and when you set this value very high, he's in fact constantly making use of his advantage.
 
1.
Is there a any possibility to look into the AI factions as if they were my own faction? I.e., seeing the city info screens, the costs for building new units, the calculations of where the different revenues come from etc.?

Make sure you have Cheat=chipotle in your .ini file.

1. Press CTRL-Z to turn on debug mode.
2. When you open an info window there's a drop-down at the top to choose which civ to view.
 
Make sure you have Cheat=chipotle in your .ini file.

1. Press CTRL-Z to turn on debug mode.
2. When you open an info window there's a drop-down at the top to choose which civ to view.

Thanks for that great hint - that's exactly what I was searching for. Only two questions: Doesn't it have to be "CheatCode = Chipotle" instead of "Cheat = Chipotle" (I have no entry "Cheat" in my ini, an adding the line didn't show any effect). And I read somewhere else that typing "~help" you get an overview over all the availabe commands. But where do I type it?
 
Yeah use CheatCode.
 
Back
Top Bottom