Coding frustrations with AI

By on July 14, 2013 9:42:37 PM from JoeUser Forums JoeUser Forums

Frogboy

Join Date 03/2001
+1491

Since the beginning of Fallen Enchantress, people have claimed that the AI monsters will sit next to any enemy city and not attack.  They concluded that the monsters were giving AI players a pass. 

I have responded that I have looked at the code over and over and the monsters do not treat computer players any differently.

Well, tonight I’m seeing the behavior very starkly.

image

These ogres should be wiping out this AI city.

image

The code says that the ogres want to wipe out the AI city.

They are explicitly targeting it.

..

And yet..

The attack never happens.

As a result, the monsters are just standing there, stuck outside the city.   Now, I’ve got a few thousand hours of game time on this and this is the first time I’ve seen it where I knew it should be attacking (i.e. I’ve seen well defended cities with monsters outside).  So it’s not that common.  But based on forum feedback, it’s definitely something others have seen.

Now, I have to find out why they are being prevented from attacking.

Stay tuned..

 

Update 1: Seems to be path finding related. This is going to take some digging.

 

Update 2:

New check in.

+ AI Removed conflicting code that caused monsters to behave outside the control of the AI
+ AI Monsters more careful about leaving their lairs unguarded.
+ AI Updated the area threat evaluation to include stationed units.
+ AI champions significantly better about taking out enemy outposts and grabbing goodie huts on the way to another destination
+ AI better at building more lethal armies
+ AI much better at protecting its cities
+ AI fixed a bug where certain AI personalities had a chance of not building units when they should depending on the type of city
+ AI more aggressive about training units when it feels that city is vulnerable
+ AI no longer has a "auto patrol" system. Instead, the monster AI directly controls monsters and not the mobileobject system.
+ Fixed a pathfinding bug that caused monsters that were calculating a destination to not be able to set a destination IF the target was 1 tile away and it is a city.

Locked Post 37 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
July 16, 2013 2:44:03 PM from Elemental Forums Elemental Forums

If it can't set the destination to a city if it's one tile away, how can the monster AI attack any cities at all?  I mean, this should really affect both player and AI equally.  Does it?

Reason for Karma (Optional)
Successfully updated karma reason!
July 16, 2013 5:27:48 PM from Elemental Forums Elemental Forums

Quoting StevenAus,

If it can't set the destination to a city if it's one tile away, how can the monster AI attack any cities at all?

en passant

Reason for Karma (Optional)
Successfully updated karma reason!
July 17, 2013 12:20:39 AM from Elemental Forums Elemental Forums

Quoting StevenAus,
en passant

 

I really, truly, laughed out loud. 

Reason for Karma (Optional)
Successfully updated karma reason!
July 17, 2013 1:57:49 AM from Elemental Forums Elemental Forums

Yeah, I thought it was pretty funny too, even though I didn't say it.

Reason for Karma (Optional)
Successfully updated karma reason!
July 18, 2013 5:48:59 PM from Elemental Forums Elemental Forums

Quoting StevenAus,

If it can't set the destination to a city if it's one tile away, how can the monster AI attack any cities at all?  I mean, this should really affect both player and AI equally.  Does it?

It does.  If the AI is 2 tiles away and sets its destination to a city, it's fine.  But if it's 1 tile away when it goes to make its destination, it'll fail.

So a current 1.2 exploit would be to put your city next to a big monster lair. It can't be attacked.  Of course, few people would ever do that because that seems crazy.   But the AI sometimes does this and ends up with a dragon or whatever 1 tile away that wants to kill it but can't.

Basically, when it goes to do its path finding, if it is 1 tile away, it gets blocked by its own destination.  It's a very subtle and thankfully rare condition. But when it does strike, it's pretty blatant -- big monster standing outside a city.

Reason for Karma (Optional)
Successfully updated karma reason!
July 18, 2013 5:51:36 PM from Elemental Forums Elemental Forums

Ah that makes sense, and explains a lot.

Reason for Karma (Optional)
Successfully updated karma reason!
July 19, 2013 8:44:11 PM from Elemental Forums Elemental Forums

Thanks. Nice find. I've seen this a fair amount. It seems like 2 bugs to me though.

1. The monsters don't attack cities 1 space away

2. The AI Players are CRAZY and build cities 1 space away from giant monsters. The AI needs to be better about monster city placement.

Reason for Karma (Optional)
Successfully updated karma reason!
July 20, 2013 12:37:30 PM from Elemental Forums Elemental Forums

I've noticed this. Sometimes I have built cities next to monsters, with protection from eg a hero but needing help from the city militia to take out the monsters. but the monster never attacks and so the hero is stuck in the city, because the city militia alone would lose to the monster... Now I know I could have safely left...

Reason for Karma (Optional)
Successfully updated karma reason!
September 4, 2013 4:14:14 PM from Stardock Forums Stardock Forums

So is this a fix problem now?

Reason for Karma (Optional)
Successfully updated karma reason!
September 4, 2013 4:36:34 PM from Elemental Forums Elemental Forums


I would think no?  I have taken over a city to find that the AI had built it next to dragons or other Strong, Dangerous or Epic things seemingly without a care in the world.   A few turns after I take them over as a human player, these things decide to attack.

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2013 1:56:08 AM from Elemental Forums Elemental Forums


The interesting thing about this:

 

I play on moderate (everything) as Cesera and since 1.3 have noted that AI mobs ignore AI cities and go out of their way to attack mine. This was not happening pre 1.3.

It's gotten to the point where I have founded cities, had the local Mob trash them and return to base. An AI player then runs in and steals the location  - and the Mob ignores them, but if I move my troops anywhere near the AI city the Mob comes straight out of the base and attacks my army - it then seems to continue outward until if finds my nearest town and hammers it flat - unless I've kept several extra units in it as a precaution.

I'm finding the new AI changes have made expanding impossibly hard as I can't expand anywhere near mob sites - and now high level spawn sites seem to exist near every possible settlement location. The AI which has no such problem with the mobs then pounds me into to the dirt.

Also noticed that the differing border colours around the players seem to have disappeared - everyone is 'yellow', including mobs.

I'm not sure if I'm going crazy or there is actually an issue at this point, since no one else is reporting it.

Also there's a weird spotlight effect occurring on the tactical map since 1.3 where highlighted squares have a beam of light visibly causing the highlight

Reason for Karma (Optional)
Successfully updated karma reason!
September 9, 2013 4:55:53 PM from Elemental Forums Elemental Forums

Quoting wheeledwriter,


The interesting thing about this:

I play on moderate (everything) as Cesera and since 1.3 have noted that AI mobs ignore AI cities and go out of their way to attack mine. This was not happening pre 1.3.

It's gotten to the point where I have founded cities, had the local Mob trash them and return to base. An AI player then runs in and steals the location  - and the Mob ignores them, but if I move my troops anywhere near the AI city the Mob comes straight out of the base and attacks my army - it then seems to continue outward until if finds my nearest town and hammers it flat - unless I've kept several extra units in it as a precaution.

I'm finding the new AI changes have made expanding impossibly hard as I can't expand anywhere near mob sites - and now high level spawn sites seem to exist near every possible settlement location. The AI which has no such problem with the mobs then pounds me into to the dirt.

Also noticed that the differing border colours around the players seem to have disappeared - everyone is 'yellow', including mobs.

I'm not sure if I'm going crazy or there is actually an issue at this point, since no one else is reporting it.

 

Here's someone reporting it

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000156   Page Render Time: