MG/AI control

From MegaGlest
Jump to: navigation, search

This feature is available in rev 2603 and later.

In MegaGlest, it's possible to control the AI to some degree by specifying which types of units and buildings are most important, as well as the priority for upgrades. Specifying these lets mods tailor the AI production specifically for their mod. Thus, it could be used to specify what units should be the backbone of the AI's army, what is the primary worker unit, etc. This is done in the faction XML

XML[edit]

<ai-behavior>
	<worker-units>
		<unit name="castle" minimum="1"/>
	</worker-units>
	<warrior-units>
		<unit name="battle_machine" minimum="1"/>
		<unit name="archer" minimum="1"/>
	</warrior-units>
	<resource-producer-units>
		<unit name="pig" minimum="1"/>
	</resource-producer-units>
	<building-units>
		<unit name="blacksmith" minimum="1"/>
	</building-units>
	<upgrades>
		<upgrade name="stables"/>
		<upgrade name="robotics"/>
		<upgrade name="advanced_architecture"/>
	</upgrades>
</ai-behavior>

Documentation[edit]

ai-behavior[edit]

This tag will be present in the <faction> tag of the faction XML, and will contain all the other elements to define the AI's behavior.

worker-units[edit]

Units specified here are treated as workers and make up the bulk of production and expansion. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

warrior-units[edit]

Units specified here are treated as warriors, meaning they will be used as the primary attack force. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

resource-producer-units[edit]

Units here are considered to be necessary for producing different resources, such as food. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

building-units[edit]

Units here are considered to be other important buildings that the AI should attempt to build early. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

upgrades[edit]

Upgrades here are considered to be important upgrades that are priority for the AI to develop.

See also[edit]