Author Topic: Retreating AI wormhole priorities  (Read 1899 times)

Offline dumpsterKEEPER

  • Sr. Member Mark II
  • ****
  • Posts: 361
Retreating AI wormhole priorities
« on: September 17, 2009, 11:48:27 am »
I really like the AI behavior that allows for retreats when faced with overwhelming odds. On a number of occasions however, I've noticed this general scenario:

The AI has a strike force on one of my worlds when I jump a fleet in to defend it. As it's a sizeable defense force, the retreat logic kicks in and the AI splits off into multiple groups heading towards exit wormholes. One or more of these groups travel to an undefended wormhole and exit the system without a scratch. However, another group will head straight towards a turreted/defended wormhole and get completely wiped out in their attempt to leave the system.

I would suggest that when retreating, the AI should attempt to prioritize exit wormholes that are undefended or lightly defended. This would make sense with their retreating posture and would leave more AI ships alive to attack again in the future.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Retreating AI wormhole priorities
« Reply #1 on: September 20, 2009, 12:20:27 pm »
I thought about this, but it leads to some undesirable ways to then further trick the AI -- leave a REALLY big force on the other side of the undefended wormhole, and then the AI pops out and gets slaughtered.  This is one of those places (like the "gap in the wall" logic) that leads to too-predictable AI in other games.  I agree, it will often make the AI act slightly non-ideal in this case, but it also protects it from being trapped into REALLY non-ideal situations, if that makes sense.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Fiskbit

  • Arcen Games Contractor
  • Master Member Mark III
  • *****
  • Posts: 1,752
Re: Retreating AI wormhole priorities
« Reply #2 on: September 20, 2009, 12:32:19 pm »
What if the AI were to probe the undefended wormhole and see if it's safe?
Have ideas or bug reports for one of our games?  Click here to get started with Mantis for Suggestions and Bug Reports.  Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Retreating AI wormhole priorities
« Reply #3 on: September 20, 2009, 12:40:32 pm »
That requires

A) time, during which the AI ships have to do something (and during which time they might well just be getting killed, or giving the human player time to come up with a counter), and

B) a way to evaluate if the other side is safe (is it safe if the wormhole is clear, but there are massive fortifications on the other planet?  what about if it is a long string of planets, and the danger is somewhere further down?  do we get into situations where the AI just runs back and forth between some planets because it can't find an acceptable exit to punch through at either end?).

C) a lot of coordination between the AI ships, which isn't super compatible with the whole emergent AI thing.


This is one of those times where the emergent AI will make a slightly nonideal choice sometimes, but that slightly nonideal choice is actually better in the long term than always making the predictable 100% best choice.  I intentionally avoid coding in hard rules like that, because as soon as the AI is too predictable, even if it is very smart, the players can formulate some second-order strategies to counter it.  I know this because my play group (the AI War alpha group) is expert at finding these strategies in pretty much all RTS games.  We never did find anything too exploitative for RoL or RoN thanks to the lack of walls, but we did for AoE2, AoE3, Empire Earth, SupCom, and all the various expansions -- and the SupCom AI mods, as well, though that took longer.

This really goes to the fundamental nature of the AI in AI War, and why it is in the main better.  Will it sometimes do things like this that are tempting to "fix?" Yes.  When there is a direct way to evaluate this sort of thing on a per-ship basis, I try to do that while also still making sure it remains fuzzy.  A lot of the recent minor AI rules updates have been that sort of thing.  But when something require a lot of intentional ship coordination, or a lot of looking-ahead or scouting or what have you, that's where I start getting very nervous and staying away.  The premise of this sort of AI is to stay away from those sort of things, because even though they fix the direct problem, they often cause a whole raft of other problems and exploits down the line...
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline dumpsterKEEPER

  • Sr. Member Mark II
  • ****
  • Posts: 361
Re: Retreating AI wormhole priorities
« Reply #4 on: September 21, 2009, 01:43:47 am »
Ah, that makes sense.  I hadn't thought about it from the potential exploits perspective. Thanks for explaining your thinking though, that's helpful to understand why the AI sometimes behaves the way it does. I can understand the hesitation to add specific rules to the AI as eventually you'd essentially end up with a decision tree AI.

In regards to this issue in particular, I don't think it's a huge deal, it just sometimes strikes me as odd that a group of AI ships will impale themselves on obviously placed defenses. On the other hand, occasional sub-optimal decisions do sometimes catch me by surprise and make the AI feel more "human."

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Retreating AI wormhole priorities
« Reply #5 on: September 21, 2009, 09:14:43 am »
No problem!  Glad it's not too big an issue.  And, for sure, sometimes those groups of ships will, in the process of impaling themselves, do something important.  Or sometimes they'll have enough strength to break through into the adjoining planet and do some real damage on the other side.  One of the players in my game on Saturday actually lost his home planet to something like that.

When I was working on the AI code to start out, originally everything was rules-based.  And when I switched to a more emergent style of AI code, I thought I'd have to build in more rules there, too.  That's why I was so surprised how quickly the AI started being effective, and from that stage on I became careful of second-order effects.  I think that's the unique bit of knowledge that I stumbled across by accident, which leads to more effective AI designs in general.  

Effective AI is like holding a handful of sand:  some sand will trickle uselessly from your hand no matter what, this can't be prevented, but most game AI programmers squeeze the sand more tightly to try and save it, and wind up losing so much more sand in the process.

You know, this might make a good blog post... :)
« Last Edit: September 21, 2009, 10:07:37 am by x4000 »
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Magitek

  • Jr. Member Mark II
  • **
  • Posts: 72
Re: Retreating AI wormhole priorities
« Reply #6 on: September 23, 2009, 08:59:35 am »
This is sort of a bummer for me, because I find the ai is quite exploitable because of it. Stack your parasites on wormholes/intercept with leechstarship, build some tractors. Destroy command station. Harvest 50-250 free ships or cut them down.

I hate to say it, but the emergent AI needs to be relaying commands to a tactical AI. The emergent tells the tactical it needs to pull out, issues this to the tactical, which says: we'll group and search for an exit. In a heavily entrenched system, it's only recourse is to bust through the path of least resistance. dividing up may reduce casualties if the player does not control all the gates. If the AI is not trying to preserve its ships, then it should again, be forming a group to deal some damage instead of suiciding fruitlessly.

I'm completely no expert on AI systems, so it may not even be plausible to deal with it tactically using emergent ai because I don't know the first thing about it. Just hate its lack of self-preservation. (I mean it's AI it probably doesn't mind dying much, but atleast it could focus on destroying stuff while doing it, relying on luck may be interesting to a point, but at 1/5th its forces, I doubt anyone is going to be losing anything important unless they're tactically docile, or extremely weakened.)

Take my ignorant post as you will, number 1 feature in AI war, is the ai for me :D

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Retreating AI wormhole priorities
« Reply #7 on: September 23, 2009, 09:02:26 am »
This is sort of a bummer for me, because I find the ai is quite exploitable because of it. Stack your parasites on wormholes/intercept with leechstarship, build some tractors. Destroy command station. Harvest 50-250 free ships or cut them down.

No, this is the point:  you can't exploit it because of this.  If it were exploitable, you'd be getting all the ships, every time.  As it stands, you only get some of them at best, while the rest escape to fight another day.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Magitek

  • Jr. Member Mark II
  • **
  • Posts: 72
Re: Retreating AI wormhole priorities
« Reply #8 on: September 23, 2009, 09:41:52 am »
How about having the AI suicide on a lone starship or other important vessel/structure occasionally? The AI doesn't exactly have fixed reinforcements, so it may be well worth for them to attempt this.

"I intentionally avoid coding in hard rules like that, because as soon as the AI is too predictable, even if it is very smart, the players can formulate some second-order strategies to counter it."
To me this issue seems like one of those hard coded rules and is why I dislike it. It misses alot of opportunity simply dividing like this when it panics.
This is just as exploitable to me as it is choosing a single gate, only it has no chance of breaking through turrets on wormhole entrances/exits dividing up forces, or damaging the player in a meaningful way unless for some reason the player doesn't choose to exploit it.

If possible, perhaps we could see the ai perform one of three or more things?
1. divide
2. suicide on a structure or valuable vessel, this will occasionally be far more harmful to the player than just leaving and coming back later.
3. group up before leaving through a gate, the group may well be tough enough that the player wont simply risk casaulties. they're more expensive to the player in general. it could also assault a nearby system with the players main forces still long behind.
4. be really irritating and get 10% value back by deleting its forces, not something recommended at all but I'm just putting it out there.
5. wait outside a clear gate to stall for time while a support wave arrives to assault the system before the player secures it permanently. the player may not follow him through, and will get a surprise when the retreatees return with a sizeable battle force.
6. ask for reinforcements if a nearby system is available, possibly open to some sort of abuse if the player was ready to enter said system. given that this is only 1 of 6 options, I don't think its something players can count on, its just another idea however. If the AI adds up a few figures, and decides the forces will match up with a bit of unit shuffling from an immediate system, I think you could give this a fair trial.



« Last Edit: September 23, 2009, 09:56:22 am by Magitek »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Retreating AI wormhole priorities
« Reply #9 on: September 23, 2009, 10:12:38 am »
I'm sure I'll grow the logic around retreats at some point, right now I'm pretty much tied up trying to get 2.0 out the door.  You're right that having the AI always retreat when outnumbered is a bit too predictable, though.  The AI won't always divide its forces up, though, it will sometimes move all as one large group.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!