Custom Flavors Possible?

Decimatus

King
Joined
Oct 22, 2005
Messages
853
Anyone know if I can create flavors, apply them to leaders, and assign them wherever(policies, buildings, etc) I need them?

Also, if you check the Randomize leader personalities box in the advanced setup, would that also randomize the custom flavors(if they work)?

And if they do work, are there any areas where vanilla flavors are hardcoded in ways that would preclude custom flavors from being activated?
 
I think Flavors are hard coded but I am not sure, try adding new flavor then add that flavor to a building and set its value to 1000, then add same flavor to a leader with value=1000 and then make a test by checking if the leader will pick that building before other buildings in city production. Anyway there are plenty of flavors in the game so why do u need to add new ones?
 
I don't see why you couldn't add a new flavor. They don't seem to be connected to any ACTUAL mechanisms; FLAVOR_GROWTH on a building, for instance, only seems to interact with FLAVOR_GROWTH on a leader, so if I changed both names to FLAVOR_BOB it should still work. If the flavors tied in to any actual game effect then there'd be no need for us to set them ourselves, the game would just automatically set them based on the unit/building/tech's benefits.

This is actually one of the bigger headaches of the game; if you make a new building, unit, etc. then you need to give it some flavors AND modify the flavors of the tech that gives it, because otherwise the AI won't realize that anything has changed. In my own mod I added a bunch of new techs, which wouldn't be so bad, except that I kept moving things from one tech to another, which meant I'd have to go back and make sure the flavor ratings still made sense.

But no, I haven't tried adding a new Flavor. I probably should, now that I think of it, but for now I'll hold off.

EDIT:
Forgot to add, there's a "Need" modification to certain Flavors. So if a city decides it needs more production, it'll prioritize production buildings over others. And so on for the major categories (food, gold, research, culture). But beyond that, I'm pretty sure the names are arbitrary; on the military side, for instance, there doesn't seem to be much of a difference between FLAVOR_OFFENSE, FLAVOR_MOBILE, etc. (I know this because I'd accidentally set a few units to the wrong one and it still made them in the usual ratios.) So if you make a new flavor, it won't get that final modifier for need/want/enough, but that's about it.
 
Forgot to add, there's a "Need" modification to certain Flavors. So if a city decides it needs more production, it'll prioritize production buildings over others. And so on for the major categories (food, gold, research, culture).

About that I am partially sure that city production is based on leader flavors not on city needs. I once created a new building with 1000 flavor on (Gold,Growth,Production and Happiness) then I wanted to test the new building and it happened that the random AI for testing was Genghis Khan , what happened is that he ignored the new building and continued spamming units !.
 
About that I am partially sure that city production is based on leader flavors not on city needs.

No. There are several Need/Want/Enough overrides in the game that override the normal Flavor logic. What happens is that under NORMAL conditions, the AI will use the Flavor ratings. But if the AI crosses a certain threshold it'll categorize a certain thing as a higher priority (Want or Need depending on how severe the shortcoming is), and will override the Flavor ratings to force that type of thing to be produced more often. From what I can tell, some of these thresholds depend on some of the leader's settings (with the Mongols having a very high point before they drop from Want to Enough on military), others depend solely on the era. So from the sound of it, the Mongol player was still stuck in Want mode for military units, and therefore wasn't even checking the flavor ratings for buildings.

I've done a bit of testing and tweaking on this. For instance, the Need/Want/Enough triggers for Workers are automatically disabled after a certain Era (Renaissance, I think); before then, the game will attempt to have each civ have a certain number of workers out in the field, and if there aren't enough, it'll make more no matter what the relative flavor ratings are. But after that era, the game will disable the Need and Want categories for tile improvement and let the Worker's flavor rating (which is very low) treat it like any other unit.
This wouldn't be so bad, except that my mod created three new Eras and I'd often start a new game in those later eras. The AIs (especially city-states) simply wouldn't make workers, because you'd already passed the point where the hard override went away and the Flavor ratings took over; you might get one or two eventually, but no more often than any other unit type. So I extended the Need and Want categories to the end of the game.

From what I could see in the AIDefines files, this sort of logic is also applied to production, gold, etc., to where an empire short on gold won't just shift every city's tile allocation to "Gold Focus", it'll also emphasize more gold-producing buildings, just like a human player would. My point was that adding a new flavor precludes this sort of override, but the normal flavor logic should work when a city isn't in one of these hard override modes.
 
In my case I won't need the overrides that much.

I have revamped the social policy system and added 10 additional branches of policies. I am adding 10 more branches probably today, and another 20 branches in the next few months. Many of the branches lock each other out, especially the governments.

So what I need is a flavor system specifically tied to the policies and not also tied to buildings, units, etc. It would be very difficult to ensure that the AI is not constantly choosing anarchy causing policies if I use the stock flavors, as many could be tied in strength, and even change depending on certain conditions. Without custom flavors I would have to rewrite the flavor system for the entire game to effectively handle the new policies.

I plan on creating 4-10 new flavors, and assigning a group of civilizations to each. As the AI goes through the ages, it will make policy choices based upon their group. For instance, Russia might be in a group that chooses Monarchy, then Communism, and then chooses Imperialism, Socialism, Autocracy, etc from some of the other pages.

Basically each civilization will take a route that is based upon how they generally worked in history, at least on average.

The second key function I need is for the randomize leader checkbox to also randomize my custom leader flavors. While the player probably won't know what government a certain civ normally picks(until I can add a system that gives you that info), the AI may play in certain other patterns that would be good to mix up every once in awhile.


Testing an addition is probably the way to go, though I will use a unit instead. Put 1000 on the archer, start in classical era, and then see how the AI handles it.
 
So I created a new policy, gave it a value of 1000, applied it to a leader, applied it to the archer, and started a game vs that leader. Didn't seem to work. So much for the hope that it would be quick and easy. :p

Going to have to work around it for now, as I don't feel like exploring this completely at the moment.
 
Back
Top Bottom