Results 1 to 7 of 7

Thread: AI Recruitment Policy

  1. #1
    pongi's Avatar Foederatus
    Join Date
    Jan 2010
    Location
    HUNGARY
    Posts
    44

    Default AI Recruitment Policy

    Hello there,

    I am posting this thread, i need a little help in coding of MTW2. Where can i change the recruitment policy of the AI.

    They AI most of the time focusing on Militia units instead of Castle Units and doesn't train any cavalry.

    i added recruit_priority_offset to EDU, but little change happened.

    Thanks for the answers

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

    Join Date
    Aug 2011
    Posts
    3,697

    Default Re: AI Recruitment Policy

    AI Recruitment Offset > Upkeep and Recruitment Cost vs Unit Strength > AI Personalities


    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.

    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 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
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    625

    Default Re: AI Recruitment Policy

    Yeah but they are almost all useless ... Firstly you (or someone else) said that all the personalities with artillery are not to use because they produce too much artillery, then Secondly, there are not all types of mixing (for ex. no heavy cavalry + heavy infantry) and lastly, what does the "Smith" exactly do ?

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

    Join Date
    Aug 2011
    Posts
    3,697

    Default Re: AI Recruitment Policy

    First, set the units type to heavy or light, depending on what you want it to be. This plays directly into the AI personalities (recruit light or heavy), as it contributes a bias on its own. I use something like fortified knud (can't recall specifically, but if you want I can check)

    Secondly, upkeep and recruitment cost vs quality of the infantry/cavalry is paramount to whether the AI will actually recruit the unit as that too contributes a bias towards the unit and whether it will recruit the unit.

    Lastly, make sure that the recruitment priority is less in general for units you don't want it to recruit by a significant margin (for example peasants at -50 or even -75) while feudals are positive or ambivalent at 0.
    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
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    625

    Default Re: AI Recruitment Policy

    Ok I'm not yet at the EDU, so I don't understand what you mean with recruitment priority. When I'll get to that, I'll probably post

  6. #6
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    614

    Default Re: AI Recruitment Policy

    How do you think - is automatic army composing button in custom battle a valid way to test AI recruitment priority for same faction in campaign?

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

    Because AI is dumb and full of errors.

  7. #7
    z3n's Avatar State of Mind
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,697

    Default Re: AI Recruitment Policy

    I never thought about that but it could be very valid as a test.

    You can test it by tweaking the recruitment priorities for a single faction to be entirely 0 or negative for almost all units except for 1 which is in the high positive, for example 100. And making the cost of them low.


    Although I think the campaign is likely the most effective test overall, due to the AI personalities being used at that point. Since during a custom battle they would probably not be.
    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)

Posting Permissions

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