Results 1 to 19 of 19

Thread: Opponent AI

  1. #1
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Opponent AI

    If I Chose balanced and then go through europe to Crusades its no longer able to fight propely againist Turks and later mongols to i had to change the AI every Battle ?or choose random and the game will choose for every faction for me ?
    I Came,I Saw I Partially Differentiate

  2. #2

    Default Re: Opponent AI

    The AI Opponent’s Preferred Formation type, which you choose before the Setup and the main game, gives it a hint as to what kind of formation type it should use that is both most suitable for the army compositions it has, and closest to historical formations as well (when I say that I am aware that in most large battles, armies were more typically arrayed with a left wing, a center and a right wing).

    Since the formations file is only loaded once, each time the game starts, you have to choose it then. I like to save each battle before it begins, exit the game, restart it, choose ‘Random’, then reload the saved battle. I realize its a bit cumbersome but its pretty much the best we can do.

    Now, the actual BattleAI parameters (contained in battle_config.xml and config_battle_ai.xml) are loaded by the game prior to each battle, so what we have done is to have a background script running that randomly chooses one of the five possible ones we hand-customized every minute (can’t remember the exact interval). So every time you play a battle the AI will act differently, even if you have a saved battle and play it again.
    Last edited by Point Blank; October 19, 2018 at 06:47 AM.

  3. #3

    Default Re: Opponent AI

    PB,
    Could you please explain how this is different from the last version of ReallyBadAI by Germanicus5? I understand that we can pre-select from one of five scenarios before the battle starts, but is this still essentially the same battle AI as ReallyBadAI with only the additional option to choose the most fitting of the five, or is this something different entirely?
    Roland searched the continent for the man who'd done him in
    He found him in Mombasa in a barroom drinking gin
    Roland aimed his Thompson gun. He didn't say a word
    But he blew Van Owen's body from there to Johannesburg
    - Warren Zevon - Roland the Headless Thompson Gunner - 1978

  4. #4

    Default Re: Opponent AI

    Well there are 5 different formation types, one of which is chosen by the player prior to starting the game (or is randomized), and 5 different BattleAI file sets, one of which is chosen randomly prior to each battle; I have made some updates to those. You will find that ReallyBadAI operates a bit differently depending on the formation type chosen, and how those interact with each of the random 5 AI sets (lots of different parameters and factors there), and given the many different tactical situations, the number of combinations is huge. As I have said previously, ReallyBadAI does very well with RC2.0, better than with the previous version, partly due to the lower combat rate I think which make battles a bit more forgiving of mistakes. But yes, RBAI has only had some small changes plus I have accentuated the differences between each of the 5 random AI sets.
    Last edited by Point Blank; October 19, 2018 at 11:58 AM.

  5. #5
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    but i got tired of making battles then playing every battle with restarting the game , is not the game already choose the type of AI prior to battle itself already ? and please if i choose random or balanced doi had to play vs mongols with them playing as England style ? hmmm i am lost
    I Came,I Saw I Partially Differentiate

  6. #6

    Default Re: Opponent AI

    Quote Originally Posted by M.A.E View Post
    but i got tired of making battles then playing every battle with restarting the game , is not the game already choose the type of AI prior to battle itself already ?

    It chooses 1 of 5 BattleAI logic and parameter sets randomly prior to each battle, it does NOT choose which formation to use randomly, except to the extent that it does its best to fit the AI army composition to the available Formation types, moderated by the priority we assign to each formation. For example, when we choose 'Infantry to the Fore', that formation type will be prioritized when the AI is deciding which formation to use. Its complex

    and please if i choose random or balanced doi had to play vs mongols with them playing as England style ?

    You don't 'have' to do anything. If you think you will be fighting vs Mongols (for example) then its probably best to choose the 'Horse Archers' formation type, or if you expect to be fighting French then choose Heavy Cavalry.

    As I said cumbersome but before I set it up the AI would only ever use a 'Balanced' formation.

    hmmm i am lost
    Something I can try is to set up one final Formation style, lets call it 'Equal Priority', such that all the formations have an equal priority so which one it chooses to use will be entirely dependent on how M2TW parses the individual formations and the AI army. I will cancel the patch upload and implement it now, it will only take about ten minutes, and then the upload another 50 or so. I don't know how well it will work in practice though.
    EDIT: done, uploading the patch now.

    I can't really explain all this simply, because it isn't simple, but actually it is one of the cleverest parts of the M2TW battle engine.
    Last edited by Point Blank; October 19, 2018 at 01:06 PM.

  7. #7
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    +rep, you are truly a respectable man and skillful modder i hope you all of welfare in life as to me.


    if you need any help i can help you , i can give i know both how to mod and how to write a nice text descriptions.
    Last edited by M.A.E; October 19, 2018 at 01:15 PM.
    I Came,I Saw I Partially Differentiate

  8. #8

    Default Re: Opponent AI

    Cheers mate much appreciated

  9. #9

    Default Re: Opponent AI

    Actually there is something you might be able to help with. Do you know much about unit modeling? Please have a look at this thread:
    http://www.twcenter.net/forums/showt...1#post15676648
    What we want to do is take Janissary Archer and replace the sword it uses as a secondary weapon with the halberd from Janissary Heavy Infantry or the Voulge from the Voulgier, as in the pic below (the middle guy); can you assist?
    Last edited by Point Blank; October 20, 2018 at 01:36 PM.

  10. #10
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    Actually i am not so Good with modelling and i have barely access to the required Programs for at least a fortnight but know whom can help,i will keep in touch if i figured it out.

    and the Janissary are mostly 1H Sword and shield and Secondary Poleream for the Cavalry charges only. dont know why mostly you use halberds
    Last edited by M.A.E; October 19, 2018 at 02:56 PM.
    I Came,I Saw I Partially Differentiate

  11. #11

    Default Re: Opponent AI

    Its not 'mostly', its one unit, the JHI, who has a halberd and a shield, and operates in phalanx mode, ie its primary use is vs cavalry. In M2TW you can't have someone armed with a sword primary and a halberd secondary. And even if you could, how is the AI meant to know when to switch to the halberd, when they are being charged by cav? Just how would it know that? What if they are attacked by infantry in the flank? Should those guys drop their halberds and pull out their swords? Aside from the animation questions, there are multiple issues with having two melee weapons.
    The Janissary Archer has a bow and a sword, the J. Arquebusier has a sword, as does the Janissary Musketeer.
    The soldier above has a bow and a halberd/voulge and is historical.
    Last edited by Point Blank; October 19, 2018 at 04:01 PM.

  12. #12
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    Quote Originally Posted by Point Blank View Post
    Its not 'mostly', its one unit, the JHI, who has a halberd and a shield, and operates in phalanx mode, ie its primary use is vs cavalry. In M2TW you can't have someone armed with a sword primary and a halberd secondary. And even if you could, how is the AI meant to know when to switch to the halberd, when they are being charged by cav? Just how would it know that? What if they are attacked by infantry in the flank? Should those guys drop their halberds and pull out their swords? Aside from the animation questions, there are multiple issues with having two melee weapons.
    The Janissary Archer has a bow and a sword, the J. Arquebusier has a sword, as does the Janissary Musketeer.
    The soldier above has a bow and a halberd/voulge and is historical.
    Agreed
    I Came,I Saw I Partially Differentiate

  13. #13
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    I tried the Random Priority and its very bad, but the balanced and equal seem to overconflict as equal Priority . how do you differntiate between them ?
    I Came,I Saw I Partially Differentiate

  14. #14

    Default Re: Opponent AI

    Random just picks one of the other six Formation types. In what way is it ‘very bad’?
    I haven’t had time to test Equal much but I suspect that in most cases it will select a similar formation to what Balanced would give. I can test and tweak it to give more variety when I get my PC back in a few days.
    Last edited by Point Blank; November 10, 2018 at 01:38 AM.

  15. #15
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    Random is Not Adequate unless in Ambushes... thats my call.
    Balanced After Testing is Good in Field Battles and Somehow Fair for Many European Factions.
    Equal Priorities seems Best Match but need more Love as it somehow Passive. i hope to test it further next week to see if it works perfectly for all battle cases , ie Ambush , Sieges,Defense , Attack Overpowered ,Pyrrhic Battle ...etc
    I Came,I Saw I Partially Differentiate

  16. #16

    Default Re: Opponent AI

    I don’t think you understand. Random randomly chooses one of the six Formation types for the AI to use. Maybe it will pick HA, maybe it will pick Infantry and Archers. Random is NOT a Formation type.

    There is no reason Equal would make the AI generally passive - it’s only selecting a Formation. Otherwise AI behavior is modified in *every single battle* by the selection of one of five BattleAI parameter sets.

    The formations for siege, ambush etc are the same for every Formation type. I suggest you look at the code in the RRRC Launcher and the formation files.

  17. #17
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    Could you Implement a Formation for every faction that would be easier for newbie like me. like wen i face up Mongols they have thier Historic Formaytions , and Englaned with their Archers and 3 lines Formations ... etc do you understand me ?

    edit:
    or just edit Equal pirorities a little to the desired outcome
    Last edited by M.A.E; November 11, 2018 at 05:38 AM.
    I Came,I Saw I Partially Differentiate

  18. #18

    Default Re: Opponent AI

    Er, that is exactly what I have done. If you are fighting the Mongols choose Horse Archers, if fighting England choose Infantry and Archers etc.

    If its a problem for you just select Balanced and forget about the options.

  19. #19
    M.A.E's Avatar Miles
    Join Date
    Dec 2015
    Location
    By The Sea
    Posts
    343

    Default Re: Opponent AI

    Quote Originally Posted by Point Blank View Post
    Er, that is exactly what I have done. If you are fighting the Mongols choose Horse Archers, if fighting England choose Infantry and Archers etc.

    If its a problem for you just select Balanced and forget about the options.
    Ok That is The Desire of me sojust choose Equal pirorities and forget about it
    I Came,I Saw I Partially Differentiate

Posting Permissions

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