PDA

View Full Version : AI building influences



Revenant
01-23-2009, 11:51
Hello!

I do not know if anyone is still modding MTW or has any knowledge about building datafile, ut i will try nonetheless...

Does anyone know how exactly work column 11 in CRUSADER_BUILD_PROD13.TXT,
labelled as:

"AI building influences for building combos labels"

...........................

lets take a BOWYER, for example:

in column 11 for bowyer, there is written:

"{HORSE_BREEDER(50),SWORDSMITH(50)},{HORSE_BREEDER(100),HORSE_BREEDER2(100),HORSE_BREEDER3(100),PORT( 50),MOSQUE(100)},{SWORDSMITH(100)},{MILITARY_ACADEMY(100)}"

as bowyer has 4 levels and the text above has four sections in {}, I think they are somehow linked to levels of Bowyer, so the first:

{HORSE_BREEDER(50),SWORDSMITH(50)} has something to do with Bowyer

{HORSE_BREEDER(100),HORSE_BREEDER2(100),HORSE_BREEDER3(100),PORT(50),MOSQUE(100)} has something with Bowyers Workshop and so on


I would think this data describes which buildings should be made just after bowyer is created. So, if AI would create bowyer lev. 1, the next building should be horse breeder or swordmith with 50/50 chance.

If AI would create bowyers workshop, the next one should be horse breeder of the highest level up to 3, then mosque or port.

Am I right about it?

And can somebody give me more insight in this matter, please?

Rev

Raz
01-27-2009, 06:35
Heh, glad to see a fellow modder. My knowledge is a bit rusty since I haven't modded much for quite sometime now, and even more rusty on the buildings_prod, so please bear with me. Nevertheless I'll try my best to enlighten you. :wink2:

As the label suggests, these influence the AI after they've built one building, to build another (listed here) as you seem to already know. I wrote this here to make my post look bigger. Anyway, higher numbers result in a more likely chance that the AI will build it. However it is not a percentage.... I think. Naturally you'd assume it'd crash if it hit more than 100 but there are plenty of columns like that with values much greater than 100. I also, though I don't know for certain, believe that applying a negative number will reduce the chances of the AI constructing that building as apposed to increasing the chances.

I recommend you test it yourself as the best way to learn is via 1st hand experience. Remember to make backups.

To test, I think simply removing most of the stuff and replacing it with extreme number variations would be best. Using your example, I'd change the box like so:


"{HORSE_BREEDER(999),SWORDSMITH(-999)},{},{},{}"

Start MTW in the test/developer mode with these changes in effect. Give the AI factions plenty of money with the .deadringer. cheat and play through a few dozen turns without being completely annhilated. Now swap to an AI faction and check their buildings. In all the provinces with bowyers, there should be a horse breeder of some sort and no swordsmith.

I know in some places the test is flawed but it's not meant to be extensive. If you don't understand some parts of the test, can't be bothered testing, or haven't a clue what I'm on about, simply reply. :thumbsup:

Revenant
01-27-2009, 10:47
Thank you for help, I thought than nobody is concerned anymore:)

I will make some tests in this matter.