Limiting unit sets for computer players

goddol

Chieftain
Joined
Mar 5, 2006
Messages
4
Hello,

I have tried many of the utilities given here, and while they are all quite well done, I haven't yet found one that allows me to do what I need to do. That is to limit the unit sets of computer players. By this, I mean one computer player could never use archers (for example), while another could never use stealth bombers (again, for example). I'm actually doing research on AI agents in video games. Does anyone have a utility capable of doing this? Failing that, can anyone suggest how to program this? I'm an experienced C/C++/Java programmer, but I'm only now learning Python.

Any help would be greatly appreciated.
 
Firstly, welcome to CFC! :band:[party]:dance:

Secondly, wrong forum. This is for completed utilitys online.

Thirdly, you should be able to change which Civs can have which units in CivilizationInfos.xml (I think). You'd have to do it manually each time.

Alternatively you could do it in CvGameUtils.py using the cannotTrain method.
 
There is also a UnitAIWeightModifiers in the CIV4LeaderHeadInfos.xml that the game uses to incent different leaders to prefer different types of units.

You could use it to give huge neagitves to the weighting so certain leaders would never make certain AI types. Unfortunatly that may not match up well with your plans if you are trying to base it on unit combat types.

Code:
			<UnitAIWeightModifiers>
				<UnitAIWeightModifier>
					<UnitAIType>UNITAI_ATTACK</UnitAIType>
					<iWeightModifier>100</iWeightModifier>
				</UnitAIWeightModifier>
			</UnitAIWeightModifiers>
 
Thanks very much to both of you, I'll definitely look into both ways of limiting unit sets. Sorry for posting in the wrong forum, where should I have posted this?
 
Probably in the main "Creation and Customisation" forum. The only reason for this is that questions and discussions tend to go there whilst finished articles or components get their own thead in the sub-forums.
 
Back
Top Bottom