Results 1 to 30 of 121

Thread: Game AI stuff (1.5)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Re: Game AI stuff (1.5)

    Good stuff!

    Months ago I also looked at the strategic AI and particularly at how it didn't merge its armies. I found that a small amount of movement points was bad as it meant that an army could not reach its target friendly army. Increasing the movement points greatly reduced the amount of armies as the AI armies could reach each other within a single turn. I would advise to give AI character a standard increase in MP by the use traits.

    There is also the problem of armies not merging when the total of 2 armies is greater than 20. So complete stacks are rare.

    All of this was tested on 1.2 so things might have changed.

    nikolai,
    have you tested wether lots of movement points (MP) decreases pathfinding problems? If so you might want to test giving AI characters a movement bonus trait when they have not used any MP for a few turns and are not in a settlement; they are stuck. The sudden increase in MP might open a different path.

  2. #2
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Game AI stuff (1.5)

    Hi again.

    Fortunately we are working in complementary aspects of the AI, so I think we will advance faster sharing our experiences.

    This post is to illustrate the findings reported before.

    1- Behavior of a superfaction (different from the senate)

    In this experiment, julii were superfaction of other factions, such as greek_cities and this is the result.


    I had never seen so large concentration of armies, and julii were unable to attack the gauls on the north. Their only expansion was Liguria, that started as rebel region.

    In the next experiments we changed the system, and dacia (cisalpine gauls) were the superfaction of julii. In this way the romans have no room for expansion by land, and they are more prone to sail.

    2- The need for a strong motivation

    As I said before, the presence of a roman fort with a full stack army was completely useless to attract the romans to Iberia.
    But we tried to make the same giving the romans a single settlement in Iberia.
    In that case, romans are able to send troops by sea.


    Then, the romans begin a war against the surrounding faction (illergetes), which is at the same time the creator and the culture tag of that region.
    This is complemented with expeditions by land, as some roman army was able to cross the gauls territory, including the Alps, without attacking or being attacked, just to arrive to Iberia to fight against the illergetes.

    3- The expansion

    Once that faction has disappeared, romans turn south, to the zone controlled by carthaginians (probably due to path finding questions), and they meet in Saguntum (as it happened historically).


    However, the expansion of turdetani (white) was too far, in comparison with the historical behavior. They are included as allies of the carthaginians, and limit their expansion to the coast (which is also correct).

    In the last experiment (for the moment), the turdetani were considered as the superfactions of carthaginians. The starting position served as shield against lusitanians, and at the same time drove the carthaginian expansion to the coast.
    The result was nearly the same, but with the limitation in the turdetani expansion.


    In some days, I will post the new experiments with superfactions, alliances and "motivations".

    @Duke John
    In those experiments MP are 95, but they are increased by large amounts for admirals, spies, diplomats and generals through traits.
    I knew some days ago that the limit of 100 is no more working in RTW 1.5, and I will try with higher MP also for captains, just to see if there is any difference.

    Cheers.

  3. #3

    Default Re: Game AI stuff (1.5)

    Impresive Work ! nikolai1962

    I think you need an award for all your help given here on these forums

    Can you upload that mod please ? I like it alot !! especially the removing of the britons from the mainland...and Sahara as a single region

    Again.NICE WORK

    p.s. What are the Thracians doing in the Alps mate ? But I'm guessing that Is just a temporary "training" map
    Last edited by Coldfish; 04-21-2006 at 16:16.

  4. #4

    Default Re: Game AI stuff (1.5)

    Quote Originally Posted by Coldfish
    Impresive Work ! nikolai1962

    I think you need an award for all your help given here on these forums

    Can you upload that mod please ? I like it alot !! especially the removing of the britons from the mainland...and Sahara as a single region

    Again.NICE WORK

    p.s. What are the Thracians doing in the Alps mate ? But I'm guessing that Is just a temporary "training" map
    Ty. The map files are in a permanent state of experimenting at the moment but if i ever get all the pathing right i'll probably upload for sure :)

    Lol, the thracians are being the arverni as i was originally trying out variations for extending the government idea in EB so i'd started to make the factions match the EB ones. As i was testing with FOW off instead of playing i started to notice all this weird AI stuff.

    Deep breath, long post coming up.
    It's not a map.

  5. #5

    Default Re: Game AI stuff (1.5)

    I see..well thanks! I can't wait

  6. #6

    Default Re: Game AI stuff (1.5)

    After getting the idea of a stripped down strat file to test path-finding i had to try it out on the vanilla map.

    Made a provincial campaign.
    Removed senate, scipii, brutii and numidia (as i was going to look at carthage path-finding first).
    Gave each faction their original capital as their only settlement, same size, buildings etc.
    Starting leader with thier cavalry as only army.
    Brigands and pirates set to 99.
    10 happiness bonus on governor buildings to stop distractions caused by rebellions.
    Resources, landmarks, diplomatic attitudes etc all gone.

    Might be a better way to set this up to test the path-finding but the above was what i tried this time.

    Only changes i made to the base map at first were extending sahara to the west and moving the briton port as i'd sort of tested them before.

    The result was this.



    Running it for just a few turns you start to see some places that probably have problems straight away.



    The AI likes to go for the closest adjacent land target (modified by garrison, owner etc) which should have meant Chersonesus, Bordesholm and one of the two near the armenian capital would have gone pretty quick but they didn't. This was a consistent thing when i ran the first few turns a few times. The armenians always went south to hatra. The germans never found their way to bordesholm from south or west, only from the east. Chersonesus is generally messed up from all directions.



    I'll go back to them another time as this was mostly about carthage.

    The carthage AI starts fine, build a small army, sends it to nearest target (Thapsus), takes it. That army leaves a garrison behind and heads for next nearest (not neccessarily nearest to thapsus). Depending on how i'd changed the map over the course of this testing it either went to lepcis or Cirta. Meanwhile carthage has build a second army that goes to whichever of lepcis or cirta hasn't been targeted by the first. After those first 4 are taken it all goes wrong.

    The pathing from carthage to dimmidi and nepte goes a very weird way round with stacks getting lost on the way.



    (nb those two carth stacks had been stuck there since near the beginning.)

    All the time it takes is time the iberians have (in the normal game) to kick carthage out of iberia. Some stacks seem to get lost during this journey too and end up wandering around lepcis permanently. They get constantly re-inforced from lepcis but do nothing. Ai stacks are nearly always doing something unless they or the faction is stuck in some way. If they're not moving or if they're moving back and forth in a repeating loop then they are usually messed up. Not always but if you watch it enough you learn to see when it isn't so.

    When the small starting stacks finally reach dimmidi they assault and lose a lot and bounce off. Most of them seem to not be able to find their path back anywhere so when dimmidi is finally taken they sit around dimmidi getting re-inforced from there and the stacks will get bigger but don't do anything. They'll attack nearby rebels but won't chase them if they are outside the dimmidi region.



    This shows the same thing but earlier before the stacks got huge but i drew pretty lines on it so i uploaded it anyway.




    Not all of this will apply to the normal game, though the pathing to dimmidi and nepte will be, in the normal setup the ai may send bigger initial stacks and so end up with less lost ones. Really meant as an illustration of how the path-finding can be so critical to the ai, especially compared to a human player who has zero path-finding problems unless they're playing with their eyes shut.

    This was all too painful to watch and also i found out the distance from siwa to nepte didn't stop the egyptians targeting it when it was still rebel, only if the carthies had it. Which they didn't as they kept getting lost.

    So time to mess with the map :)

    (I wasnt going for realism or aesthetics here just trying to see if simple map changes would make the ai perform to its best (which i actually think could be pretty scary with path-finding fixed)

    So i lost gaetulia/dimmidi and extended the sahara over their old terriotory and moved nepte close to cirta hoping the ai would target it from there and not go the long way round. Also moved cirta/thapsus a bit to smooth out bendy roads, moved a ford etc, added some hills to push roads in certain directions to make them more rounded with less sharp bends etc. All of this is trial and error and often makes things worse but eventually it works.





    Once this worked the land expansion went smoothly. A human player would still do it faster but not by as big a margin (imo)

    As you can see on the minimap of one of those they then landed on sardinia.

    Note. It seems that the ai doesn't build ships unless one of its regions can see a naval expansion target. It also doesn't seem to build them *until* it needs a new expansion target. None of the ai factions who weren't land-blocked (sort of) built a ship apart from the iberians who built one and landed a small army by tingi during a brief cease-fire. The ceasefire broke soon after and they never built another. They may not actually land an army but they never built a ship unless they had a target for a moment when they were temporarily blocked.

    Carthage can *see* sardinia and built a ship and off they went. One of the images also shows one of the times the ai will have a lot of stacks hanging around. I thought it was because they were stuck because of either path-finding round that mountain (as the ai will move stacks to the capital when they have nothing to do) or the carthage ai couldn't see another naval expansion target and were therefore stalled.



    What it actually was was them waiting for a ship. An odd place to wait admittedly (probably because of my mountains, might be better to have a path through them to thapsus). The holdup was the ****ing pirate fleets. Carthage would build a ship every turn and move it to its "waiting for an army" spot and they'd be constantly wiped out or retreated by the swarms of pirates. Again, the pirates wouldn't have been such a big problem if all the factions had their starting fleets but it still shows how important they are at messing up the ai naval expansion. This stage of the testing got too annoying as 10-20 turns went by before carthage managed to get a ship off to next target. The pirates get too strong even set at 99 because the ai uses small fleets and loses a lot.

    I went and changed the EDU so carth ships started out as exp 9 but even then it took a while before they cleared a space (mainly because carthage got big enough to build the bigger ships i think). AI naval expansion needs weaker pirates badly imo. Setting the chance to 100 in the rebel_factions file seemed to help a bit (deleting the pirates section causes a ctd).

    Anyway all the changes gradually made the pirates less of a barrier and i could see where carthage would go next.

    Carthage was the only place yet with a port so it would only be places Carthage could *see*. (A large part of this was to see which regions could be seen as a naval expansion target from different places.)



    So Carthage can see Lilybeum and Caralis and sees Caralis as closest (i am assuming that is why they went there first as caralis had a full rebel stack).
    They only go by see when they are blocked on land in some way but at least the routes are there. Oh yes, i put a fordless river between egypt and carthage for this just in case the far north-western nepte wasn't enough to keep the peace with this odd strat file setup. I was only interested in what path-finding glitchs would make carthage the pushover it usually is.

    Once on sicily they have adjacent land regions so that is it for naval expansion until sicily is taken (or in a normal game if they were at peace with another faction on sicily). The path to syracuse was no problem.



    (notice on minimap the regions the ai factions are having problems finding. no-one ever finds tribus sakae it seems. I wasn't watching those areas as i clicked end turn but if those regions are targeted but the attacking stacks are lost/stuck the whole faction might be stalled.)

    After this is all went wrong again.



    The army that took syracuse attacked and lost the battle for messana. Syracuse-messana can see each other and lilybeum-syracuse can see each other (when i say see i mean find the path) but lilybeum-messana can't, so once the first army retreated that was it for the carthage ai. If this was the normal vanilla game and carthage had been pushed out of sicily and spain because it was lost in the desert, and then made a come-back this is where the faction would stall again.

    This was painful to watch too but i did for a bit and it was quite funny in the end. The carthage ai kept sending re-inforcements by ship. The re-inforcements were just as stuck as the others. They landed more stacks and began to fill up all the available coast tiles. Bit by bit they got closer and closer to messana as new stacks were landed and bumped previous ones up the road. Finally they hit the jackpot and a bumped stack got round a bend or something and sieged messana. (going by the date on the images i think that took the AI about 40 turns.)



    Made me laugh anyway.

    Short-lived though as they lost and retreated back to syracuse and stalled too.

    Pointless image but i added it anyway. I tried to move a bunch of them next to messana but only one of those stacks (maybe more) is the prime attacker. The rest are supporters and back up if attack fails so i needed to guess which was the right one. Gave up after three.



    Sicily needs to be fixed for the ai to work. I think given the shape any small scale sicily needs to be triangular with the cities at the apexs(?) and straight-ish roads between the cities. I slapped a lot of mountains down in the middle and made the edges of the islands have at least two pixels of clear land for the road to go down.

    Not very pretty but would it work?



    No was the short answer. Needs to be tinkered with more but better to do that with a strat file set up with carth (or another faction) just on sicily so you can change the map and test it straight away. My current one sort of works in that carth now sees messana from lilybeum but i messed up their path to syracuse. But as messana sees syracuse as i hadn't changed that side of the map and as the carth armies are coming from lilybeum they don't get stuck as they go to syracuse via messana. So that was good enough for now to carry on testing the carth stuff.



    None of the cities on sicily can see italy and vice versa (though i intend to try and make messana and croton see each other eventually) so no more landings here. If there was a land-bridge carthage would now start going into italy (i prefer the naval option though when it can be made possible). So next stop palma.



    I wasn't paying attention here and didn't see where the ship was built that took this army to palma (that is the region that can *see* it). I *think* it was caralis as there was a port there now and i've seen the vanilla julii jump to palma as long as the senate had already got them to sardinia. Will check sometime by starting carthage on sardinia.

    Then it stalled for a bit. Not sure if that means they had no more naval expansion targets from theor current position or if they iberia was already picked and they were waiting for tingi to finish its port. Either way an army moved up to tingi and waited. A few turns later the port was done. Next turn a ship appeared. Then off to spain.



    With no desert distractions the ai was doing a good job focusing its forces.



    Then it all went wrong. Not at all surprising now i look at iberia after tinkering with the path-finding. I think it happened when a carth stack lost a siege against numantia and retreated behind a mountain. There were too many roman and carth stacks moving and fighting to spot the glitch but whatever it was the faction stalled and it stopped sending armies to iberia.



    (This is an exception to the rule about capitals. The ai only congregates around its capital when it has no targets.)

    I gave up here as testing the path-finding in iberia is going to take a while and it will be better done by starting carthage in corduba without any other factions so it is easier to seperate the general map glitchs from battle glitchs.

    As an indication of how messed up the ai can get in iberia:



    All but one of those (8 or 9) roman stacks are stuck (including the garrison in scallabis). The romans can't find the way to the last carth city and the carth garrison there is stuck too. The whole faction wasn't stuck because it had got big enough to have multiple targets which included ones in the east of their empire. A quick scan of the map showed that was about half the roman army.


    Couple of other things i saw before closing down.






    ~~~

    Anyway i think this all shows.

    1) The AI factions are massively handicapped by path-finding problems which can be found and fixed.
    2) Naval invasions work fine but only in certain specific directions which need to be found by testing (and only when the faction is land-blocked physically or by alliances).
    3) This is quite a good way of testing the path-finding (though probably much improvable).
    4) I like linking images a bit too much :)
    Last edited by nikolai1962; 05-02-2006 at 00:45.
    It's not a map.

  7. #7

    Default Re: Game AI stuff (1.5)

    Impressive work!

    offtopic: nikolai1962 I tryed to change the ownership of Samarbrovia from Britons To the Gauls I cut/paste the settlement from britons to the gauls...I moved the briton general to the gauls also I changed the coordonates x y with one or two ...I changed the unit type in the specific galic unit...deleted the map.rwm
    added -show_err to the shorcut rtw tab...and STILL KICK TO MENU!...the error says that Belenus (the moved general) is to old to be a parent 36<30

    I think has something to do with the families...must be relatives or something
    Can you please try it yourself if you want ? maybe you will succeed and if so...please post it here or upload the file

    p.s. some pics are funny
    Last edited by Coldfish; 04-21-2006 at 23:21.

  8. #8

    Default Re: Game AI stuff (1.5)

    wow who would have thought that beinds in roads could mess the ai up :(

    i think there is now a need for more functionaly maps rather than 100% historical maps. any trick to make the roads straight (like lakes, mountains) will surely make the game more enjoyable

  9. #9

    Default Re: Game AI stuff (1.5)

    Quote Originally Posted by Coldfish
    offtopic: nikolai1962 I tryed to change the ownership of Samarbrovia from Britons To the Gauls I cut/paste the settlement from britons to the gauls...I moved the briton general to the gauls also I changed the coordonates x y with one or two ...I changed the unit type in the specific galic unit...deleted the map.rwm
    added -show_err to the shorcut rtw tab...and STILL KICK TO MENU!...the error says that Belenus (the moved general) is to old to be a parent 36<30

    I think has something to do with the families...must be relatives or something
    Can you please try it yourself if you want ? maybe you will succeed and if so...please post it here or upload the file

    p.s. some pics are funny
    The steps are

    1) Copy the settlement for belgica to the gauls
    2) delete captain caradog and his army
    3) move belenus to the island. I moved him above Londinium (IIRC) which was x 55, y 132

    Everything should work then. There won't be a starting gaul garrison but they'll build a unit there.

    (Though personally when i play for enjoyment rather than testing out modding stuff i play EB or RTR. vanilla 1.5 is way better as a game than 1.2 but i miss the historical feel of those other mods after a while)

    I hope this is helpful enough. Problem I have is nearly every Rome folder on my machine (apart from EB and RTR) is messed up in some way through trying out different stuff. I don't even remember what half the RTW icons are for.
    Last edited by nikolai1962; 04-22-2006 at 02:21.
    It's not a map.

  10. #10

    Default Re: Game AI stuff (1.5)

    Monkwarrior,

    Using superfactions is definitely something i wouldn't have thought of. Seems likely it could work well in the right circumstances.

    The AI always seems to prioritize adjacent land regions so it is hard to make it go to sea. One thing i tried once was make a saguntum equivalent town in iberia have romans as the faction creator so it sometimes rebelled to the romans. I want them to sail there though :)

    The other thing you could try to control expansion is tweak the regions to make sure the closest one is the one is in the direction you want the AI to move or have a starting army on the border of where you want them to move. Once they are at war with someone they will follow that route mostly so if there was historically a coastal tribe and you made them closest to the carthies then that might work out. Doesn't help with the romans though.


    edit: looking at your images again i'd say the first one would work best if the map was tweaked so rome could path-find to sardinia/corsica then on to palma then spain. I'm sure that is possible after my experiments. Big problem (apart from finding which tweak worked) would be making it so they saw palma but not carthage itself as carthage is closer.


    I couldn't resist trying out the idea of a stripped down strat file on the vanilla map to test path-finding for carthage. I'll post the results once I've uploaded all the images. Some of it may be useful.
    Last edited by nikolai1962; 04-21-2006 at 22:39.
    It's not a map.

  11. #11

    Default Re: Game AI stuff (1.5)

    Quote Originally Posted by Duke John
    Good stuff!

    Months ago I also looked at the strategic AI and particularly at how it didn't merge its armies. I found that a small amount of movement points was bad as it meant that an army could not reach its target friendly army. Increasing the movement points greatly reduced the amount of armies as the AI armies could reach each other within a single turn. I would advise to give AI character a standard increase in MP by the use traits.

    There is also the problem of armies not merging when the total of 2 armies is greater than 20. So complete stacks are rare.

    All of this was tested on 1.2 so things might have changed.

    nikolai,
    have you tested wether lots of movement points (MP) decreases pathfinding problems? If so you might want to test giving AI characters a movement bonus trait when they have not used any MP for a few turns and are not in a settlement; they are stuck. The sudden increase in MP might open a different path.
    That sounds like a good idea :)
    It's not a map.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO