Page 5 of 11 FirstFirst 1234567891011 LastLast
Results 81 to 100 of 204

Thread: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

  1. #81

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by GRANTO
    in the mtw2 pack files {i think it was 0_pack} there is CAI and BAI formations the lot ...., i was pretty sure these files were causing some conflicts with files in mods . {via the engine}
    It seems likely to me that your trouble is the cache more then that it's reading the pack first:
    Code:
    [io]
    file_first = true
    disable_file_cache = true
    Should solve that. I've personally never noted any similar behavior aside from certain decisions that are mostly confirmed to be in the exe.

    you can remove personalities all together and have nothing, for me it makes the the AI more adaptable to evolving situations.
    This is interesting and new to me, what would the correct format be for that?
    vanilla
    Code:
    faction england, balanced smith
    would it be:
    Code:
    faction england, balanced
    Code:
    faction england,
    Code:
    faction england
    ?
    I'd theorize that without a 'personality' the AI would do one of two things, either there is a 'default' and the difference you've seen is just the work of randomness or, the AI has no 'priority' so recruitment would be based solely on the afore mentioned factors (cost/efficiency, priority in the edu etc) and armies are then assembled by 'whatever is available.'

    Quote Originally Posted by z3n
    Anyway, the most important values were brought in from kingdoms. There is now an optional value in the EDU listed as 'recruit_priority_offset'. The description is 'Optional prioritization by the AI of recruitment of a give unit. 0 is neutral; negative is less desirable, positive more desirable'.
    Yes, I've seen this, I have worked with it a very little. My intent is to find the best 'personality' and then try and 'tweak' it using that. While I have not worked with it enough to be sure, my current theory, from my limited testing, is that it is a multiplier to the 'cost effectiveness' of the unit rather then a direct 'recruit priority' effect.

    The problem is not just recruitment, but army formation. In my mod, all settlements start with no buildings beyond the core building. With this, the AI tends to 'specialize' it's settlements (ie only build Barracks in one and Stables in another etc,) it will then assemble armies at the 'front' from the different settlements. I've reached the tentative conclusion that 'personality' really has nothing directly to do with recruitment, however it dose seem to effect how many of each 'specialty' there is (for example, 'genghis' will have more 'Stable' settlements and 'mao' will have more 'Barracks' settlements etc.) This, obviously, is not ideal and I may be forced to have all settlements start with the level one of each type to see if that will prevent this behavior. Anyway, 'personality' seems to more effect what the AI dose with these units after they are recruited. For example, 'mao' will assemble large infantry armies with support units, then all it's 'excess' cavalry are simply left at their point of origin rather then formed and used in an army, or, if the forces are needed it will simply move and use them as is, with peasants and militia to fill them out (in my mod peasant and militia units are far less cost effective then real unit's, and as such the AI only uses them for this purpose, which is exactly what I wanted.)

    As far as the random numbers thing goes, I've been aware of this for some time, TBH, I believe their use of a pseudo-random algorithm is ideal, as it sort of creates a 'controlled' randomness. While the exact starting conditions will reach the same conclusion, the probability of the starting conditions being identical in any given situation is astronomically low. I'm not sure about modern machines, but this is similar to old-school computers (ie C-64) where the random number generator was actually linked to the internal clock and did not produce a truly random number. For that you would need to use 'randomize timer' which in truth simply forced it to use a more complex algorithm rather then allow it to create a truly random number.

    This is why I never test anything once. Preferable I like to run 12 tests, discard the top and bottom results and average the remainder. However, I'm actually working on my mod right now, not just testing, so I'm settling for a lesser system of three, where I will reduce the 'best' by one step, increase the 'worst' by one step then average the results. On the event that all three are relatively equal, I'll just go with that. While this test is much less conclusive then a real test, it's also about 4 times faster and, seeing as I'm still only just over half done, I consider that a fair trade off.

    Quote Originally Posted by z3n
    I was going to suggest following a sort of balanced formula (10-25 for levies, higher priority for lower refreshing professionals/elites and so on),
    Funnily enough, this is almost exactly what my 'limited testing' that I mentioned earlier was Actually I was still using the 'vanilla' roster at the time, I was trying to get the AI to recruit higher grade units and less militia, so I did a system where militia units started at @ -50 then increased up-to 0 for high-end militia, and I started 'tier 1' units at 0 and added 10 per 'tier'
    The results were, well, I decided to completely rebuild the rosters instead, that about covers how successful the results were. I was planning on starting with something similar initially, but with a more consistent cost-to-effect model. I found that to be unneeded since I basically built that into the cost-effective model I use. The AI will always go for the higher tier units first anyway, because they are more cost-effective, and, as I stated earlier, only use militia as fillers or emergency troops.
    Last edited by CavalryCmdr; March 01, 2016 at 03:35 AM.

  2. #82
    GRANTO's Avatar Domesticus
    Join Date
    Dec 2010
    Location
    glastonbury uk
    Posts
    2,207

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    @z3n , i did not use a monitor tool , but i noticed major differences by having my own files in pak and when the generic ones were in it. ,
    @CavalryCmdr i know about cache and i dont think it works 100% ,

    for example if i make a basic Cai with parts missing but it still works ,
    it will read that file first yes but then it will go to pak to find the missing parts to make up the the rest ...
    what constitutes a 'Missing part' you are at the mercy of which file the .exe wants to read or reads between the 2 causing conflicts and unwanted behavior i believe.

    @CavalryCmdr you can just have faction england, or faction england, balanced
    or ....you can also have ....faction england, balanced trader religious smith mao henry ...or a mixture of all or any.

    remember the AI is also affected by whats going on around it to certain degrees ... it is not all internal , it can assemble armys to cope with CAI situations when some paramaters are lifted.
    some of the shackles put upon it can be detrimental to it also.

    im enjoying reading your stuff guys its always good to get nitty gritty into the .exe.
    Last edited by GRANTO; March 01, 2016 at 06:16 AM.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    I've reached the tentative conclusion that 'personality' really has nothing directly to do with recruitment
    @CavalryCmdr It may be possible I will note that I was testing using EBII's troop recruitment which features very limited recruitment from buildings directly outside of 'governments' (which are essentially core buildings). In any case you could very well be onto something with that thought, as the type of government built may be influenced by the personality (there are always at least 2 for each culture as far as I know). Grantos idea of removing the personalities completely is rather interesting, I wonder how the AI would act then. Test reports have repeatedly indicated some very odd army compositions at times, I suspect this is an element of the randomization the AI has. I've also seen some somewhat different naval movements from time to time, though there are only two I've noted with any true consistency. Lastly, I can doubly confirm cost effectiveness (and upkeep especially) is a major factor, I did test that myself, even back in RTW to the point of the AI spamming entire armies of just legions as Rome.


    @Granto
    Well I do recall linux users having issues where banner files would sometimes have a mix of a pack file/path alongside the mod file and path despite the file first CFG function, in fact that is what caused EBII specifically to crash on linux systems.

    I could see the pack file being used regardless of the file first command if the 'file' doesn't exist as logically we know the AI must use the configuration file/others when it doesn't have the file first command on. Only a resource test/packing ones own files directly into there would confirm it of course, you have done the packing part but as you might see CavalryCmdr and I like to doubly confirm it not just with our own tests but the other guys as well. Unfortunately I am rewriting part of a new battle script today so I don't have time to test that quite yet but I will soon if you don't check it with a process monitor before I do.

    Should solve that. I've personally never noted any similar behavior aside from certain decisions that are mostly confirmed to be in the exe.
    I agree with this, the file first when used does seem to ignore any file in the pack if there is a file in the mod/unpacked. This is some 'evidence' from a process monitor

    Code:
    Battle of Gaza Makedon : 
    ebii-inst/data/vegetation/sprites/normal_maps/ OPEN tallgrass_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS tallgrass_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS tallgrass_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS tallgrass_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ CLOSE_NOWRITE,CLOSE tallgrass_norm.texture
    ebii-inst/data/ OPEN config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE config_ai_battle.xml
    ebii-inst/data/ OPEN battle_config.xml
    ebii-inst/data/ ACCESS battle_config.xml
    ebii-inst/data/ ACCESS battle_config.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE battle_config.xml
    
    
    Pontos : 
    ebii-inst/data/vegetation/sprites/normal_maps/ OPEN tiny_weed_03_tc_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS tiny_weed_03_tc_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS tiny_weed_03_tc_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ CLOSE_NOWRITE,CLOSE tiny_weed_03_tc_norm.texture
    ebii-inst/data/ OPEN config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE config_ai_battle.xml
    ebii-inst/data/ OPEN battle_config.xml
    ebii-inst/data/ ACCESS battle_config.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE battle_config.xml
    
    
    Battle of Sentinum : 
    ebii-inst/data/vegetation/sprites/normal_maps/ OPEN grass_arid_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS grass_arid_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS grass_arid_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ CLOSE_NOWRITE,CLOSE grass_arid_norm.texture
    ebii-inst/data/ OPEN config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE config_ai_battle.xml
    ebii-inst/data/ OPEN battle_config.xml
    ebii-inst/data/ ACCESS battle_config.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE battle_config.xml
    
    
    
    
    Quick battle : 
    ebii-inst/data/vegetation/sprites/normal_maps/ OPEN grass_arid_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS grass_arid_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ ACCESS grass_arid_norm.texture
    ebii-inst/data/vegetation/sprites/normal_maps/ CLOSE_NOWRITE,CLOSE grass_arid_norm.texture
    ebii-inst/data/ OPEN config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ ACCESS config_ai_battle.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE config_ai_battle.xml
    ebii-inst/data/ OPEN battle_config.xml
    ebii-inst/data/ ACCESS battle_config.xml
    ebii-inst/data/ CLOSE_NOWRITE,CLOSE battle_config.xml
    In short while there was that linux problem, I don't really believe it is real evidence that pack files override the files outside a pack if file first is used. As its probably just exe based settings.

    Also the company that ported M2TW to linux was not CA, so who knows what they messed up in the process.
    Last edited by z3n; March 01, 2016 at 03:36 PM.
    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)

  4. #84

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    I finally finished my recruitment personality tests. Unfortunately I realized I made a critical mistake in setting up this test only after I was 3/4 of the way done, so I decided to finish as is. What I did is set up population growth so most settlements would be large or huge cities by about 90 turns, however I did not speed up building times. What this means is the AI had to pick-and-choose which buildings to build much more then they would in a 'normal' game. This is probably the biggest cause of my trouble with the AI 'specializing' it's settlements to the degree they did.

    So, bottom line, this test was even more inconclusive then it already was based on only running 3 runs for each 'personality.'

    It is probably important for me to note that all my rosters are unique, although some factions use another factions roster, there are no units that belong to more then one roster except the militia and peasant units, which are the same for everyone. So this means my rosters are fully balanced for the type of army I intend that faction to use.

    This is how I ran the test:
    Spoiler Alert, click show to read: 
    I had the AI auto-run 3 times to turn 100 for each 'personality' stopping to inspect their performance and armies at turn 50 and 100. To do this I basically gave them a 'grade' based on what I wanted to see for armies for that specific faction, looking only at armies that were ½ stack or larger. The grading system was basically: (note: I would 'discard' all-mercenary or obviously bribed armies)
    A+ : Almost all armies this faction had would be armies I would like to have built myself if I was playing that faction, in short, my idea of a 'perfect army' for that faction. This is a very rare case as any discrepancy would knock it down to an A. At least all armies I checked until I got bored of seeing perfect army after perfect army after perfect army.
    A : Most armies were perfect as stated above with occasional discrepancies in inactive (ie garrison or armies moving within it's own territory) armies or those that were in isolated regions (then they had to use militia units to 'fill' it out.) This was much more common then A+ due to the 'specialized' nature of the AI settlements.
    A- : As A with some 'active' armies being inferior but still balanced by use of militia units or mercenaries.
    B+ : Many A quality armies, but several inferior armies, similar to A- but with a larger majority of armies using militia units or with some few 'active' armies that were not balanced out at all.
    B : Almost all armies were 'good' armies, with some 'perfect' armies here or there.
    B- : This is more commonly used for factions that were 'loosing' and only had a few armies, but those they had were 'good' or better.
    C+ : A go to really, if I could not decide on a specific grade but the faction had at least one 'perfect' army.
    C : The AI had all the elements needed for 'perfect' armies, but was unable/unwilling to assemble them into proper armies.
    C- : Basically really bad, but had some of everything it needed to be able to build respectable armies.
    D : Really bad, basically reserved for when the faction built none of a basic unit type (cavalry, infantry, archer) Although most factions had this with one or two personalities only two had this regularly, which I'm fairly sure is a sign that those factions are not balanced cost-effect wise and need some roster work.


    That said here is what I have concluded based on this, rather faulty, test:

    1. Personality has a larger effect then I had thought based on earlier observation without actually 'testing' them. Although the effects are minimal from one personality to another, there is usually one 'wrong' personality where the AI builds useless armies, and one 'right' personality where their armies are notably better then the others.

    2. Using no 'personality' the AI will build whatever and then use whatever to assemble it's forces, which means most armies are assembled from one primary source settlement. Strangely, almost as if the AI was aware of this, it did not specialize settlements to the extent it did with any 'personality' in it. However, since it has no preferences armies are very rarely balanced or assembled in any meaningful way, and recruitment seemed more 'willy-nilly' then any other personality. Even 'cost-effective' factors seemed mostly discarded as this setup recruited much, much more militia units and peasants (which are even less cost effective then militia) then any other personality in my mod, so it was not unlikely to see all militia and/or peasant armies running around. That said, almost all factions had an average-to-above average performance, but no faction had the best performance using no personality.

    3. Using the description given for the personalities is a good starting point, it is my opinion that if the personality that should best fit your faction dose not, it means that roster is not balanced properly. Note here, use the description stand-alone, not to 'fix' a faction. So if your running in 'smith' and you think 'I want more cavalry' switching to 'genghis' is not likely to get the desired results, unless you actually intend for it to be a cavalry heavy army and the roster is balanced for such. A quick example is my 'Denmark' faction, which is balanced for strong infantry and good light cavalry, but poor heavy cavalry and below average archers. On 'smith' they recruited almost no cavalry, switching to 'genghis' they did recruit some low end, but not much, and recruited almost no archers. However on 'napoleon' (biased towards a mix of light and heavy infantry, light cavalry) which has the description of the army it is balanced for and intended to use, they balanced the army out nicely with just a few archers and light cavalry and maybe a unit or two of heavy cavalry. On occasion (6 out of my 17 rosters) the 'best' personality makes no sense. For example, my England faction, which should be 'stalin' (biased towards heavy infantry, mass troops and artillery) actually did best with 'genghis,' a better example would be my Egypt which should be 'smith' or even 'henry' but instead did best on 'mao.' Although that, I'm quite certain, is a sign of a poor balance job on my part.

    4. I believe my earlier thought about the personality having no direct effect on recruitment is, well, not quite right. There is nothing stopping the AI from recruiting outside it's personality, it is just more likely to recruit what is needed to fill out it's armies properly (if using the 'right' personality.) An unbalanced roster will recruit 'wrong' no matter what you do. For example my Sicily and Byzantine factions are downright determined that their heavy infantry are the best units ever no matter what personality I give them. Although there is some merit to my Byzantine faction thinking that, it makes no sense at all (to me) that my Sicily faction would think that any more then any other faction.

    5. Balancing cavalry is a pain in the

  5. #85
    GRANTO's Avatar Domesticus
    Join Date
    Dec 2010
    Location
    glastonbury uk
    Posts
    2,207

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by CavalryCmdr View Post
    I finally finished my recruitment personality tests. Unfortunately I realized I made a critical mistake in setting up this test only after I was 3/4 of the way done, so I decided to finish as is. What I did is set up population growth so most settlements would be large or huge cities by about 90 turns, however I did not speed up building times. What this means is the AI had to pick-and-choose which buildings to build much more then they would in a 'normal' game. This is probably the biggest cause of my trouble with the AI 'specializing' it's settlements to the degree they did.

    So, bottom line, this test was even more inconclusive then it already was based on only running 3 runs for each 'personality.'

    It is probably important for me to note that all my rosters are unique, although some factions use another factions roster, there are no units that belong to more then one roster except the militia and peasant units, which are the same for everyone. So this means my rosters are fully balanced for the type of army I intend that faction to use.

    This is how I ran the test:
    Spoiler Alert, click show to read: 
    I had the AI auto-run 3 times to turn 100 for each 'personality' stopping to inspect their performance and armies at turn 50 and 100. To do this I basically gave them a 'grade' based on what I wanted to see for armies for that specific faction, looking only at armies that were ½ stack or larger. The grading system was basically: (note: I would 'discard' all-mercenary or obviously bribed armies)
    A+ : Almost all armies this faction had would be armies I would like to have built myself if I was playing that faction, in short, my idea of a 'perfect army' for that faction. This is a very rare case as any discrepancy would knock it down to an A. At least all armies I checked until I got bored of seeing perfect army after perfect army after perfect army.
    A : Most armies were perfect as stated above with occasional discrepancies in inactive (ie garrison or armies moving within it's own territory) armies or those that were in isolated regions (then they had to use militia units to 'fill' it out.) This was much more common then A+ due to the 'specialized' nature of the AI settlements.
    A- : As A with some 'active' armies being inferior but still balanced by use of militia units or mercenaries.
    B+ : Many A quality armies, but several inferior armies, similar to A- but with a larger majority of armies using militia units or with some few 'active' armies that were not balanced out at all.
    B : Almost all armies were 'good' armies, with some 'perfect' armies here or there.
    B- : This is more commonly used for factions that were 'loosing' and only had a few armies, but those they had were 'good' or better.
    C+ : A go to really, if I could not decide on a specific grade but the faction had at least one 'perfect' army.
    C : The AI had all the elements needed for 'perfect' armies, but was unable/unwilling to assemble them into proper armies.
    C- : Basically really bad, but had some of everything it needed to be able to build respectable armies.
    D : Really bad, basically reserved for when the faction built none of a basic unit type (cavalry, infantry, archer) Although most factions had this with one or two personalities only two had this regularly, which I'm fairly sure is a sign that those factions are not balanced cost-effect wise and need some roster work.


    That said here is what I have concluded based on this, rather faulty, test:

    1. Personality has a larger effect then I had thought based on earlier observation without actually 'testing' them. Although the effects are minimal from one personality to another, there is usually one 'wrong' personality where the AI builds useless armies, and one 'right' personality where their armies are notably better then the others.

    2. Using no 'personality' the AI will build whatever and then use whatever to assemble it's forces, which means most armies are assembled from one primary source settlement. Strangely, almost as if the AI was aware of this, it did not specialize settlements to the extent it did with any 'personality' in it. However, since it has no preferences armies are very rarely balanced or assembled in any meaningful way, and recruitment seemed more 'willy-nilly' then any other personality. Even 'cost-effective' factors seemed mostly discarded as this setup recruited much, much more militia units and peasants (which are even less cost effective then militia) then any other personality in my mod, so it was not unlikely to see all militia and/or peasant armies running around. That said, almost all factions had an average-to-above average performance, but no faction had the best performance using no personality.

    3. Using the description given for the personalities is a good starting point, it is my opinion that if the personality that should best fit your faction dose not, it means that roster is not balanced properly. Note here, use the description stand-alone, not to 'fix' a faction. So if your running in 'smith' and you think 'I want more cavalry' switching to 'genghis' is not likely to get the desired results, unless you actually intend for it to be a cavalry heavy army and the roster is balanced for such. A quick example is my 'Denmark' faction, which is balanced for strong infantry and good light cavalry, but poor heavy cavalry and below average archers. On 'smith' they recruited almost no cavalry, switching to 'genghis' they did recruit some low end, but not much, and recruited almost no archers. However on 'napoleon' (biased towards a mix of light and heavy infantry, light cavalry) which has the description of the army it is balanced for and intended to use, they balanced the army out nicely with just a few archers and light cavalry and maybe a unit or two of heavy cavalry. On occasion (6 out of my 17 rosters) the 'best' personality makes no sense. For example, my England faction, which should be 'stalin' (biased towards heavy infantry, mass troops and artillery) actually did best with 'genghis,' a better example would be my Egypt which should be 'smith' or even 'henry' but instead did best on 'mao.' Although that, I'm quite certain, is a sign of a poor balance job on my part.

    4. I believe my earlier thought about the personality having no direct effect on recruitment is, well, not quite right. There is nothing stopping the AI from recruiting outside it's personality, it is just more likely to recruit what is needed to fill out it's armies properly (if using the 'right' personality.) An unbalanced roster will recruit 'wrong' no matter what you do. For example my Sicily and Byzantine factions are downright determined that their heavy infantry are the best units ever no matter what personality I give them. Although there is some merit to my Byzantine faction thinking that, it makes no sense at all (to me) that my Sicily faction would think that any more then any other faction.

    5. Balancing cavalry is a pain in the
    remenber you can also use more than one personality ... faction england, balanced trader religious smith mao henry ...or a mixture of all or any. so thats a lot of different outcomes.

  6. #86

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by GRATO
    remenber you can also use more than one personality ... faction england, balanced trader religious smith mao henry ...or a mixture of all or any. so thats a lot of different outcomes.
    I do intend to work with this some, most notably some of my less balanced factions did better at turn 50 then 100 or vice-verce. Using Spain as an example their 'best' ended up being B B for 'caesar' but they got an A C on 'napoleon' and a C A on 'smith' so I was going to try 'faction spain, balanced napoleon smith' to see if that had different results. My feeling is that anything beyond the first is ignored and therefore meaningless, but if my tests definitively show different I may work with them some more. However, I simply do not have the time (or, TBH, implication) to try every possible combination as B B was the 'worst' any faction had at it's best and that is more then acceptable to me.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Very interesting thanks for sharing your findings.

    4. I believe my earlier thought about the personality having no direct effect on recruitment is, well, not quite right. There is nothing stopping the AI from recruiting outside it's personality, it is just more likely to recruit what is needed to fill out it's armies properly (if using the 'right' personality.) An unbalanced roster will recruit 'wrong' no matter what you do. For example my Sicily and Byzantine factions are downright determined that their heavy infantry are the best units ever no matter what personality I give them. Although there is some merit to my Byzantine faction thinking that, it makes no sense at all (to me) that my Sicily faction would think that any more then any other faction.
    In regards to this have you created equally balanced financial states for each of the factions, as I've seen this happen with high income factions around the sea.
    And one other query what recruitment priorities were you using for the units?

    Something along the lines of this?

    -75 levy tier
    -50 militia tier
    -25 semi professional
    0 for professional
    25 for heavy infantry
    50 for elite infantry
    75 for heavy cavalry/elite cav

    With certain special units above 75 or below -75

    remenber you can also use more than one personality ... faction england, balanced trader religious smith mao henry ...or a mixture of all or any. so thats a lot of different outcomes.
    One thing I wonder is when using multiple personalities whether a) these are sequentially prioritized or b) only the first two are parsed. It'd definitely be an interesting read about your experiences with using more than one personality, what happened when you tried that exactly?
    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. #88

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by z3n
    In regards to this have you created equally balanced financial states for each of the factions, as I've seen this happen with high income factions around the sea.
    And one other query what recruitment priorities were you using for the units?
    I've basically given all factions unlimited money (50k start and 15k kings purse,) sorry I should have included that in my test explanation.

    At this time I am not using recruitment priority at all, just solely using cost-efficiency (and personality) to control recruitment. I am fairly sure I am going to need to add a 'standard' priority to cavalry units and probably to 'multi-purpose' unit's as well, the AI dose not seem to care what the melee capability of a missile unit is, it just considers them more expensive. I find this particularly puzzling because (I'm fairly sure) melee capable missile units are significantly better in auto-calc, or am I wrong and auto-calc dose not use a missile unit's melee stat either?

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by CavalryCmdr View Post
    I've basically given all factions unlimited money (50k start and 15k kings purse,) sorry I should have included that in my test explanation.

    At this time I am not using recruitment priority at all, just solely using cost-efficiency (and personality) to control recruitment. I am fairly sure I am going to need to add a 'standard' priority to cavalry units and probably to 'multi-purpose' unit's as well, the AI dose not seem to care what the melee capability of a missile unit is, it just considers them more expensive. I find this particularly puzzling because (I'm fairly sure) melee capable missile units are significantly better in auto-calc, or am I wrong and auto-calc dose not use a missile unit's melee stat either?
    I am not sure whether you are aware of this in the descr_campaign_db but I recall coming across some information that this was the value which controlled the amount of times a missile unit could attack before entering a melee state in autoresolve separation_missile_add. I did not test it myself so I am not sure whether this is really the case...


    Speaking of tests, I've been experimenting with the descr_pathfinding file in an attempt to figure out the extent that this file controls army and unit behaviour. I am not sure whether you're that interested in the battle side of things but I've been able to get routers to completely stop moving, it's been a rather intriguing series of tests. Not quite ready to share my results yet, though I'll post them here if you are interested later.
    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. #90

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by z3n
    I am not sure whether you are aware of this in the descr_campaign_db but I recall coming across some information that this was the value which controlled the amount of times a missile unit could attack before entering a melee state in autoresolve separation_missile_add. I did not test it myself so I am not sure whether this is really the case...
    <separation_missile_add uint="1.5"/>
    I think 1 is default, I have experimented with this some, and missile units get much more powerful, and quickly, in auto-calc if you increase this number, and if you increase this number the AI will put a higher priority on recruiting missile units. Because the AI dose not seem interested in their melee strength I'm wondering if missile units simply 'sit out' the rest of the battle once they have taken their shots. That dose not make sense to me, and I assume their melee strength would be added to the remainder of the battle, however if that's the case shouldn't the AI be much more interested in missile unit's with high melee attack and defense?

    Speaking of tests, I've been experimenting with the descr_pathfinding file in an attempt to figure out the extent that this file controls army and unit behaviour. I am not sure whether you're that interested in the battle side of things but I've been able to get routers to completely stop moving, it's been a rather intriguing series of tests. Not quite ready to share my results yet, though I'll post them here if you are interested later
    I am certainly interested in battles, I don't post much on it because I am not nearly as knowledgeable about that as many other people, I have much to learn and little to teach.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    <separation_missile_add uint="1.5"/>
    I think 1 is default, I have experimented with this some, and missile units get much more powerful, and quickly, in auto-calc if you increase this number, and if you increase this number the AI will put a higher priority on recruiting missile units. Because the AI dose not seem interested in their melee strength I'm wondering if missile units simply 'sit out' the rest of the battle once they have taken their shots. That dose not make sense to me, and I assume their melee strength would be added to the remainder of the battle, however if that's the case shouldn't the AI be much more interested in missile unit's with high melee attack and defense?
    It probably only looks at the primary stat (stat_pri), rather than anything else.
    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. #92

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Ok, I tested multiple (duel) recruitment personalities. I picked the two personalities with the largest difference between turn 50 and turn 100 score. For example, HRE I used 'stalin' which had a turn 50 of B and a turn 100 of C and 'henry' which had a turn 50 of C and a turn 100 of B. Also, to kind of test the test it's self any faction that did not have proper variance I used a single personality I already had results for.

    Of the factions that only had one personality (there were 5) they all ended with the same average rating for turn 50 and 100, with a possible variance of 1 step (ie C+ B was C B) which, for me, is well within a margin of error for the 'random' factor.

    As for the dual personalities, the results were surprising and somewhat puzzling.
    For the most part they 'averaged' the two, plus 1 step so for HRE in the above example the results were B B, of course this is not the best example, since that is the same as the 'best' of the two personalities, but is also the average of C and B, plus one step. So the end results were notably better then either of the contributing personalities.
    While this sounds good, I will not, personally, use multiple personalities. The reason is a simple but, to me, critical flaw. There were vast amounts of single units running around the entire map. And by 'vast' I would guess probably 10 or so per region, where with a single personality for each faction there was probably closer to 10 total on the entire map. This happened on all three runs with multiple personalities, so it was not a 'freak occurrence.'

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by CavalryCmdr View Post
    Ok, I tested multiple (duel) recruitment personalities. I picked the two personalities with the largest difference between turn 50 and turn 100 score. For example, HRE I used 'stalin' which had a turn 50 of B and a turn 100 of C and 'henry' which had a turn 50 of C and a turn 100 of B. Also, to kind of test the test it's self any faction that did not have proper variance I used a single personality I already had results for.

    Of the factions that only had one personality (there were 5) they all ended with the same average rating for turn 50 and 100, with a possible variance of 1 step (ie C+ B was C B) which, for me, is well within a margin of error for the 'random' factor.

    As for the dual personalities, the results were surprising and somewhat puzzling.
    For the most part they 'averaged' the two, plus 1 step so for HRE in the above example the results were B B, of course this is not the best example, since that is the same as the 'best' of the two personalities, but is also the average of C and B, plus one step. So the end results were notably better then either of the contributing personalities.
    While this sounds good, I will not, personally, use multiple personalities. The reason is a simple but, to me, critical flaw. There were vast amounts of single units running around the entire map. And by 'vast' I would guess probably 10 or so per region, where with a single personality for each faction there was probably closer to 10 total on the entire map. This happened on all three runs with multiple personalities, so it was not a 'freak occurrence.'
    Very interesting it sounds as if it directly or indirectly affects the LTGD as well in regards to unit and army distribution. It makes me wonder whether the real reason certain factions get certain personalities in RTW is due to home region location rather than anything else.
    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)

  14. #94

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Any suggestions on how to test build personalities?

  15. #95
    GRANTO's Avatar Domesticus
    Join Date
    Dec 2010
    Location
    glastonbury uk
    Posts
    2,207

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by CavalryCmdr View Post
    Ok, I tested multiple (duel) recruitment personalities. I picked the two personalities with the largest difference between turn 50 and turn 100 score. For example, HRE I used 'stalin' which had a turn 50 of B and a turn 100 of C and 'henry' which had a turn 50 of C and a turn 100 of B. Also, to kind of test the test it's self any faction that did not have proper variance I used a single personality I already had results for.

    Of the factions that only had one personality (there were 5) they all ended with the same average rating for turn 50 and 100, with a possible variance of 1 step (ie C+ B was C B) which, for me, is well within a margin of error for the 'random' factor.

    As for the dual personalities, the results were surprising and somewhat puzzling.
    For the most part they 'averaged' the two, plus 1 step so for HRE in the above example the results were B B, of course this is not the best example, since that is the same as the 'best' of the two personalities, but is also the average of C and B, plus one step. So the end results were notably better then either of the contributing personalities.
    While this sounds good, I will not, personally, use multiple personalities. The reason is a simple but, to me, critical flaw. There were vast amounts of single units running around the entire map. And by 'vast' I would guess probably 10 or so per region, where with a single personality for each faction there was probably closer to 10 total on the entire map. This happened on all three runs with multiple personalities, so it was not a 'freak occurrence.'
    iv played around with multiple personalities for hundreds and thousands of hours and have not really seen what you speak about , were the single stacks just standing around doing nothing or were they being distibuted to reinforce armys at war?.

  16. #96

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by GRANTO
    iv played around with multiple personalities for hundreds and thousands of hours and have not really seen what you speak about , were the single stacks just standing around doing nothing or were they being distibuted to reinforce armys at war?
    TBH, it would not surprise me if the cause is the specialized nature the AI is giving the towns, coupled with shuffling them around to assemble armies. At some point in the future I may try again with adjusting the build times properly. Also, the virtually unlimited money could be a contributing factor. It's strange that I have this problem only with multiple personalities, I would guess it's less decisive what to do with the units in question, but I really have no idea, and currently do not have the drive to find out as single personalities works just fine for me.
    I'm not sure what the units were doing, I would assume they were being moved to build/reinforce armies, however the reason is really irrelevant with that number of them. With a single personality the AI moves units around as well, but almost never single units, it's usually 3 to 6 if they are just maneuvering to build/reinforce armies. Just a single unit is just silly.
    Last edited by CavalryCmdr; March 06, 2016 at 03:53 AM.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by CavalryCmdr View Post
    Any suggestions on how to test build personalities?
    Maybe Granto has some ideas but I'm no help here unfortunately.
    I just go with the standard smith, balanced from vanilla.
    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)

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    @CavalryCmdr
    Have you ever tried ordering invade_raids against a non neighbour faction to see what happens with naval invasions?
    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)

  19. #99

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    Quote Originally Posted by z3n
    Have you ever tried ordering invade_raids against a non neighbour faction to see what happens with naval invasions?
    Works pretty much the same as against neighbor, blockade and land small (3-6 unit) armies that's about it. The best way I've found for naval invasions is to increase invade_priority for non neighbor factions with invade_immediate. This would be against your natural implication to lower invade priority for non neighbor because you don't want them to neglect the nearby threats, however the LTGD automatically lowers invade_priority by distance. I've found (for my settings, not sure how universal it would be) that 500 offsets the distance modifier quite well (I started at 1000, but the AI ended up prefering to attack non neighbours too much, even while at war with a neighbouring faction) and allows for naval invasion with the same intent as other invasions. In one of my test runs recently Spain landed 3 full stack armies in England in one turn

    That was turn 50, Spain was allied with France who was obviously at war with England and the Moors had been eliminated by Portugal, who was also their ally, so they were not at war with anyone else at the time. By turn 100 England was eliminated and Spain had 3 (out of 4) regions in Ireland (Scotland had the other) as well as 2 regions, including London, on Britain, the rest was Scotland with Denmark holding Nottingham. At the time Spain invaded, Scotland was down to just 2 regions and had their capital under siege by an English army.

    Probably a longer response then you were looking for, but it was a good run, almost as good was when Egypt invaded Byzantium by way of Athens, which in turn allowed the Turks to take Constantinople by turn 100. In that one, Byzantium had almost all of Anatolia in the east and had everything to and including Venice in the west by turn 50. Both these happened this past week while I was running the 100 turn personality tests.

  20. #100
    beermugcarl's Avatar Decanus
    Join Date
    Mar 2011
    Location
    Aberdeen
    Posts
    581

    Default Re: Understanding MTW2/Kingdoms.exe Pathfinding, XML and the AI

    do you think it is possible to have some kind of script fired ai switcher?

    I just mean that as far as consolidation after wars (and when to consolidate) and how to fight the human/other ai players goes i want one thing, but when it comes to early expansion and rebel settlements i want another thing entirely.

Posting Permissions

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