Getting the AI to research differently.

notque

Artificially Intelligent
Joined
Nov 13, 2005
Messages
1,683
Does the flavour mechanic affect AI research at all? Is there any way in the xml or python affect the AI research?

I've autoplayed a few games now watching everyone, and am do not like that all the ai tends to go on a similiar path.

Also, I found a bug that if you have an Evil Khazad, the AI refuses to choose a tech to research after exploring.

So, What decides how the AI researches? Why would an evil Khazad not know what to research? Where is that set?

Thanks.
 
Khazad are set to beeline for Runes of Kilmorph with a python script (Similar to clicking the Runes of Kilmorph tech as your research choice right from the beginning). But there are some python scripts that prevent an AI from researching a religious tech that would change it's alignment. So an evil Khazad would be forced to research Runes of Kilmorph, but could not, because it would change it's alignment to neutral.
You might want to post that in the bug thread.

Secondly the AI tech paths are usually the same, because most AIs are forced to make a certain beeline set in the python scripts(Ljolsofaer --> FoL Religion; Luchiurp--> Construction; Balseraphs -->Festivals; Calabim -->Feudalism) and afterwards their weightings kick in. Almost all AIs have ridicolously high weightings towards military techs, forcing them down virtually the same tech path every game, because they will usually go for the military tech no matter what their current situation is.

To change it you'd need to tinker with the python scripts and I recommend reducing all AI weightings by a factor of 5.
 
Excellent, exactly what I wanted. I will edit and change the tech paths. Now, to find the python scripts that has this.
 
CVgameutils! And it's all really easy. I can set Leaders instead of civs to have beelines. This is awesome, thank you.
 
I'm trying to run

if pPlayer.getLeaderType() == gc.getInfoTypeforString('LEADER_NOJAH'):

It works when the leader is in the game, and python errors when they aren't. How do I check gc.getInfoTypeforString without causing a python error if there isn't a leader in the game. Do I assign it to a variable, and see if it's a real value someway?

I'm doing this in CVGameUtils. Any insight to my error would be appreciated.
 
As long as LEADER_NOJAH existed in the XML you wouldn't get an error for that. Are you sure this is the line you get the error on?


And to see how the AI would like to research, in the next version of FF (should be out tomorrow sometime, barring computer/work/family issues) you can see their tech preferences by holding CTRL or ALT while you mouse-over any tech or their name on the scoreboard. It tells you the numerical weight they assign to their top 2 choices for techs, but there is also a 2000 point random used when the AI finally does choose a tech to research, so it won't completely tell you which tech they will hit next (Also this is without any advisor type limitation, and sometimes the AI will only select the techs associated with a particular advisor)
 
It exists in the XML, and works when the leader is in the game. It makes the decisions for the leader instead of the listed Civilization.

It is that line. It is that call.

I agree, it should work. I have placed the calls in different places for different leaders, and in that function, and if they are in game, it works. If they are not in game, it gives the attribute error.
 
Top Bottom