Results 1 to 30 of 121

Thread: Game AI stuff (1.5)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Game AI stuff (1.5)

    Measuring the distance in screen pixels wouldn't make sense really, it'd not be immediately accessible to the AI (because it's very much an engine thing) - differently to the tile distance.
    So implementing it that way would actually be more complex and thus probably not be done ;)

  2. #2

    Default Re: Game AI stuff (1.5)

    I'll forget that theory then.
    It's not a map.

  3. #3

    Default Re: Game AI stuff (1.5)

    Name Bug

    Not related to surnames per se. Scythians do get it, just not on first turn like some of the other barbs and therefore less noticeable. Partially related to path-finding, not sure how yet (scythian cavalry armies i.e more movement points may be behind its better path-finding as Duke John theorized).

    I think i've seen this name bug happen rarely after battles too (Man of the Hour promotion?) In a normal setup with good path-finding most factions will only get this a few times (i think). Factions that start with many provinces and few family members might get it a lot.


    edit: removed some stuff that was probably wrong
    Last edited by nikolai1962; 04-26-2006 at 20:12.
    It's not a map.

  4. #4

    Default Re: Game AI stuff (1.5)

    Bit of a recap/update.

    Brigands/Pirates

    I've seen posts elsewhere about what value in the strat file stops brigands/pirates. My testing shows:

    0 = most
    50 = rare
    99 = still get some

    It may be related to region size (number of fertile tiles?), hence why lower values may seem to work for some people. On the simple map my 15x15 tile regions still get them occasionally with a spawn value of 99. The 5x5 tile island regions never get them.


    Pirates

    Pirates are critical to ai naval expansion as the ai only seems to target overseas regions if they have no available land targets. (Availability includes ceasefires/alliances making adjacent land regions temporarily unavailable.) There is usually only a short window where the peace holds and naval expansion is an option. The ai,

    1) Often builds ships specifically for naval expansion and often only one ship.
    2) Once built moves the ship to its waiting-for-an-army spot (outside the safety of a harbour).

    This means they are often attacked and retreated by pirates and often sunk with the invading army on board. So basically, because of pirates, new wars usually break out between factions faster than they can mount a successful naval attack and so the faction drops the naval expansion option and goes back to land expansion.


    Slave faction building units

    I said above that in my simple map the only rebel regions that built units were the ones adjacent to a faction region at the start. This was a coincidence. What happens on my simple map is the slave faction only builds units in the regions with romans as the faction creator. Possibly unit size/cost? (edit: on my simple map the faction creator in the regions file is either romans or britons.)


    Name bug.

    Pretty sure now there are two separate problems.

    What definitely happens in my testing setups is if a faction can't find its target region then the first stack they produce will not move once it moves out of the city to that settlement's sentry spot. If the captain of that stack then gets promoted you get the name bug (where the console says "error name not found" when trying to use move-character) but this won't happen if every region on a map can path-find to the settlements of each of its adjacent regions. Or at least the settlement it picks as its first target. Another faction taking the settlement breaks this stall.

    Separate to this there is definitely a stall that can happen after fighting a battle. After looking for this specifically on my simple map it can happen to a stack that is general-led and not only to captains i.e it is not a man-of-the hour version of the name problem, not always anyway. (There may be a problem with names as well as some other after-battle bug as very occasionally you get the name error when trying to move a stack stalled by a battle.) Otherwise this stall seems to be broken by any kind of movement, including using move_character or an advance/retreat from a subsequent battle.

    It is only critical to the ai faction when the stack involved has been given a settlement to target as the ai designates one stack as the primary attacker and will not siege the settlement while the primary attacker is stuck. Also the ai only targets adjacent regions so if the targeted region is the only target available the whole faction stalls apart from chasing brigands. They won't target available naval expansion regions either when stuck like this.

    There may be a way to fix some of this but it will not be easy as the stalls happen too inconsistently to find out what might be the common elements.

    On my simple map, starting the britons/romans in the same region, the britons do consistently get more of these stalls. Without me moving the stuck armies the britons usually fail to get all the land regions (on average they get stuck on 1-3) whereas the romans only occasionally fail to get all of them and usually the most they are stuck on is one region. So maybe some clue in that.


    Edges

    The ai seems to have problems with map edges, at least the right hand and bottom edges. If enemies (brigands) are close to the edge the ai will send stacks that seem to get stuck as they approach. Sometimes the enemy stack will be far enough away from the edge to be attacked once but when it retreats the ai army can't seem to follow. In an extreme case a brigand army retreated right back to the right hand edge and the ai army stalled. I moved the ai army to the tile directly to the left of the brigands and the ai army didn't attack. However when i moved the ai army also to the map edge, one tile below the brigands, they did attack and then carried on. Will test whether having some impassable terrain on the edges cures this.

    Region size may effect this.


    Region Boundaries

    I had chunks of the vanilla map working well with the ai expanding without any hitchs until i accidentally messed it up completely. I thought originally it was because of all the woodland i scattered around out of boredom but i don't think it was now. I'd changed some region boundaries not thinking they would effect the path-finding but they do, sometimes in very weird ways. The strangest was armies moving to Tingi suddenly deciding to not cross one of the bridges any more and instead to make a V shapped detour around the river source back to the road on the other side of the bridge. Will need more testing but two things to look out for specifically are:

    1) Parts of a region that can't be reached from that region i.e an army needs to move into another region first then back into unreachable part.

    2) Shared boundaries over impassable terrain e.g mountains. if you have two regions whose border is mountains then the path-finding seems to change depending on whether one region has all of it inside its region, the other does, or they share it.

    The first in particular seems to be able to mess up path-finding between regions. Will try and create a clear example with my simple map if i can do it deliberately (very easy to do accidentally :) )
    Last edited by nikolai1962; 05-01-2006 at 23:22.
    It's not a map.

  5. #5
    Chief Biscuit Monitor Member professorspatula's Avatar
    Join Date
    Oct 2004
    Location
    Inside a shoe.
    Posts
    1,158

    Default Re: Game AI stuff (1.5)

    Very fascinating and indepth research. Well done. How you have the patience, I don't know, but we're all grateful for your efforts for sure!

    The thing that bugs me is that all this research is the work of one person. Now surely CA had a whole load of people doing the same kind of tedious testing? I assume they also had a bunch of extra console commands which could tell the programmer/tester the current status/goal of a stack, so if the stack was stuck, they'd have an indication why. With such resources how did some of these AI problems make it into the game, and still not be resolved? You don't even need to go into the depth you did to notice how the AI never targets some settlements (Tribus Sakae) and gets stuck in the desert with stacks it doesn't know what to do with. Obviously the AI will never be perfect, but obvious problems have been around with every version of RTW.

    I've long been a believer of adjusting the campaign map to provide 'stepping-stones' for the AI armies by adjusting the position of settlements and adding/removing regions to increase their expansion potential, but I never really put much effort into it, and with the 1.5 patch assumed many of the existing problems were long gone, and to be fair, some are. I think realistically, unless CA decide to release another patch to improve the AI to something resembling acceptable, spending hours and hours tweaking maps hoping it will make all the difference could in some cases just not be worth it. The player's own actions will affect how some of the AI factions expand, and even though say Carthage expands well, there's still a lack of sea invasion from other factions in the maps you show. The AI is too rigid in structure and it clearly needs a kick up the toga. It's inability to deal will multiple threats and targets is probably why, in part, CA separated the Romans into 3 competing factions (and the Senate) so collectively the Roman empire would expand in all directions and not just get stuck in Gaul for the next 100 years.

    Good luck with your continuing research.

    Lets hope CA have improved things greatly with MTW2, or it'll be another reminder to us all that the AI isn't up to the job of coping with a non-Risk style map.
    Improving the TW Series one step at a time:

    BI Extra Hordes & Unlocked Factions Mod: Available here.

  6. #6

    Default Re: Game AI stuff (1.5)

    Ty,

    I don't really have the patience unfortunately. I get totally sick of it very fast but i have developed a "need to know" whether the campaign ai is capable of dramatic improvement by following some simple map rules and maybe a bit of minor modding. I think it is but working out specifically what those rules are rather than my current vague ones keeps bugging me to come back to this. I'd much rather be playing

    I think the reason CA didn't pick up a lot of these is partly because they are really hard to spot on a normal map if you are actually play-testing instead of sitting on an island clicking end turn and watching other factions move. On the other hand it seems to me they badly need to have a very simple test map and people doing what i did. I bet a lot of these bugs are very minor rounding error type things.

    With the vast improvement in battle ai of 1.5, the battle and immersion improvements of various mod teams, that only leaves good campaign ai as the big hurdle to a scary immersive strategy game.

    It is very tedious though.
    It's not a map.

  7. #7

    Default Re: Game AI stuff (1.5)

    dont want to teach a good modder to suck eggs but you know about the -ai command dont you. In your shortcut properties add -ai at the end of the line to have the game play itself. makes it easier to just sit back and watch the game unfold.

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