Author Topic: How About An Evolving AI Personality?  (Read 6157 times)

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
How About An Evolving AI Personality?
« on: February 20, 2015, 09:17:11 pm »
I love this game.  Period.

I love playing it.  When I don't have time, I love dreaming about it.  I love reading about it.  I love everything about it.

With that out of the way, we often discuss different AI personality types.  I've found myself trying to tackle certain personalities in a game, trying to 'figure it out'.  To really make things a complete and utter mess, I was pondering the idea where the AI gets to change his 'type' as the game progresses.  First you're tackling a turtle then suddenly (or through some particular event) the AI changes to a SF or something.  That would really keep you on your toes having to readjust your strategy.

Its very likely this idea has been posted before but I was unable to find it in a cursory search.

What do you think?

Offline Zebeast46

  • Full Member Mark III
  • ***
  • Posts: 219
Re: How About An Evolving AI Personality?
« Reply #1 on: February 20, 2015, 09:21:34 pm »
It is a good idea, and one that should probably be suggested on mantis
AI 1 = Chris.

AI 2 = Keith.

Taken from Bognor

Offline motai

  • Jr. Member
  • **
  • Posts: 52
Re: How About An Evolving AI Personality?
« Reply #2 on: February 21, 2015, 12:31:32 am »
would be awesome if each ai switched traits each ai level :) if you dont like what it switched to then progress reduce and try again :P.

or a new evolving ai type that has 1 ai type for each ai level so if you push it far enough ti would have 4 or 5 types. nice and evil

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
Re: How About An Evolving AI Personality?
« Reply #3 on: February 21, 2015, 10:35:05 am »
It could be implemented with a LOT of flexibility.

Options:
1.) Random AI (once <criteria>) (all types)
2.) Random AI (once <criteria>) (random x# of types)
3.) Random AI (once <criteria>) (user specified types; sequential or random)

and <criteria> could be
1.) An incremental amount of AI levels
2.) A particular in-game event
3.) An in-game milestone
  a.) Certain # of planets taken/neutered
  b.) Certain # of units destroyed
  c.) Certain tech gained

I'm just brainstorming but I think you get the idea.

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: How About An Evolving AI Personality?
« Reply #4 on: February 21, 2015, 12:21:44 pm »
The issue is that some AI types spawn structures that are placed at map gen.  Such as raid engines, alarm posts, gravity drills, and so on.

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
Re: How About An Evolving AI Personality?
« Reply #5 on: February 21, 2015, 12:26:44 pm »
So only replace things that haven't been discovered and/or aren't currently 'engaged' in combat.  Include a countdown timer to AI personality switch or something.

Offline Toranth

  • Hero Member Mark III
  • *****
  • Posts: 1,244
Re: How About An Evolving AI Personality?
« Reply #6 on: February 21, 2015, 12:30:02 pm »
The issue is that some AI types spawn structures that are placed at map gen.  Such as raid engines, alarm posts, gravity drills, and so on.
While I think that would be fairly easy to fix so that the map-gen stuff could run mid-game, I think gameplay-wise it wouldn't be much fun.

Can you imagine if partway through the game, the AI became a Raid Engine type, and suddenly all your planets are receiving waves every 4 minutes?  Or a Backdoor Hacker that pops up out of nowhere (especially if Exowaves were on)?

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
Re: How About An Evolving AI Personality?
« Reply #7 on: February 21, 2015, 12:45:58 pm »
The issue is that some AI types spawn structures that are placed at map gen.  Such as raid engines, alarm posts, gravity drills, and so on.
While I think that would be fairly easy to fix so that the map-gen stuff could run mid-game, I think gameplay-wise it wouldn't be much fun.

Can you imagine if partway through the game, the AI became a Raid Engine type, and suddenly all your planets are receiving waves every 4 minutes?  Or a Backdoor Hacker that pops up out of nowhere (especially if Exowaves were on)?

That's why you make it extremely customizable!

Offline sk_2013

  • Newbie Mark II
  • *
  • Posts: 21
Re: How About An Evolving AI Personality?
« Reply #8 on: February 24, 2015, 11:51:50 pm »
I'm not sure that "making it extremely customizable" is the greatest option, nor does it make a great deal of sense (I'm not sure what you'd be customizing). If you were customizing the AI, wouldn't that kind of defeating the point of making it adapt to the player?

I like the idea of allowing the AI to adapt its personality to try to better combat the player, but to be honest, I'm not entirely certain how one might do this.

Suddenly finding planetary cloaks or raid enginers or modular fortresses would be beyond irritating. On the other hand...

How about a new "Variant" AI type, that occasionally drops the ability to produce new ships, structures, etc. in favor of new ones, possibly by keeping track of what it knows the player has and occasionally dropping its weakest unit. Alternatively, if it detects that exogalactic waves or CPAs are doing a dispreportionate amount of damage, allow it to cut back on wave sizes, possible commit part of a wave to threatfleet, and put part of it into the strategic reserve, and trigger Exos more often. Alternatively, if a wave is being extremely successful in taking out its objectives, let the AI launch whatever CPA or Exogalactic forces it has to help supplement the attack. I'd be in favor of an AI type like this having more special forces and alarm posts than usual.

To attempt to put some sort of pseudo logic (I can't use the language used for AI programming worth a damn, so this will be bad) -

if(shipreplace == true) # This would probably run the most commonly
     select poorest preforming ship type #(non triangle ships)
     cancel production of ship type
     select ship type with characteristics, weighted by what ships are successful and what aren't. #(This will probably be most effective when schitzo waves are off)
     replace 1/2 of ships of old type with new type #(Keep a few of the old ships around, so the AI can gauge its comparative effectiveness)

if(chokepointed == true) #(If threatfleet reaches a large size, but can't attack, open up its options)

Select from the following weighted list   
          Build Warp Relay at AI Tech level*random-1 planets from choke point #(instead of jumping deeper into player space, this AI will occasionally try to place warp relays deeper into its own space, aiming for a single jump past the player's 'whipping boy' world.
          if(chokePlanet has unguarded player wormholes)
               1/2 of Threatfleet attempts to pass by the planet without engaging (even if it takes some losses, rest of fleet waits to see if an opening appears. This might work like giving it an exo objective)
          Sacrifice a portion of threatfleet to build a series of raid guardians, attempt to use the threatfleet as cover for the guardians to reach their target (send threatfleet early?) #(I don't actually like this one, as it leans a little to close to the territory of player behavior)
          Build a Raid engine 2 jumps from the chokepointed world #(must be 2 jumps from player space)
          Build a superfortress, ion, or black hole machine on planet bordering player activity (threatfleet goes on guard at that planet, attempting to contain the player)
          Use strategic resources (special forces, strategic reserve, etc) to bring the AI's strength high enough to counter the planet + nearby mobile player assets
          Low Chance of CPA deepstrike

if(ReinforcementCalc == true) #Ideally, this will trigger very rarely
          shift points between the reinforcement and wave multipliers, depending on what's been more effective. #(this one I'm not sure on, I want the ai to be able to shift somewhat, but I'm not sure how to accomplish making the AI more aggressive to counter player weakness)
          Initial multipliers should be reduced to account for this personality being an irritating, unpredictable bastard, which will make it harder on the player

if(TimeToAdapt == true) #Planet handling?
          if this has not yet run, run a check of "major" ai structures near player planets. Keep a running count of all objectives and playerships killed as a result of these objects. (raid enginer would be per wave and anything that's killed on that planet, cloaks would be by planet, eyes would be by their own kills, etc.)
          #Ideally, there will be a disproportionately large number of such structures within middling range of the player, so they're forced to deal with them. Unfortunately, it doesn't fix the problem of the player saying 'hug that' and avoiding worlds that seem particularly nasty.
         if it has run, select the most dangerous item to the player (per cost to the AI), and place one somewhere inconvenient (core world? Chokepoint?)
         if it can't decide, select an item with as few similar characteristics to what already exists


Arcen guys, I'm pretty sure all that was useless, but I wasn't sure how else to get the idea across. (Not sure how feasible it would be to implement either).

The idea, for lack of a better term, would be similar to a genetic algorithm that constantly attempts various random options. If something seems to be an improvement, the AI will capitalize on that, if something seems to be doing particularly poorly then switch to something particularly off balancing. In the cases of medic frigates and shieldbearers, effectiveness should probably be judged by opportunity cost (so possibly selecting a new item, switching to it, and if fleet effectiveness falls, switch back). Structures like gravity drills could possibly be calculated by their chance of helping the player (if the player has a fast, teleporting fleet, grav drills are expensive, if the player is slow anyway, the drills can actually have negative "cost" and allow the AI to trade for a superfortress or something. Call it 'logistical support'. [since they'll help a slower moving player more than the AI]).

Other thoughts: Possibly have this AI randomly select one of three or four personalities for mk III and IV worlds, then compare the player's relative effectiveness against each one (measure AIP, ships lost, time spent on planet perhaps). Less effective personalities get removed and new ones added. Weight the system so that the oldest AIs have the greatest chance of influencing a higher level planet (so in theory, the core worlds should be ideally fit to make the player's life difficult).

Sorry if this is somewhat rambling.

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
Re: How About An Evolving AI Personality?
« Reply #9 on: February 26, 2015, 08:13:42 am »
I'm not sure that "making it extremely customizable" is the greatest option, nor does it make a great deal of sense (I'm not sure what you'd be customizing). If you were customizing the AI, wouldn't that kind of defeating the point of making it adapt to the player?

"Adapt" != evolve.

Not necessarily anyway...  The idea stemmed from this thread (http://www.arcengames.com/forums/index.php/topic,16929.0.html) on what the most scary AI imaginable would be for you.  There were many great responses that made me shiver in my chair but then I got to thinking... what is even worse than a Shadow Master/Grav Driller?  Answer?  A Shadow Master/Grav Driller turned Shadow Master/Train Master turned Stealth Master/Scorched Earth.  Even better if you didn't know exactly what sort of personality was 'coming'.  Now THAT would be a nightmare.

Given the multitude of AI types as it is, a randomized evolution may not be appealing for some people as the change may be a step backwards in terms of difficulty.  This is why I proposed a flexible form of customization.  Allow the player to make a bank of personality types to fulfill their inner most masochistic desires to make the game even more challenging.  Allow for some set, random, or customizable options on WHEN the AI gets to evolve in-game.  In-game events that trigger evolution would make for an interesting set of decision-making for the player.

I'm not all on the up-and-up on how this might be implemented... obviously personality types will change not only how the AI behaves but what it has to work with.  If switching in-play units was difficult you could just limit the switch to non-engaged planets or even undiscovered planets... but I leave that to the people who understand how the engine works.

Offline sk_2013

  • Newbie Mark II
  • *
  • Posts: 21
Re: How About An Evolving AI Personality?
« Reply #10 on: February 26, 2015, 09:46:46 pm »
I know it's possible for the AI to sacrifice, change units, etc. The mechanic already exists with Zenith traders and carriers, so it shouldn't be particularly difficult. (Also, your examples for AI evolution are disgusting. You should write horror.)

I actually had an idea on how to solve this without that disaster I posted above. (I also got really excited about it and posted it on the idea tracker here:  http://www.arcengames.com/mantisbt/view.php?id=16129)

TL:DR;

Every AI type can be said to be on a sort of RGB color spectrum: Aggressive, Defensive, and Technological.

The Mad Bomber and Vicious Raider are both extremely aggressive. The Starfleet commander and Spire Hammer are somewhere Aggressive leaning technological, the Vengeful is aggressive leaning defensive.

The Everything and Golemite are kings of Technology. The Teleport Turtle would be technological leaning defensive, the Attritioner, Vorpal, and Warp Jumper would be technological leaning agressive.

The Turtle would be entirely defensive. As it leans aggressive, you see the fortress king, Tag Teamer, and the Retalitory. Leaning Technological, you see the Radar Jammer, the Neinzul Nester, the peacemaker, and the one-way doormaster.

An AI that starts out as a turtle, for example, would have a ADT score of 0:1:0, to show a 0 on aggression, a 1 on defensive, and a 0 for technology. As AIP increases, it slowly randomly adjusts those numbers. When it reaches a new tech level, let's say the new ADT score is (.09):(.84):(.27). This would hypothetically correspond to the "radar jammer". (This process would continue as the game progressed).

If you wanted to get fancy, you could have player actions like capturing fabricators or neutering planets affect the pseudo-randomness, but that would by no means be unnessessary. The "In Game Triggers" that you mention could also be factored in - for example, the capturing of an Advanced Factory or ARS could cause a cycle. (That occurs to me now as I write this, I didn't put this in the idea log. Probably should have come here first...)

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
Re: How About An Evolving AI Personality?
« Reply #11 on: February 27, 2015, 07:36:37 pm »
(Also, your examples for AI evolution are disgusting. You should write horror.)

Ha.  I'm definitely not a creative writer.

But that's the thing about making this feature customizable.  If you want to face even greater challenges, you have that option.  If you're someone like me who only wants a slight increase in challenge, I can custom tailor the approach to how the AI reacts in a given game.  I think it would make for a really nice expansion where you sort of market it as a 'smarter AI'.  The original AI tagline is the following: "“You are outgunned. You are massively outnumbered. You must win.”  Now its... "The AI is back... and its evolving." 

Could make for a really cool expansion and trust me I'd snap it up in a heartbeat.

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: How About An Evolving AI Personality?
« Reply #12 on: February 28, 2015, 11:48:26 am »
I love this game.  Period.

I love playing it.  When I don't have time, I love dreaming about it.  I love reading about it.  I love everything about it.

With that out of the way, we often discuss different AI personality types.  I've found myself trying to tackle certain personalities in a game, trying to 'figure it out'.  To really make things a complete and utter mess, I was pondering the idea where the AI gets to change his 'type' as the game progresses.  First you're tackling a turtle then suddenly (or through some particular event) the AI changes to a SF or something.  That would really keep you on your toes having to readjust your strategy.

Its very likely this idea has been posted before but I was unable to find it in a cursory search.

What do you think?


I think we had a discussion a while back on AI personalities learning but not necessarily changing the rules in the middle of the game. If I remember right, we are talking about emergent AI and not learning AI, if that's what you mean by evolving.


But hey, I like the idea of changing the rules in the middle of the game. All for it.
Kahuna strategy guide:
http://www.arcengames.com/forums/index.php/topic,13369.0.html

Suggestions, bugs? Don't be lazy, give back:
http://www.arcengames.com/mantisbt/

Planetcracker. Believe it.

The stigma of hunger. http://wayw.re/Vi12BK

Offline LordStryker

  • Newbie Mark II
  • *
  • Posts: 18
Re: How About An Evolving AI Personality?
« Reply #13 on: February 28, 2015, 12:48:29 pm »
I think we had a discussion a while back on AI personalities learning but not necessarily changing the rules in the middle of the game. If I remember right, we are talking about emergent AI and not learning AI, if that's what you mean by evolving.

But hey, I like the idea of changing the rules in the middle of the game. All for it.

The root of the idea is to have an AI that simply changes throughout the game via some trigger(s).

"Evolution", "Learning", or "Adaptation" of the AI would be an added bonus if we could come up with some slick ways to implement that.  But it would be a shame to pass up the opportunity to have built-in customization for how we approach this idea.  Lets have some predefined ways of evolving the AI but lets also give the player the opportunity to do so the way they want.  I think this last bit would be trivial to implement.

I have no problem playing against a Turtle AI (or whatever) in a game but once you 'figure out' how to approach a certain type of personality, things can get a little redundant.  But we can remove the redundancy if we can switch it up during a game and it could make for some really interesting results for the player.

Offline sk_2013

  • Newbie Mark II
  • *
  • Posts: 21
Re: How About An Evolving AI Personality?
« Reply #14 on: March 02, 2015, 09:19:39 am »
Hm... Given some thought, I think you might be onto something with the customizability.

Given my idea (as an example), you could potentially change the frequency of personality changes - From "On AI tech level" to "On major events", potentially ranging to on events such as changing reaction level to hacking or even changing personality every X minutes.

Furthermore, you could potentially weight the system, telling it "I want you to start out passive but get increasingly aggressive", which would weight the game to start with a defensive AI and weight the RNG for 'drift'.

Hm... I'm not sure how far to take this customization... There are a lot of options, but part of what makes AI War what it is is the unpredictability of the AI...

I'm not sure how calculation intensive the current system is for how the AI selects ships to counter the player. Given that, I'm not sure how difficult or easy adding actual adaptation would be.

Blind evolution though? That could probably be done rather (comparatively) easily.