Author Topic: How do conflicting AI types interact?  (Read 2515 times)

Offline BobTheJanitor

  • Master Member Mark II
  • *****
  • Posts: 1,689
How do conflicting AI types interact?
« on: January 06, 2011, 03:22:00 pm »
I finished my first game last night, and looking at things after the action was over, I'm a little curious about how the two AI types were interacting. I'd gone with two random easy types, and ended up with a sledgehammer and a shield ninny. They have two conflicting abilities, where the sledge hammer is supposed to send many waves one after another, while the shield ninny sends no waves at all. I don't have a base line to compare things to, since it was my first game. But I did notice that I didn't seem to get any sort of attacks that I didn't instigate either by destroying a counterattack guard post or by stirring up too many ships while passing through an AI occupied world. Are these two types interacting correctly? Or is it possible that one AI's style supersedes the other and in this case resulted in the sledgehammer AI not doing anything? And maybe I don't have my terms right. My only other comparison game was the tutorial, but I do remember intermittent attacks of a few dozen ships every few minutes while playing through that. Are those the waves we're talking about, or are these specifically the announced waves of X ships to planet in Y minutes? Because now that I think of it, I did get some of those, but only towards the end of the game after the first AI was already dead. This was on difficulty 4 though, so that may have some impact on it as well. I'm thinking difficulty 6 and a full 80 planets for the next game. (Only feeling slightly more brave, but not man enough to jump straight to difficulty 7)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: How do conflicting AI types interact?
« Reply #1 on: January 06, 2011, 03:37:22 pm »
Short answer: there are no conflicts, they each do their own thing.  The AIs are two different entities, each with their own waves, planets, and ships.  So any two AI types will function correctly when combined together, essentially.

The specifically-announced waves are what you'd be seeing in terms of waves.  The random-ships-popping-in-every-so-often thing was just a simplified simulation in the tutorial of the more complex logic for special forces ships and other forms of "threat."

The waves are a lot less frequent on lower difficulty levels, though -- depending on how low you went, it could get REALLY infrequent at, for instance, difficulty 1.  It's every 20-40 minutes or so on diff 7.

You might find this an edifying partly-related read: http://arcengames.com/mediawiki/index.php?title=AI_War_-_Choosing_A_Difficulty_Level#Like_Chess.2C_A_Game_Of_AI_War_Has_Three_Abstract_.22Phases.22
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 BobTheJanitor

  • Master Member Mark II
  • *****
  • Posts: 1,689
Re: How do conflicting AI types interact?
« Reply #2 on: January 06, 2011, 04:35:58 pm »
So in my shield ninny + sledgehammer scenario, what's going to determine if I'm still getting the waves? Does each AI send their own separate waves so that I'd only get those that the second AI sent in this case, but none from the first? Or does each AI have it's own internal list of which worlds belong to it and thus will only send waves from planets that it 'owns' and which have warp gates? I ask because it seemed to me as if the waves didn't come until I'd destroyed the first world. So my assumption is that the no-waves AI was controlling things until I killed it, and then the sledgehammer took over and was allowed to send waves. Or maybe that I was just on the shield ninny's worlds at first, and then in the late game I started moving into the sledgehammer's territory?

And that random incoming ship thing in the tutorial may have done me more harm than good in terms of learning to play the game. I had expected something like that, but scaled up, would come with a full map, so that I would be looking at an eventual steady stream of low powered ships hitting all my planets as the game went on. I was constantly turreting up my planets in the expectation that I would be getting those type of waves incoming, when in fact they never came. I stopped doing this towards the end of the game, when I started to catch on to the fact that those attacks weren't ever going to come.

And so I can make sure I now understand this correctly: The only things that are going to cause the AI to cross a border and attack my worlds (outside of specific ships or guard posts with special abilities) are going to be me 'pulling aggro' by poking my nose in to their planet, or the specifically announced waves from warp gates, right? If I move in to the planet next door but never send anything to their side of the fence, I can safely assume ships aren't just going to randomly trickle in for no specific reason?

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: How do conflicting AI types interact?
« Reply #3 on: January 06, 2011, 04:59:18 pm »
Right, each AI has their own waves.  So one sends them, the other doesn't.

In terms of those steady streams of ships, you will indeed run into that sort of thing... sort of.  It won't be in the form of a small stream, but the AI will "stalk you" for a while, and then suddenly bust in out of nowhere when it feels it has superior force.  If you don't take a turret-happy approach like you were doing, then on higher difficulties you will die.  It's just at the lower difficulties, and on some specific maps, where you might not need as many -- but even then, if the AI gets a breakaway force, and you have no turrets, you're screwed then, too.  So it's a matter of maintaining some defense-in-depth, which is key.

In past versions even in the regular game the AI would trickle in.  However, in recent versions I taught it a new "stalking" behavior where it waits until it thinks it can win with its forces before it comes in.  So that leads to more "occasional gushes" rather than "continual trickles."  The turrets, in that sense, act as a critical deterrent, too.

Quote
And so I can make sure I now understand this correctly: The only things that are going to cause the AI to cross a border and attack my worlds (outside of specific ships or guard posts with special abilities) are going to be me 'pulling aggro' by poking my nose in to their planet, or the specifically announced waves from warp gates, right? If I move in to the planet next door but never send anything to their side of the fence, I can safely assume ships aren't just going to randomly trickle in for no specific reason?

No, there's way more than that.  The sources of ships are:

1. Special Forces ships (they wander around all the time and will randomly pop in -- on anything higher than I think diff 5).

2. "Threat" ships in general can come in at any time.  Read up on the wiki on these, but ships that are freed from your "pulling aggro" or doing whatever else count as this, and they can be spawned in a few other ways.  AI ships will often retreat from battle and then lurk as threat, too.  Not on the lower diffs, though.  These are the ships that will stalk you and then suddenly come back in.

3. Waves are those periodic, announced things that come directly into your planets.

4. Cross Planet Attacks will get announced every so often, and then after about 12+ minutes you'll have probably a few thousand ships all go threat at once.

5. As planets reinforce a ton, they will first create a barracks, and then start creating carriers, with the overflow.  The carriers are like AI transports, and they'll count as threat and stalk you in the same way.

6. As planets reinforce a ton, they will also start having "border aggression," where small numbers of their ships will trickle out of their guard status into threat.  These ships then join the others in doing... whatever they think is best.

7. Obviously, if you opt to turn on some of the minor factions, they have all kinds of crazy behaviors.  The hybrids are the most brutal out of them, but there are many various flavors of sub-factions with different behaviors.

There are also some more edge cases, but those are the main ones.  The wiki has more info on a lot of that, if you want all the details on each one.  Or you can opt to just discover as you go.  Bear in mind that if you were playing below difficulty 5, it's really not including the full range of the AI behaviors, not even close.  Once you move up to 5 it's a bit closer, 6 is a lot closer, and 7 has about 97% of them.  Diff 8 is where absolutely 100% of them are, and it's extremely difficult as well.

In a lot of senses the tutorial is training you for the higher difficulties, so indeed it might be overkill if you play that way on the lower ones.  But, to some extent it's better to be safe than sorry, eh?  I can't count the number of games I've lost because I was fighting the AI on planet A, and then they broke through my defenses and skipped through other planets without my noticing, only to kill my homeworld.  Having automated turret setups at key junctures can really help with that (though it won't prevent it entirely, with things like starships and guardians).
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 Red Spot

  • Sr. Member Mark III
  • ****
  • Posts: 462
Re: How do conflicting AI types interact?
« Reply #4 on: January 06, 2011, 05:09:16 pm »
So in my shield ninny + sledgehammer scenario, what's going to determine if I'm still getting the waves? Does each AI send their own separate waves so that I'd only get those that the second AI sent in this case, but none from the first? Or does each AI have it's own internal list of which worlds belong to it and thus will only send waves from planets that it 'owns' and which have warp gates? I ask because it seemed to me as if the waves didn't come until I'd destroyed the first world. So my assumption is that the no-waves AI was controlling things until I killed it, and then the sledgehammer took over and was allowed to send waves. Or maybe that I was just on the shield ninny's worlds at first, and then in the late game I started moving into the sledgehammer's territory?

Start a game with AI's between 7 and 8, you'll find 2 incoming waves around the 12min mark. Wether you build a fleet, scout, attack, build turret ... or not, they will come. After that all bets are off :)

It does seem you can never effectivly stop both AIs sending waves, but you can get the AI to only send 1, by only having 1 planet bordering an AI planet that has a warpgate.

And that random incoming ship thing in the tutorial may have done me more harm than good in terms of learning to play the game. I had expected something like that, but scaled up, would come with a full map, so that I would be looking at an eventual steady stream of low powered ships hitting all my planets as the game went on. I was constantly turreting up my planets in the expectation that I would be getting those type of waves incoming, when in fact they never came. I stopped doing this towards the end of the game, when I started to catch on to the fact that those attacks weren't ever going to come.

Tutorials are usually there to show you the basics of the game, the keys you need, the buildings you need, which resources are important. It is usually not a nutshell version of the actual game. I would even go as far as saying that you should only play the tut to the point it explains about gateraiding, then quit and play a game vs low-level AIs.

And so I can make sure I now understand this correctly: The only things that are going to cause the AI to cross a border and attack my worlds (outside of specific ships or guard posts with special abilities) are going to be me 'pulling aggro' by poking my nose in to their planet, or the specifically announced waves from warp gates, right? If I move in to the planet next door but never send anything to their side of the fence, I can safely assume ships aren't just going to randomly trickle in for no specific reason?

No you can not. Some AIs might perhaps be more reluctant to attack where others are not (I have been playing too specific AIs to be completely sure, where those seem to be based on attacks), having some force on the planet does quite often prevent them from attacking, even previously called waves might not even cross planets if you defend them well ... but dare to pull those forces away and the AI can come over to punish you .... brutally.
40 or so mixed turrets seem to stop a large amount of border hostillities, but they are not a save bet it wont happen at all.

It seems very much so that the game is random enough to prevent really static strategies, yet static enough to keep an AI sort of aimed at a certain goal (eg: starship AI builds large amounts of starship, but planets are random enough that you can not simply devise 1 strat to clear all).

edit: got ninja'd, posting anyway :)

Offline BobTheJanitor

  • Master Member Mark II
  • *****
  • Posts: 1,689
Re: How do conflicting AI types interact?
« Reply #5 on: January 06, 2011, 06:26:41 pm »
Thanks for the in depth explanations, that's helping to clarify things for me a lot.

Especially:
having some force on the planet does quite often prevent them from attacking, even previously called waves might not even cross planets if you defend them well ... but dare to pull those forces away and the AI can come over to punish you .... brutally.

I was wondering if it was just bad luck, but of course I should have known better with this game. As soon as I pack up a big force into transports, I suddenly get an AI attack on that planet. And then I have to whistle everyone back out of the pool to deal with it. At least in most cases I hadn't already sent the transports on their way, so defense wasn't too tough. (Would this be exploitable by the way? Lure the AI out by stuffing your ships into transports and then plaster them when they attack the now 'weak' planet?) It also leads me to ask, is it assumed that the AI has 'scout' type intel for player planets at all times? I don't think there's anything like an AI scout ship, but obviously something has to be telling them that I just moved all my ships away and now would be a good time to drop in.

The Special Forces guard posts I believe I had encountered in my game, but I don't know that I ever saw any ships coming from them. These patrol from one post to the next right? Is it in a set loop pattern, or do they have some sort of self-determination for where they'll head next? Maybe my pattern of guard posts was such that I just happened to never run in to these guys.

I haven't tried the minor factions yet, although I'm thinking of throwing dyson spheres, easy golems, and easy spire ships in to my next game because they sound like the most fun at a cursory glance. Look for me to be back soon no doubt asking silly questions about how they work. :D

Offline Red Spot

  • Sr. Member Mark III
  • ****
  • Posts: 462
Re: How do conflicting AI types interact?
« Reply #6 on: January 06, 2011, 06:33:21 pm »
(Would this be exploitable by the way? Lure the AI out by stuffing your ships into transports and then plaster them when they attack the now 'weak' planet?)

Ofcourse not. /sarcasm :D

The rest I cant answer.
(Concerning Golems, if you are somewhat experianced with strategy-games I would just go for the 'medium' option.)

See you soon! :)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: How do conflicting AI types interact?
« Reply #7 on: January 06, 2011, 06:55:08 pm »
Putting stuff in transports shouldnt matter for the attack, it should only be when your ships actually leave the planet. It's probably coincidence on the timing with that specific case.

The ai does have some extremely limited scout intel about you in certain circumstances (ai ships can tell the firepower of a planet they are about to go into, but can't find out until they are right about to go in, for instance.). The rules are many and subtle for what the ai is allowed to know, but in all it mostly equates to how you are able to see the threat counter, and when waves are coming, etc. To get more detailed info about a planet, the ai has to have ships there, same as you. Actually, with most of that there is no overall ai thought process, it's all the individual ships making decisions and coordinating. It gives the appearance of many subcommanders, though their logic is emergent, not preprogrammed. I wrote a series of blog article about this back in 2009, it was on slashdot, reedit front page, hacker news front page, msdn coding for fun, how stuff works, etc. If you're curious about that stuff.

I don't really know what difficult you were playing on before, I don't think you said. Below certain difficulties, special forces patrols are not allowed to come into your planets. I forget the exact level, it should say on the wiki. The patrols are randomized, between all the nodes in the galaxy. Lower difficulties also have fewer ships patrolling, so that can really make them practically invisible.
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 BobTheJanitor

  • Master Member Mark II
  • *****
  • Posts: 1,689
Re: How do conflicting AI types interact?
« Reply #8 on: January 06, 2011, 08:04:28 pm »
I actually did read those articles. Fascinating stuff, even if the more nuts and bolts coding things I could only grasp on a vague abstract level. And I was on difficulty 4 before, so I'm sure I was getting coddled by the AI and thus never saw the special forces. So basically the AI is getting a general strength estimation for the planet and then looking at their strength and how much you're annoying them and then jumping in? I like it. I'm sure I'll see more with the next game I'm starting at diff 6. I should probably man up and go for 7, but I still have a few things on the screen that don't mean anything to me, and I want to make sure I'm fluent in the language before I try to write poetry in it, if that analogy isn't too terribly stretched.

Also a tangential question. After finishing that first game, I wondered what would happen if I just continued on taking planets. There's no more AI to enrage, but they do have remaining units. The AI wormholes still exist to their mysterious other place, so do they keep getting reinforcements? If I wanted to be an obsessive completionist and cleanse the galaxy of the AI scourge, is the game going to allow me to do that? I assume there's not a lot of real challenging gameplay left to be had at this point, but just the fact that I can keep only playing after killing the last homeworld made me curious. And is there any consideration for making some sort of game mode that continues all the way to the last planet? I'm not sure how you'd balance keeping some sort of challenge while still making you feel like you've already won, but it's just an idle thought.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: How do conflicting AI types interact?
« Reply #9 on: January 06, 2011, 08:59:53 pm »
I actually did read those articles. Fascinating stuff, even if the more nuts and bolts coding things I could only grasp on a vague abstract level.

Cool, glad you enjoyed them.

And I was on difficulty 4 before, so I'm sure I was getting coddled by the AI and thus never saw the special forces.

Yeah, that's about right.  Difficulty 4 still has some challenge if you're new to the game, in that you have to figure out what you need to be doing, but it's more about you and your activities in solving the "puzzle" of the galaxy rather than the AI actively harassing you that much at that level.  The harassment level jumps up a fair degree at difficulty 5, and then 6, 7, and 8 are all notable steps upward.  I play 7, not 8, and try to balance the game so that I win about 60-70% on 7.  My streak for last year was unfortunately more like 8% wins on diff 7, but that was... well, it happens, especially when folks get gun-happy in co-op. ;)

So basically the AI is getting a general strength estimation for the planet and then looking at their strength and how much you're annoying them and then jumping in? I like it. I'm sure I'll see more with the next game I'm starting at diff 6. I should probably man up and go for 7, but I still have a few things on the screen that don't mean anything to me, and I want to make sure I'm fluent in the language before I try to write poetry in it, if that analogy isn't too terribly stretched.

Yeah, that's all about right.  And there are plenty of people on the forums who just prefer sticking with difficulty 6 in general.  It's a bit less cutthroat, and the AI doesn't quite have all its main tactics (maybe 90% instead of 98% at diff 7), but it's still an interesting game and quite a challenge, especially depending on your playstyle.

Also a tangential question. After finishing that first game, I wondered what would happen if I just continued on taking planets. There's no more AI to enrage, but they do have remaining units. The AI wormholes still exist to their mysterious other place, so do they keep getting reinforcements? If I wanted to be an obsessive completionist and cleanse the galaxy of the AI scourge, is the game going to allow me to do that? I assume there's not a lot of real challenging gameplay left to be had at this point, but just the fact that I can keep only playing after killing the last homeworld made me curious. And is there any consideration for making some sort of game mode that continues all the way to the last planet? I'm not sure how you'd balance keeping some sort of challenge while still making you feel like you've already won, but it's just an idle thought.

Actually, you can keep playing just like normal, and everything is basically the same as it would have been before the game ended.  You still get all the normal waves, reinforcements to the AI, etc.  In fact, it gets harder and harder, because the AI Progress keeps going up.  Originally I had it so that the game literally stopped execution when the gameover was reached, but players wanted to be able to play a completionist type of game, and so we put in the ability for them to do so.  I probably should make that a bit more robust, actually; there are several complaints about the way it currently is.
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 BobTheJanitor

  • Master Member Mark II
  • *****
  • Posts: 1,689
Re: How do conflicting AI types interact?
« Reply #10 on: January 07, 2011, 12:13:57 am »
Actually, you can keep playing just like normal, and everything is basically the same as it would have been before the game ended.  You still get all the normal waves, reinforcements to the AI, etc.  In fact, it gets harder and harder, because the AI Progress keeps going up.  Originally I had it so that the game literally stopped execution when the gameover was reached, but players wanted to be able to play a completionist type of game, and so we put in the ability for them to do so.  I probably should make that a bit more robust, actually; there are several complaints about the way it currently is.

It would be interesting if you could carry the game on past this point but twist the combat in such a way to reflect the fact that you're now wiping out AI remnants that are fighting without central control. Something to make them feel less intelligent and more random, without just acting idiotic. I'm not sure exactly how you'd reflect that in gameplay, though. Probably no more reinforcements but everything is released from guarding, but without any of the normal AI planning for where the humans are, so you just get ships in random sized groups careening around from one wormhole to the next and only attacking things that they get close to. Or maybe they get smarter in groups because they can still plan together, but only with other ships that are in their normal targeting range. So a big blob of enemies would fight smart but a small group would just go in random directions and shoot at butterflies. (Space butterflies) You'd need an ultimate goal to work towards, probably some sort of way to permanently seal the Exo-Galaxy Wormholes which could then 'cut off' the remaining forces completely and they would all freeze in place or explode, or some such thing. Most people probably wouldn't play a mode that required you to go to every single world and shoot every single piece of leftover AI hardware down.

Or completely different, you could have every AI unit left in the galaxy make a run for the nearest Exo-Galaxy Wormhole all at the same time. Then the post-game game becomes more of a shooting gallery for extra points where getting too greedy will get all your ships shot down by the passing AI convoy. I don't know, just tossing out random ideas. Maybe you could make it an optional mode, and leave the classic Conquest mode as is. Or have it pop up as an option when you kill the last homeworld. "You win! Consider your game completely finished now, well done! However, if you like, you can go on to clean up the galaxy in Extended Mop-Up Mode." (Except with a better name than that) I have no idea how much extra coding work this would take, or how much people would be interested in it if all that effort was expended. But I also don't know how to stop rambling about off-the-cuff ideas.

Offline Red Spot

  • Sr. Member Mark III
  • ****
  • Posts: 462
Re: How do conflicting AI types interact?
« Reply #11 on: January 07, 2011, 01:19:14 pm »
I think that suggestion would be pretty much imposible to program in a way it both works and does not wreck your game.
Randomizing the rest of the uni would likelly not be very hard, making sure that all AI-planets connecting your planets dont just move to your terf, or never do so, would be a nightmare balancing ... afaik*.
(*I do not know how this game is coded and I am far far from really experianced in programs like C++.)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: How do conflicting AI types interact?
« Reply #12 on: January 07, 2011, 01:29:57 pm »
Doing different stuff after the game is over is definitely something we'll consider in the future, but not for now.  Thanks!
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 soMe_RandoM

  • Sr. Member
  • ****
  • Posts: 250
Re: How do conflicting AI types interact?
« Reply #13 on: January 07, 2011, 09:03:13 pm »
So any two AI types will function correctly when combined together, essentially.

Teliporting turtle + grav driller

they conflict Lol
AI War - even the smallest units can make all the difference no matter how weak they are still quite capable of taking the hits. if it can Kill and receive damage then it worth its time other wise if it cant kill and cant take the damage for the higher surviving ships then it is worthless.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: How do conflicting AI types interact?
« Reply #14 on: January 07, 2011, 09:05:26 pm »
Lol -- when on the same planet, yes, they do. :)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!