Page 1 of 3 123 LastLast
Results 1 to 20 of 58

Thread: Strange AI behavior, not working.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Strange AI behavior, not working.

    Vanilla med2 teutonic castles, implemented in a mod, work very well in custom battles when AI attacks it, they know exactly what to do and pathfinding seems perfect. However, the AI cannot handle it in campaign battles while attacking, they break the walls/gates until the last perimeter (third gate) but then dont know how to assault the plaza, with the majority of their army just standing outside of the settlement.

    So, does anyone know if there is a file that controls different AI behavior for custom and campaign battles?




    Also, another strange bug wich is also happening. In these castles, the ram/ladder crews are acting abnormally. They can drive the ladder or the rams to the wall/gate but when they reach it, some men from the unit starts runnign arround the ram/ladder like idiots, hitting each other. After some time they get back in position on the group and then the ram/ladder crew can use the engine to do its job.

    As in the prvious described probelm, its also ok for custom battles but bugs like this for campaign ones.



    I've tried lots of things like changing these files back to vanilla med2:

    battle_cnfig.xml
    config_ai_battle.xml
    descr_formations.txt
    descr_formations_ai.txt
    descr_geography_new.db
    descr_geography_new.txt
    descr_pathfinding.db
    descr_pathfinding.txt



    I once though I got to fix the bad ram/ladder behvior by changing back to vanilla the

    battle_cnfig.xml
    config_ai_battle.xml
    descr_pathfinding.db
    descr_pathfinding.txt

    files, but then the problem came back, or it was just me who got fooled, though I really belive I got some fix at this trying...

    By the way, the teutonic castles work very well in camapaign when you're playing the teutonic expansion.
    Last edited by leo.civil.uefs; December 31, 2013 at 05:02 PM.

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

    Default Re: Strange AI behavior, not working.

    Is campaign_script.txt battle script used by custom battles? I don't know. If not then that might explain it in a mod such as TATW.

  3. #3
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by Withwnar View Post
    Is campaign_script.txt battle script used by custom battles? I don't know. If not then that might explain it in a mod such as TATW.

    could you please be mroe specific? whgat are you talking about? the RBAI script inside campaign_script.txt or what?

    Im quite sure this is fixable as these settlements works well in teutonic campaign map, but not in tatw. All I need to know is wich file is causing the different behavior.
    Last edited by leo.civil.uefs; January 01, 2014 at 11:48 AM.

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

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by leo.civil.uefs View Post
    could you please be mroe specific? whgat are you talking about? the RBAI script inside campaign_script.txt or what?
    If we're talking TATW - OP didn't say - then yes: RBAI in campaign script. TATW also has an RBAI advisor script in scripts\show_me. I don't know if it's used at all - maybe it's for custom battles.

  5. #5
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by Withwnar View Post
    If we're talking TATW - OP didn't say - then yes: RBAI in campaign script. TATW also has an RBAI advisor script in scripts\show_me. I don't know if it's used at all - maybe it's for custom battles.
    this is interesting

    when you do launch a custom battle the advisor (using RBAI) pops up when you start that battle

    but afaik it doesn't do that while playing the campaign, so maybe script in campaign_script that force launches RBAI
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  6. #6
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by Kiliç Alì View Post
    I'm not deep into the matter of what happens in battles but maybe a detailed log analysis could help?


    EDIT

    BTW, you said you reversed the files from vanilla med2. Why not from teutonic expansion directly? or did I get it wrong?
    I did it. The only file inside to match the RBAI ones inside the teutonic folder is battle_config.xml.

    Quote Originally Posted by Swagger View Post
    this is interesting

    when you do launch a custom battle the advisor (using RBAI) pops up when you start that battle

    but afaik it doesn't do that while playing the campaign, so maybe script in campaign_script that force launches RBAI
    I tried deleting everything in the campaign_script.txt and stills the same bug.

  7. #7
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    to rule out the scipty stuff replace the imperial_campaign/campaign_script.txt with
    script

    restrict_strat_radar false

    end_script
    type thing, and delete the data/scripts folder, that should get you back to those being like vanilla

  8. #8
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    Did it all and deleted map.rwm
    Still the same bug.


    Ive deleted everything in campaign_script.txt and replaced with the code you quoted.

    No deal.

  9. #9
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    The same happens to vanilla med2 large castles, and citadels. they work well in custom battles but not in the campaign as the units dont know to assault the settlement and get stuck doing idiotic things.

  10. #10
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Strange AI behavior, not working.

    I'm not deep into the matter of what happens in battles but maybe a detailed log analysis could help?


    EDIT

    BTW, you said you reversed the files from vanilla med2. Why not from teutonic expansion directly? or did I get it wrong?
    Last edited by Kiliç Alì; January 02, 2014 at 05:48 AM.

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  11. #11
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    I found the first problem.

    Dol Amroth works well, and it has a diffreent climate from Cair Andros, so I've set the Cair Andros climate the same from Dol Amroth and now it also works well...


    Now its just about wich bit of the climate config is causing the problem.

    for the second problem (ram/ladder crews acting like idiots) It also DOES NOT happen in dol amroth, but is still happening in cair andros even after I changed the climate to match the dol amroth one. Ive tried making the ground types tga the same as dol amroth but no results.
    Last edited by leo.civil.uefs; January 02, 2014 at 10:21 PM.

  12. #12
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    ok, after several tests I can say with 101% of surety that the cause of the problem is the bit called SGT_To_G_Hardness from the desc_geography_new.db file, wich can easly be edited via IWTE (actually IWTE is overpowered in this matter, it can simply copy entire bits of configuration from one climate to another, and thats why testing this was so simple to me).

    I simply copied this bit from the mediterran climate (where Dol Amroth is) and used it to replace the same bit in the temperate_decidious_forest (wich is the one where Cair Andros is).

    No other parameter available in the Copy Functions in IWTE has presented any improvement on the AI behavior when I copied it from the mediterran climate, so as I said, 101%.

    Now the point is, even in vanilla med2, each climate has its own SGT_To_G_Hardness, so, what really means those values? What happens if I just make it the same for all the climates? By doing this I would be ensuring proper AI behavior on settlements for all climates or what?

  13. #13
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by leo.civil.uefs View Post
    Now the point is, even in vanilla med2, each climate has its own SGT_To_G_Hardness, so, what really means those values? What happens if I just make it the same for all the climates? By doing this I would be ensuring proper AI behavior on settlements for all climates or what?
    That's quite odd - it does imply there's a "bleed-through" from the underlying terrain that would be there without the settlement. As the settlement terrain and vegetation should over-rule that stuff!

    The bits of that table that I'd suspect are the values in the columns starting with 'h' (for height)
    hs fade_in, hs median, hs fade-out, hn bias, and hn std dev.

    You could try changing just them - you'd need to do that manually - open a copy of the working climate in one version of IWTE to view the figures, launch IWTE a second time and go to the climate you want to change and alter those figures to match.

    If you're using IWTE to change the geography.db you need to make sure you've got rid of the .txt file and aren't using the rebuild_geography line in .cfg.


    Out of interest have you tried switching back to vanilla descr_geography_new.db? EDIT: NVM saw you did that in first post.....


    If you copy that table over all the other climates you'll lose a lot of the variety between climates, like deserts being smoother and flatter etc. The textures used wouldn't change but their distribution would, so things would end up looking quite different.

  14. #14
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    Ok mak thank you.


    By the way.


    The teutonic expansion has not a descr_geography_new.db of its own, wich means it uses the vanilla med2 one.


    The map_climates.tga in the teutonic campaign is almost totally ruled by temperate_coniferous_forest, and as I tested by myself the teutonic castles work well in that expansion pack.


    I tried setting cair andros to that climate and it also worked well, so now everything is clear. It also means that mediterran is not the only climate who works well for that matter.
    So i think I will test all the climates in cair andros, and then change only the ones that does not work. Hopefully, temperate_decidious_forest is the only bugged one so I can fix it without no harm to TATW enviroment as it is now.


    Also, Im very inclined to belive that this is also the cause of all pahtfinding issues with the vanilla med2 northern/southern large castles and citadels. Wich means we might have found a MAJOR med2 engine bug, and the best part is that now we can fix it easly.

    The impportance of this thread to the community is growing tremendously.

  15. #15
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    I've found out that every value in the vanilla med2 SGT_To_G_Hardness mediterran climate are exactly the same from the RBAI ones, however, the vanilla one works for the AI and the RBAI one does not, wich means IWTE is missing something.Anyway My option now is abandon the RBAI one, use the TATW one (wich has a mediterran climate working well) and copy that mediterran values into the other climtaes wich are not working.

  16. #16
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    So, my final solution for TATW.

    I found out that almost all climates were bugged in RBAI lastest version, while in TATW 3.2 only the temperate_deciduous_forest one was. So I've fixed the TATW one just by replacing the quoted values with the ones from mediterran climate, and yet Im going to implement the new version of RBAI in my sub-mod, but not including the descr_geography_new.db as the TATW 3.2 one will be kept.

    By he way, this fix does not fixes the vanilla southern european citadel.

    there is still the bug with the ladder/ram crews, it does not happen in dol amroth, but changing the climate of cair andros to the same as dol amroth does not fix it, so It does not seem to have any thing with descr_geography_new.db, I also tried changing the ground type map to match the same as dol amroth but still no deal. Anyway is that the point is, such bug does not happen in dol amroth, this is the path...
    Last edited by leo.civil.uefs; January 03, 2014 at 02:48 PM.

  17. #17
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    THE MISTERY GOES ON...

    esgaroth does not work well when I chnage the plaza position. The plaza is in half the way of the settlement right now, King Kong did it arguing that it was not working well if placed like I firstly did... however... as you can see on the video on my tutorial it works absolutelly perfect with the plaza far away from the place that it is now in TATW.

    The point is, it does not work well in campaign map aaaaaaaaaaaand... it only works depending on what map I choose on the custom battle menu. It does not work in ANDUIN but works perfectly in ANFALAS.

    The mistery is, its seems that it has nothing to do with the previous solution oif this thread, because both quoted maps HAVE THE SAME CLIMATE! So there ius still something... something influencing the AI behavior...

    Any guess?

  18. #18
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    erm, Anfalas doesn't seem to be in Anfalas... the co-ordinate points show that as being here;
    Click image for larger version. 

Name:	anfalas-groundtypes.jpg 
Views:	15 
Size:	14.3 KB 
ID:	299755

    whereas Anduin is here
    Click image for larger version. 

Name:	anduin.jpg 
Views:	16 
Size:	24.6 KB 
ID:	299756
    looks like it's on wilderness ground type with water types around it...
    (that's using "toggle_terrain tiletype" to show the groundtypes)

    and looking at the battlemaps, Anduin has more slope, an area of dense trees and is closer to the water... so could be any of those things


    Trying to test Esgaroth with the version I've got (TATW and your released patch) on those, neither works particularly well (ai doesn't attack plaza unless you lead them in) I'm guessing I still have the original problems due to climate and the BAI script.

    Could you post the changed files to fix that?

  19. #19
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,119

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by makanyane View Post
    erm, Anfalas doesn't seem to be in Anfalas... the co-ordinate points show that as being here;
    Click image for larger version. 

Name:	anfalas-groundtypes.jpg 
Views:	15 
Size:	14.3 KB 
ID:	299755

    whereas Anduin is here
    Click image for larger version. 

Name:	anduin.jpg 
Views:	16 
Size:	24.6 KB 
ID:	299756
    looks like it's on wilderness ground type with water types around it...
    (that's using "toggle_terrain tiletype" to show the groundtypes)
    Im talking abouit climates, not ground types. Gues it is different, right?





    ehrm... I dont get what you mean... look the BOLD that follows, is that what you mean?

    Quote Originally Posted by makanyane View Post
    flattened map heights to RGB 10,10,10 - and some of the custom battle sites that didn't work (including FOR Esgaroth) now work... but not all of them
    aaaaargh!
    I mean, esgaroth has no "site, you can choose anyone, just that I got confused here. Confirm my correction is ok please so I can be sue about what you're talking about.

  20. #20
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    Quote Originally Posted by leo.civil.uefs View Post
    Im talking abouit climates, not ground types. Gues it is different, right?
    yeah as the sites are all in the same climate it must be something else making the difference - I'm trying to find the "something else"

    I mean, esgaroth has no "site, you can choose anyone, just that I got confused here. Confirm my correction is ok please so I can be sue about what you're talking about.
    I've been adding stuff to custom_locations.txt to check in more places

    Code:
    custom_location		sea-river site of esgaroth
    {
    	location		288	258
    	image			data/menu/battlefield_pics/anduin.tga
    	sett_locked		no
    	climate			temperate_deciduous_forest
    	summer			no
    }
    
    custom_location		real river above Lond Galen 
    {
    	location		144	110
    	image			data/menu/battlefield_pics/anduin.tga
    	sett_locked		no
    	climate			temperate_deciduous_forest
    	summer			no
    }
    288,258 is where the strat map city of Esgaroth is... if you fight custom battle there with large_city added you should get similar terrain to the campaign map battle

    the 144 110 location is one that still doesn't work after changing the heights and ground types - am about to try with only temp_dec_forest climate on whole map to see if its anything at the edges influencing stuff - if there's still a difference after that, then it can only be down to relationship to the water/river position (I think)

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

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