Page 1 of 4 1234 LastLast
Results 1 to 20 of 61

Thread: AI Personalities

  1. #1
    z3n's Avatar State of Mind
    Patrician Artifex

    Join Date
    Aug 2011
    Posts
    4,133

    Default AI Personalities

    This isn't necessarily my own tutorial although there is a slight foreword to it with a couple of ideas which are in fact not my own. After a search I came across a couple of posts explaining these personalities by CA. The original links do not function but high profile figures, including the old lead programmer for CA confirmed this applies to RTW.

    I am not sure whether the personalities and their functions were carried through untouched into M2TW, what the 'build personalities' do in M2TW has been something discussed before. It was suggested that it could influence what the AI wants in a city when invading rather than what it builds. In any case, there was also the idea proposed that one could 'trick' the parser into utilizing every single personality, though each would be prioritized sequentially with the last having more of an effect than the first.

    Here's an example, and before I forget the most important part as to where this code would go within the descr_strat.txt located in data/world/maps/campaign/imperial_campaign you'll find a file called the 'descr_strat.txt'. Within this file you will find each faction with their respective personalities. Also note that you will be able to assign different AI labels as well which are located in the descr_campaign_ai_db, you can remove all the AI labels within this file except for the default one which is necessary according to CA (in their original descr_campaign_ai_db file there is a tutorial) which is probably used for hordes and perhaps protectorates or some other important purpose. The descr_sm_factions file has an option of 'prefers_naval_invasions' where you can say yes or no, this will likely influence whether it prefers to see if a naval invasion is possible before a land invasion. I am getting off topic by now, so I will stop there.

    Code:
    faction france, balanced comfort religious sailor bureaucrat fortified trader craftsman mao stalin caesar napoleon genghis smith henry
    If one would rather stay with two I recommend using this, as it would in theory maximize land based militaristic policies.
    Code:
    faction france, fortified genghis
    Without any further ado, here's the write up on the subject.
    These control a set of AI production personalities, which contribute a bias towards building and training (but not retraining or repairing). This bias is fairly small compared to game-generated factors such as "the enemy is attacking me with lots of cavalry, build me some spearmen". Explaining the weighting system which drives the production AI in full is beyond the scope of this document as it would take several days to write.

    So in short, the building construction personalities are these:

    balanced - biasses towards growth, taxable income, trade level bonusses (roads), walls and xp bonus buildings

    religious - biasses towards growth, loyalty, taxable income, farming, walls and law

    trader - biasses towards growth, trade level, trade base, weapon upgrades, games, races and xp bonus buildings

    comfortable - biasses towards growth, farming, games, races, xp bonus and happiness

    bureaucrat - biasses towards taxable income, growth, pop health, trade, walls, improved bodyguards and law

    craftsman - biasses towards walls, races, taxable income, weapon upgrades, xp bonusses, mines, health and growth

    sailor - biasses towards sea trade, taxable income, walls, growth, trade

    fortified - biasses towards walls, taxable income, growth, loyalty, defenses, bodyguards and law

    These biasses are towards building properties, rather than buildings themselves. The game does not know what a "Blacksmith" is, for example, it only knows that it is a building which provides a weapon upgrade, and hence a Craftsman AI would be more likely to build it than another AI personality type.

    These are then combined with a troop production personality, as follows:

    smith - exactly level

    mao - biased towards mass troops, light infantry

    genghis - biased towards missile cavalry and light cavalry

    stalin - biased towards heavy infantry, mass troops and artillery

    napoleon - biased towards a mix of light and heavy infantry, light cavalry

    henry - biased towards heavy and light cavalry, missile infantry

    caesar - biased towards heavy infantry, light cavalry, siege artillery

    The same system as for the buildings applies. Troop category and class are combined at the time the unit database is loaded to give a unit production type, and the likelihood of the AI choosing to produce a given unit type which can be produced is then modified by the unit type weighting. There is also a random element in the choosing of which building or troop type to produce next, so the effect of the bias is a statistical thing. Another factor that is applied over the top which may obscure the bias is a tendency towards producing troop mixtures (according to what is already in the garrison) and a weighting according to unit strength.

    The two sets of types can be freely combined; for example, although Fortified Caesar does not appear in the list of options currently used by the vanilla RTW game, it is a valid combination.

    -------------------------------------------------------------
    Economic Variables (option 1)
    -------------------------------------------------------------
    Finance Group
    Trader = Economic (external revenue - surplus generation)
    Balanced = Economic (situation based spending) [dynamic]
    Comfortable = Economic (internal revenue - savings generation)

    Civil Group
    Bureaucrat = Law, education and subterfuge
    Religion = Happiness

    Military Group
    Fortified = Militaristic (offense & defense land)
    Sailor = Militaristic (offense & defense navel)

    -------------------------------------------------------------

    Political Variables (option 2)
    -------------------------------------------------------------
    Foreign Policy Group (aggressive)
    Napoleon (marginal)
    Caesar (moderate)
    Genghis (Extreme)


    Domestic Policy Group (aggressive/passive)
    Stalin (moderate)
    Mao (extreme)


    Economic Policy Group (passive)
    Henry (moderate)
    Smith (extreme)
    ------------------------------------------------------------
    Last edited by z3n; April 21, 2016 at 01:46 AM.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  2. #2
    z3n's Avatar State of Mind
    Patrician Artifex

    Join Date
    Aug 2011
    Posts
    4,133

    Default Re: AI Personalities

    There are unused personalities within the exe. (!)

    I am currently testing these as it seems they are the successors to the previous personalities. I invite others to do so as well, at first glance seems nothing is inherently broken in unworking so that is a promising result, my first experiment was to use the 'subotai' personality as it seems to be the successor to the 'genghis' one in addition to the 'fortified' personality. It would appear that the AI is still working normally. Whether it is better or not is too early to tell.

    Here is the full list of the personalities within the exe;
    sailor craftsman bureaucrat comfortable trader craftsmen tzar saladin tahar arslan alfonso roger vlad wyvadslaw robert doge guy knud subotai heinrich richard caesar henry napoleon stalin genghis mao smith
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  3. #3

    Default Re: AI Personalities

    any results so far?

  4. #4
    z3n's Avatar State of Mind
    Patrician Artifex

    Join Date
    Aug 2011
    Posts
    4,133

    Default Re: AI Personalities

    Can't remember if there was an increase in naval invasions or not but I am using fortified knud as the personalities.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  5. #5

    Default Re: AI Personalities

    Very nice to discover these hidden traits in the kingdoms.exe (who knows if it will come the day that the .exe will be fully accessible, it would open sooo many new possibilities)... btw, ok here it's important to test these innovative traits!


  6. #6
    b0Gia de Bodemloze's Avatar Europa Barbarorum Dev
    Join Date
    Dec 2012
    Location
    Makedonia, Greece
    Posts
    1,896

    Default Re: AI Personalities

    Quote Originally Posted by z3n View Post
    There are unused personalities within the exe. (!)

    I am currently testing these as it seems they are the successors to the previous personalities. I invite others to do so as well, at first glance seems nothing is inherently broken in unworking so that is a promising result, my first experiment was to use the 'subotai' personality as it seems to be the successor to the 'genghis' one in addition to the 'fortified' personality. It would appear that the AI is still working normally. Whether it is better or not is too early to tell.

    Here is the full list of the personalities within the exe;
    These are also in RTW?
    sailor craftsman bureaucrat comfortable trader craftsmen tzar saladin tahar arslan alfonso roger vlad wyvadslaw robert doge guy knud subotai heinrich richard caesar henry napoleon stalin genghis mao smith
    Under the Patronage of Veteraan.
    Proud member of Europa Barbarorum 2 team, developer of EBNOM, developer of EB 1.21, developer of Diadochi Total War, developer of Hegemonia City States and creator of one modpack for Megas Alexandros.


  7. #7

    Default Re: AI Personalities

    mhm, don't remember if RTW has them too (maybe looking at their names, could not be)...

    Btw testing these new sets takes considerable time to see how the AI behaves... :/ but they work.


  8. #8

    Default Re: AI Personalities

    any new results?

  9. #9
    bitterhowl's Avatar Centenarius
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    899

    Default Re: AI Personalities

    I can confirm that personality "tzar stalin" in my tests radically changes behavior of one passive faction (france/Frey in my Westeros submod). Faction become VERY agressive to weak factions and start an expansion. I test my campaign in Hotseat mode, when I give control to AI for all factions. My pc is rather old and slow, so capmaign goes to 70-100 turn for half an hour. I got about 10 tests with tzar and confirm it's agressivness. Something similar is with "arslan" for middle eastern culture faction, but need more testing.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  10. #10

    Default Re: AI Personalities

    Interesting, could you describe AI behavior at borders? Meaning how many stacks were gathered before launching an attack, and how AIs conducted those attacks in terms of path finding and priority targets?

    Of course, thanks a lot for these deep tests!


  11. #11
    bitterhowl's Avatar Centenarius
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    899

    Default Re: AI Personalities

    I have to say that at this point I have no time for watching the game during tests. I start hotseat, then switch all factions to AI and go away for 30-40 minutes. Then I stop the game by taking control above faction that interests me, then toggle off the fog of war and look at global situation. So I can't say about such details as invade targets or something else. But I'm going to start beta-testing of my submod with community, so it may give more detailed feedback.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  12. #12
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,733

    Default Re: AI Personalities

    So far any news?
    I was thinking about using some of the 'Kingdom' Ai personalities
    Proud son of Aikanr and brother of Iskar

  13. #13

    Default Re: AI Personalities

    I hoped to test some of the suggested ones, but still I hadn't a sufficient gameplay with many turns to build up an idea...

    hoping some more info will come up later on..!


  14. #14
    Mr_Nygren's Avatar Berserkir
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    4,239

    Default Re: AI Personalities

    Quote Originally Posted by bitterhowl View Post
    I have to say that at this point I have no time for watching the game during tests. I start hotseat, then switch all factions to AI and go away for 30-40 minutes. Then I stop the game by taking control above faction that interests me, then toggle off the fog of war and look at global situation. So I can't say about such details as invade targets or something else. But I'm going to start beta-testing of my submod with community, so it may give more detailed feedback.
    How do you put all the factions under the AI control in hotseats?

    Doesn't the player have to play as at least one??

    And clicking next-turn etc.. Interesting!
    Be your friend's, true friend. Return gift for gift. Repay laughter, with laughter again
    but betrayal with treachery.

    - The Havamal

  15. #15
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: AI Personalities

    There is a tutorial somewhere but I can't find it. In short, choose one faction to play as and then use the console to put it under AI control. e.g. Play as England then in the console, in the campaign, type "control england". To get control back, to see how things are going, type "control england" again in the console (or any other faction if you prefer).

  16. #16
    Mr_Nygren's Avatar Berserkir
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    4,239

    Default Re: AI Personalities

    Quote Originally Posted by Withwnar View Post
    There is a tutorial somewhere but I can't find it. In short, choose one faction to play as and then use the console to put it under AI control. e.g. Play as England then in the console, in the campaign, type "control england". To get control back, to see how things are going, type "control england" again in the console (or any other faction if you prefer).
    I will try to find that tutorial, i actually used that command in single player but nothing happened - so hotseat is needed?

    I used it to try and take control over another faction in my singleplayer campaign where i playtested a bit. - I was playing as the rebels and trying to take control of the Scourge.

    - In any case, will try it in hotseat thanks .

    Edit: Worked well, the only issue would be if the faction the player last controled gets destroyed then the campaign is lost and player needs to return to the menu. So i think rebels are important to be the faction played last. But this really speeds things up a lot.
    Last edited by Mr_Nygren; March 09, 2018 at 07:06 AM.
    Be your friend's, true friend. Return gift for gift. Repay laughter, with laughter again
    but betrayal with treachery.

    - The Havamal

  17. #17
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: AI Personalities

    Quote Originally Posted by Withwnar View Post
    choose one faction to play as
    For simplicity. You can choose as many as you like. To avoid the game ending upon death (wasn't aware of that), and if playing slave isn't an option, then you can choose to play all factions and use "control" to hand each of them over to the AI.

    Yes, "control" only works in hotseat.

    EDIT: found the tutorial: http://www.twcenter.net/forums/showthread.php?653352
    Last edited by Withwnar; March 09, 2018 at 10:03 PM.

  18. #18
    leo.civil.uefs's Avatar nis que va bruxo!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,080

    Default Re: AI Personalities

    Any news on this?

  19. #19
    bitterhowl's Avatar Centenarius
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    899

    Default Re: AI Personalities

    fortified knud for default factions and tzar knud for expansive factions seems to be pretty enough. With smart ai_label of course (such as Skynet or PeterAI or Beermugcarl).

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  20. #20
    Miszel's Avatar Domesticus
    Join Date
    Aug 2012
    Location
    Warsaw, Poland
    Posts
    2,200

    Default Re: AI Personalities

    Any developements in this regard? Has anyone tested whether personality like Dodge helps naval based to figure the invasions out?

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •