Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 58

Thread: Strange AI behavior, not working.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    OK - I think the thing happening with the climate is to do with what would have been there (either in terms of hills or trees etc) underneath the position where the settlement is... so it would also depend on ground_types and strat map heights

    am going to have a look at those battles without settlement and see if I can spot anything...

  2. #2
    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.

    here is the stratmap and the custom batle versions, already edited and in the right folders so it will be easier for you to test.

    there is also the descr_geography.db file for fixing the climate thing.

    https://mega.co.nz/#!wsVTibBC!epJq3U...QDQX5eEhU50DTw

  3. #3
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    hmmm... tried changing ground types around Anduin and that didn't help...

    I've got a horrible feeling the difference might be 'river' versus 'sea' Anfalas is on a map_features.tga generated river
    Anduin CB and Esgaroth in the campaign are on map_heights.tga 'sea' which is shaped like a wide river

    sea and river do behave a bit differently for some things (loading reflective planes) and I think the Anfalas version is treating the bridge to the settlement like a Ford point or Bridge Crossing, the ai attackers are forming that sort of proper attack column before they try and cross the bridge... whereas on Anfalas they're not

    need to try some other locations to see if the theory holds out - not quite sure what to do if it is that though!

  4. #4
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    Thanks - I get the same "It does not work in ANDUIN but works perfectly in ANFALAS. " result now... will see if I can find any single factor that's doing it...

  5. #5
    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
    Thanks - I get the same "It does not work in ANDUIN but works perfectly in ANFALAS. " result now... will see if I can find any single factor that's doing it...
    u are my hero mak.

  6. #6
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    wasn't that... found some sea side ones that worked and some river ones that don't...

    flattened map heights to RGB 10,10,10 - and some of the custom battle sites that didn't work (including site of Esgaroth) now work... but not all of them
    aaaaargh!


    EDIT; bad testing - was confused by the dodgy maps working occasionally (with weak defending army)

  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.

    hmmmmm am now getting completely different results trying to test same things again

    not sure now how many things were real results or just co-incidence that it randomly works OK say one time in eight!

    need to try testing exact same battle about 12 times plus in a row

  8. #8
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Strange AI behavior, not working.

    hmmmm... have done about 8xAnduin battle and 8xAnfalas and a few others - Test is ai attacking with 12 units 2x ladders and rams - stand defending army on plaza and see if the AI can find it!

    - seems like Anfalas always works

    - Anduin and other dodgy ones, sometimes work to an extent, if the number of defending units is low enough (2 versus the 12 attacking) then some of the attacking units will actually get to the plaza and fight, but they're still be some stuck units, and some going backwards and forwards over the access bridge. The part where some were attacking was probably what was confusing me before when I thought the heights change had fixed things - will try that again... It also implies it's doing something to the strength calculation, for the decision to attack, and not just a 'straightforward' pathfinding thing.


    have noticed there is a distinct difference in the attackers deployment area on Anfalas versus the non-working ones;

    Anfalas; shows deployment like a normaly looking go half way round the settlement U shape, even though some of that area is under water;

    Click image for larger version. 

Name:	anfalas deploy.jpg 
Views:	14 
Size:	73.0 KB 
ID:	299861

    Non working ones, have a much more limited deployment area, and can't actually deploy onto some of the bits that are still land;

    Click image for larger version. 

Name:	anduin deploy.jpg 
Views:	11 
Size:	56.7 KB 
ID:	299862

    Click image for larger version. 

Name:	site of esgaroth.jpg 
Views:	11 
Size:	80.1 KB 
ID:	299863

  9. #9
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Strange AI behavior, not working.

    The AI tries to form up at a set distance from the plaza.

    Code:
            <attack-settlement>
                <detachment>
                	<engine-collection>
                		<!-- when stealing an engine, prioritise being out of combat over distance -->
                		<prioritise-out-of-combat>1</prioritise-out-of-combat>
                	</engine-collection>
                	<commit>
                		<!-- commit sufficient forces to outnumber the enemy by this ratio -->
                		<strength-ratio>1.6</strength-ratio>
                	</commit>
                	<perimeter-attack>
                		<termination-criteria>
                			<enemy-in-perimeter>0.25</enemy-in-perimeter>
                		</termination-criteria>
                	</perimeter-attack>
                    <max-plaza-assault-groups>5</max-plaza-assault-groups>
                    <units-per-plaza-assault-group>4</units-per-plaza-assault-group>
                    <artillery-times>
                    	<!-- successful assaults performed for at least 1 minute -->
                    	<minimum>1.0</minimum>
                    	
                    	<!-- don't prolong the bombardment longer than 6 minutes if we have no targets left -->
                    	<maximum>6.0</maximum>
                    	
                    	<!-- stall test is a moving average that checks if any artillery is active (moving/firing/reloading) each tick -->
                    	<stall-test>
                    		<!-- minimum number of ticks to collect before detecting a stall -->
                    		<minimum-samples>900</minimum-samples>
                    		
                    		<!-- track at most this number of samples -->
                    		<maximum-samples>1200</maximum-samples>
                    		
    	                	<!-- if the artillery has be inactive for at least 75% of its time -->
                    		<limit>0.5</limit>
                    	</stall-test>
                    </artillery-times>
                </detachment>
                <tactics>
                    <assault-gate>
                        <inside-position-dist>25</inside-position-dist>
                        <formation>ai_settlement_assault_gate</formation>
                    </assault-gate>
                    <reform>
                        <offset>30</offset>
                        <formation>ai_settlement_attack_reform</formation>
                        <percentage-formed>10</percentage-formed>
                        <advance-timer>1.0</advance-timer>
                        <siege-equipment-advance-timer>6.0</siege-equipment-advance-timer>
                    </reform>
                    <capture-plaza>
                        <reform-dist>120</reform-dist>
                    </capture-plaza>
                </tactics>
            </attack-settlement>
    It could perhaps be something like the reform maneuver being impossible due to the custom settlement's shape combined with the reform distance.
    Last edited by Taiji; January 10, 2014 at 12:33 PM.

  10. #10
    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 Taiji View Post

    It could perhaps be something like the reform maneuver being impossible due to the custom settlement's shape combined with the reform distance.
    Yeah, but, the bit we're trying to figure out is why same settlement on different map (in same climate) acts differently. At the point when the attackers are inside the perimeter, then the whole terrain and pathfinding from there to the plaza should be totally controlled by the settlement mechanics.

    Anyway thanks, will try playing with the reform distance and see if it changes anything...

    any idea where the attack odds bit for a plaza attack is calculated - as that seems to be the variable on the dodgy ones sometimes working and sometimes not

  11. #11
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Strange AI behavior, not working.

    I think the closest we get is in the 'reform' section, where you can specify the % formed and the timer. When they reform to the %, the timer activates. Not sure if the siege engine timer is in addition to or replaces the standard timer, but it's for giving the AI some extra time to move siege engines up in prep for the next assault. Then when the timer finishes counting down they should start attacking in groups defined in the 'attachment' section.

    Basically they don't decide whether or not to attack, at any point during an assault, just when(afaik).

    It seems to me that the behaviour described is probably impossible to reproduce by modifying the config_ai_battle.xml, so I'd be looking for something missing from the settlement's files.

    Successes with map heights adjustments are weird... I know the campaign map strongly affects the battle map, but I agree the settlement files should overwrite everything within the bounding box for the settlement. At least it really looks that way to me too, and I can't think why it wouldn't be that way... So perhaps I'd be trying to break another map by adding features of the buggy one, don't know how easy that would be though.

  12. #12
    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 Taiji View Post
    Successes with map heights adjustments are weird... I know the campaign map strongly affects the battle map, but I agree the settlement files should overwrite everything within the bounding box for the settlement. At least it really looks that way to me too, and I can't think why it wouldn't be that way... So perhaps I'd be trying to break another map by adding features of the buggy one, don't know how easy that would be though.
    I think I was wrong about the heights - I hadn't realised at the time that the dodgy maps work occasionally if the defence force is very weak... and think I was just seeing that


    Quote Originally Posted by leo.civil.uefs View Post
    erhm...

    I reached the point where I really need to understand what is happening, I've checked it and I can confirm that custom settlements are not working in campaign map, as they were made and then tested in custom battles.

    Its about understanding exactly the entire thing now or giving up.
    am coming back to thinking it must be something to do with the water...

    are you having problems with any settlements in campaign that aren't on, or near, a river or sea?

  13. #13
    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
    I think I was wrong about the heights - I hadn't realised at the time that the dodgy maps work occasionally if the defence force is very weak... and think I was just seeing that



    am coming back to thinking it must be something to do with the water...

    are you having problems with any settlements in campaign that aren't on, or near, a river or sea?
    Minas tirith, far from any water. My version with 2 gates worked pretty fine as you can see on my tutorial, but not in the campaign map.

  14. #14
    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
    Minas tirith, far from any water. My version with 2 gates worked pretty fine as you can see on my tutorial, but not in the campaign map.
    do you have a recommendation for getting ai to attack Minas tirith on campaign? (I assume the attack is the problem again) Save file might help if it's solely a settlement problem, but not sure that's reliable if it needs map change.

    *****************************************************************

    RE: ESGAROTH - i.e. getting the Esgaroth as SE large_city working at Esgaroth custom battle location I added (288,258), it is sort of the heights, and also the water... having finally sorted the testing a bit better


    changing the map_heights.tga height for a location does affect 2 things about the settlement

    A. the battle-map ground-types - these aren't the same as the campaign ground types, they include the long-grass and shrub-sparse etc, and change the textures used, and the amount of rocks/trees etc, except where over-ruled by the .worldvegetation file. They're generated from the geog.db and are a product of the various tables combined with the absolute (above sea level) height of the map, and slopes. ----------------- that's for info only I don't think it's got anything to do with the problem.

    B. if the battle-map location contains both land area (which is changed by varying the height) and sea (which isn't) then the angle of slope from land to sea will also be changed and if it's trying to stick a settlement at the average point, then that settlement will end up at a different height above 'sea level'... which is the bit I missed before when discounting it


    Pic's are using Wilddogs testing textures which show the geog ground-type names;

    custom battle for me at 288,258 with Esgaroth doesn't work for ai attack, it looks like this with water near ground level;

    Click image for larger version. 

Name:	esgaroth normal.jpg 
Views:	13 
Size:	75.6 KB 
ID:	300001

    if I change map_heights.tga so all land is MUCH higher, i.e. 40,40,40 RGB then I get this

    Click image for larger version. 

Name:	esgaroth at 404040.jpg 
Views:	13 
Size:	80.0 KB 
ID:	300002

    so settlement is now far above water level - ai seems to work even for larger defensive forces...
    guessing that the distance above water level is the problem - I've tried doing vector change in IWTE on the settlement and terrain at +60 and reverting to original map heights (at +30, ai didn't work)

    Click image for larger version. 

Name:	esgaroth vector60up.jpg 
Views:	14 
Size:	84.2 KB 
ID:	300003

    that's not actually that useful, as it looks stupid up there, but Leo, I noticed your working version video in your tutorial also has water a long way below the settlement... can't prove things out with the campaign save you sent as it seems to load strangely (no water at all) probably because I've changed some stuff that's not now compatible with the saved campaign

  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.

    erhm...

    I reached the point where I really need to understand what is happening, I've checked it and I can confirm that custom settlements are not working in campaign map, as they were made and then tested in custom battles.

    Its about understanding exactly the entire thing now or giving up.

  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.

    mak... do you think there is any chance of this having to do with the complexes on the settlement and how they are set?

  17. #17
    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
    mak... do you think there is any chance of this having to do with the complexes on the settlement and how they are set?
    I don't think so, as far as I know having multiple complexes in the correct positions just helps the graphics (as they have separate smaller bounding spheres, so things should theoretically be more efficient... i.e. less lag) It also helps the effects, as only the effects in or near a complex are applied to it.

    Doubt it would do anything to pathfinding / AI, but then again we don't know yet what is messing it up! As far as I know AI only pays attention to the named things (walls, gates, towers) and the objects assigned to perimeters. Other 'decorative' objects shouldn't have any influence...

  18. #18
    paradamed's Avatar Praepositus
    Join Date
    Jun 2006
    Location
    Brasília, Brasil
    Posts
    5,806

    Default Re: Strange AI behavior, not working.

    Leo, did you try deleting G5 entire ai script? I noticed passive ai in vanilla settlements too. AI attacked me in a small village with no walls and instead of attacking me they created a defensive formation outside the city and sitted on their arses. I think it has something to do with G5ai.

  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 paradamed View Post
    Leo, did you try deleting G5 entire ai script? I noticed passive ai in vanilla settlements too. AI attacked me in a small village with no walls and instead of attacking me they created a defensive formation outside the city and sitted on their arses. I think it has something to do with G5ai.
    Yes I tried.

  20. #20

    Default Re: Strange AI behavior, not working.

    yes maybe it is the battle ai as i think in custom battles their is not the G5 ai used(used only in campaign battles?) but the vanilla?
    maybe only try the text files of G5 battle ai without the script codes,you never known . as if in rw2tw the too much codes for the ai made the battle ai go crazy lol.

Page 2 of 3 FirstFirst 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
  •