Results 1 to 13 of 13

Thread: AI Recruitment Policy

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

    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
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    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
    648

    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
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    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
    648

    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 Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    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?
    Russian warship is winning. Proofs needed? Go find yourself!

  7. #7
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    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)

  8. #8

    Default Re: AI Recruitment Policy

    someone can tell me. how can I get AI to recruit agents and naval more often?

  9. #9
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: AI Recruitment Policy

    Lower the recruitment cost and upkeep within the export_descr_unit for ships.

    Within descr_character, lower the recruitment cost and upkeep for the agents.
    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)

  10. #10

    Default Re: AI Recruitment Policy

    I set the cost of ships 100 or less, upkeeper 10-50, recruit_priority_offset 80, the wage of the Admiral 0. the AI also has a script for which its Treasury will always be greater than 0... still, the faction doesn't get ships.

  11. #11
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: AI Recruitment Policy

    What AI are you using, and do they need the ships?
    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)

  12. #12

    Default

    Are needed this is Tunis in the mod of the Italian wars(). I tried standard AI(vanilla), and Skynet(but only AI on the strategic map, without a script for tactical battles, I think it will not affect the ships?). There is no difference.
    https://cdn.discordapp.com/attachmen...73/unknown.png

    The AI is well-used by the start fleet, makes landings, attacks, but does not recruit new ships. Thus, with the loss of the start fleet, Tunisia remains cut off from the world.
    Last edited by Frunk; April 25, 2020 at 05:50 AM. Reason: Posts merged.

  13. #13
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: AI Recruitment Policy

    Try higher recruitment priority and lower costs even more. We used to have problems with the AI recruiting too many ships, and the way we fixed it was by making the cost higher and recruitment priority lower.
    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
  •