Hijacking flavours

Rob (R8XFT)

Ancient Briton
Retired Moderator
Joined
Aug 11, 2002
Messages
10,871
Location
Leeds (UK)
I was wondering if I hijacked a flavour in a complete conversion mod (i.e. Anno Domini), it would work?

What I'm talking about is this (as an example):
01. I want civs to use more strategic resources - e.g. prime timber, which is a pre-requisite to some buildings.
02. Flavour "Airlift" is unused in Anno Domini, as there's no air units in the ancient world.
03. I keep the "Airlift" label, but give it a value of 10 for those civs that I want to use prime timber.
04. I give an "Airlift" flavour rating to the buildings that require prime timber.

Would the AI think: "I'm favouring items linked to "Airlift"....this building is one of those, so I'll prioritise building it"?
 
I doubt it (not checked the code in detail though)

The general pattern is
* Do I need to use / stop using this economic / military / general strategy (influenced by leader flavours)
* What do I need to implement my active strategies (buildings, units, etc)
* What specifically shall I build in my cities (influenced by unit/building flavours)

So if the leader never adopts a strategy that requires units/buildings that can air lift, it'll never build any units/buildings with that flavour
 
The only real issues I can see are:
  • when is the AI programmed to start considering the Airlift flavor? If it is coded in the dll only to consider it when the AIplayer reaches the Industrial or Modern Era, that would be a problem.
  • will it go into a 'lock-up' loop trying to use the Airlift because it has a building it knows (via the building's flavoring) is supposed to support airlift but it cannot complete the Airlift action.

ninja'd and probably more accurately answered by whoward.
 
I'm talking about changing their flavours (as it's a total conversion mod, so even ALL the leaders are modded) so that they get a high rating for the airlift flavour, then modding the buildings I want them to build with a high rating for the airlift flavour also. I was only using "airlift" as an example.

Perhaps the way to persue this is to look at what the buildings actually do and ensure they have a high rating for that - e.g. you need stone to build walls, so ensure walls has a high city defence flavour and those leaders favouring city defence will make sure they build walls, even if they have to use their stone up to do so.
 
The AI is not a simple "I need to build something in this city, what are my options, which unit/building has the highest flavour for my leader flavour biases"

There isn't the direct connect between leader flavours and unit/building flavours that there appears to be - strategies get in the way. The hard part is getting the leader to adopt the strategy you need them to, to get them to build the units/buildings you want them to.
 
oh, ok. hmmm. Have you tried simply jacking up the most appropriate flavors that were used by Firaxis for buildings, but only within the <Building_Flavors> ? By most appropriate I mean based on what the building is supposed to do, and matching with the best flavor or combination-of-flavors.

I know with my Early Era Archery Buildings mod, the AI's love to build the three buildings I added. I used this for the Practice Range, which was the lowest-level of the three buildings:
Spoiler :
Code:
	<Building_Flavors>
		<Row>
			<BuildingType>BUILDING_ARCHER</BuildingType>
			<FlavorType>FLAVOR_MILITARY_TRAINING</FlavorType>
			<Flavor>20</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARCHER</BuildingType>
			<FlavorType>FLAVOR_OFFENSE</FlavorType>
			<Flavor>5</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARCHER</BuildingType>
			<FlavorType>FLAVOR_DEFENSE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARCHER</BuildingType>
			<FlavorType>FLAVOR_PRODUCTION</FlavorType>
			<Flavor>5</Flavor>
		</Row>
	</Building_Flavors>
This I used for the Archery Range, which is the second level of building and required the Practice Range:
Spoiler :
Code:
	<Building_Flavors>
		<Row>
			<BuildingType>BUILDING_ARCHER_BARRACKS</BuildingType>
			<FlavorType>FLAVOR_MILITARY_TRAINING</FlavorType>
			<Flavor>20</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARCHER_BARRACKS</BuildingType>
			<FlavorType>FLAVOR_OFFENSE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARCHER_BARRACKS</BuildingType>
			<FlavorType>FLAVOR_DEFENSE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARCHER_BARRACKS</BuildingType>
			<FlavorType>FLAVOR_PRODUCTION</FlavorType>
			<Flavor>10</Flavor>
		</Row>
	</Building_Flavors>
And for the highest level building of the three, the Artillery Range, I used these:
Spoiler :
Code:
	<Building_Flavors>
		<Row>
			<BuildingType>BUILDING_ARTILLERY</BuildingType>
			<FlavorType>FLAVOR_MILITARY_TRAINING</FlavorType>
			<Flavor>20</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARTILLERY</BuildingType>
			<FlavorType>FLAVOR_OFFENSE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARTILLERY</BuildingType>
			<FlavorType>FLAVOR_DEFENSE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ARTILLERY</BuildingType>
			<FlavorType>FLAVOR_PRODUCTION</FlavorType>
			<Flavor>5</Flavor>
		</Row>
	</Building_Flavors>
All three of these buildings give a slight production bump to Archery and Siege types of units and give directly to a Ranged-Unit or Siege-Unit extra XP or a free promotion.

I was originally concerned that my flavor-settings weren't high enough, but from using IGE to regularly check what the AIs were building, I decided the flavors I gave were OK, perhaps even a bit too high.

Based on when a building becomes available vis-a-vis other items an AI can create, you may need to add additional flavor-types to cast a wider net of flavor match-ups between what you are trying to tell the AI a building is good for, and the various 'strategies' they may be pursuing. And you may need to set your flavors a bit higher in comparison to the flavors of other items (buildings, wonders, and units) to get the AI to value Building-X over Unit-X at any given time, and to value Building-X over Building-Y, etc.

ninja'd a bit again by whoward
 
Thanks again and I definitely think that's the way forward. The reason I've been asking this is that the mod features a small range of strategic resources that are required to build certain buildings. In the early stages of the game, it brings about a choice of constructing X building over Y building, but the AI tends to stockpile these resources instead of using them, then trade them with the human player - so then the fight for resources is over. I'm thinking that tricking them into using the resources themselves is the way to go and will try what you've suggested.
 
Top Bottom