Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Combat AI Tweaks  (Read 4676 times)

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Combat AI Tweaks
« on: December 16, 2012, 06:18:10 PM »

As far as I can tell, this issue hasn't been brought up in this particular area. I've seen it being posted elsewhere, with varying arguments for and against it, but not in an "official" suggestion as this is. If this is the case, then that thread may be better. For now though, I shall speak out here.

If I may begin my point by saying that I do not think that Starfarer's AI is bad by any definition of the word, quite the opposite in fact. It is a massively refreshing change to see a system where computer controlled opponents use such variety of tactics, and mutual support for fleet assets. However, there are some "token AI" thinks that still make things clear that the foe isn't a thinking being.

   Most apparent of these to me, is the omniscience of the AI in terms of the player's weapon range. That is, they always know exactly how far away to stay from your weapon arcs as to remain safe. What I suggest is that said knowledge of the weapons be changed slightly, so that they know only roughly the range of your longest range weapon, and the arc, to say a 20% tolerance either way and to take into account the rotation speed of the weapon as well (this is most particular to the speedy ships, such as fighters or Hounds). If "mistakes" such as these can be created, it would go a long way to making combat much more immersive and reduce the obvious nature that you are playing against not an enemy commander, but a machine.

Right now, I only have that one suggestion on my mind, however they may be more later, there may not. I know that AI tweaks may not be an easy thing to do, less so for tweaks to emulate "human" behaviour. Regardless, it is still a suggestion and I would like to have it at least out on the table.
Logged

BillyRueben

  • Admiral
  • *****
  • Posts: 1406
    • View Profile
Re: Combat AI Tweaks
« Reply #1 on: December 16, 2012, 07:24:58 PM »

Most apparent of these to me, is the omniscience of the AI in terms of the player's weapon range.
I'm a little on the fence about this issue. I'd almost prefer that the AI keeps that ability, if only to level the playing field.

Two big problems I'd like to bring up are:

A) AI fleet composition - The AI never seems to have a good mix of ships. A little fine tuning in the variants and fleet compositions could go a long way in making the late game AI a lot more difficult.

B) Admiral AI: Reinforcements - The enemy AI always seems to deploy the small ships first. This isn't a bad strategy, but it is very predictable, and a player can usually crush the weaker ships before the bigger ships get in range. I would like to see the enemy ships stay a little closer together upon entering the battlefield, and maybe deploy a mix of heavy and light ships.
Logged

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4403
  • Eschewing obfuscatory verbosity.
    • View Profile
Re: Combat AI Tweaks
« Reply #2 on: December 16, 2012, 07:32:54 PM »

This was brought up three days ago:

The only quirky thing about Ai I dislike is their uncanny ability to know exactly how far your weapon range is, if you have an itu, they stay out of it's range, if you have only machineguns, they stay out of it, ( unless you did the right thing and put it on a faster ship)

It's one of those AI-knows-all things sorta like how older games ai could see through the FoW

Well, that info is available to you too. You can see the enemy ship's stats (including hullmods) by mousing over the selected ship's schematic in the command UI - so, this is something I see as perfectly fair. After a while spent playing, you yourself also know what ranges to expect out of the enemy ships.


I really don't mind that the AI is a bit more aware in that area, the player has many other advantages. If there was one thing I could change about the AI, I would give it a short time memory and the ability to change it's tactic in reaction to the player's behavior. It's a bit immersion braking if the same stupid trick works five times in a row. But I don't see any easy way to give it the ability of pattern recognition, so whatever.

« Last Edit: December 16, 2012, 07:38:35 PM by Gothars »
Logged
The game was completed 8 years ago and we get a free expansion every year.

Arranging holidays in an embrace with the Starsector is priceless.

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Combat AI Tweaks
« Reply #3 on: December 16, 2012, 07:46:40 PM »

Because the player may have the information available, doesn't mean that they'd be able to dance right at the edge of the weapon arc like the AI do. The suggestion isn't to stop them knowing the range, but more to be a bit more rough in the guessing of where the range of the weapon is, making corrections when being shot at, and inching closer when not being shot at. That kind of thing
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Combat AI Tweaks
« Reply #4 on: December 16, 2012, 07:56:19 PM »

Hmm. Right, I don't think it's "unfair", but I think the point here is somewhat different - it's not that the AI knows it is a problem, but that its behavior of never messing this up is very ... AI-esque, let's say.

This is tricky, though. If you know the AI will make a certain mistake some percentage of the time, or in some specific circumstances, abusing that becomes a strategy - for example, with Hounds, you could slowly whittle them down over time just due to them misjudging the range over and over again. I also suspect that implementing this would lead to threads in the bug reports forum pointing out that the AI doesn't "properly consider weapon ranges" :)

So, I don't know. This is hard - on the one hand, you want to avoid doing anything obviously automated-looking. On the other hand, players know it's an AI, so they also have the expectation of it not making the kind of "obvious" mistakes that it'd be simple for an AI not to make. Especially if these can lead to the loss of friendly ships.

I think the AI gets looked at with a much more critical eye than one's own play, because there's no escaping knowing that it *is* an AI.

That's not to say I'm not open to suggestions - actually, I really hope you guys offer some, and continue to provide feedback on what bugs you about it. Having the AI be good is extremely important to me, and oftentimes it's hard to look at what it's doing objectively, having spent so much time with it.

If there was one thing I could change about the AI, I would give it a short time memory and the ability to change it's tactic in reaction to the player's behavior. It's a bit immersion braking if the same stupid trick works five times in a row. But I don't see any easy way to give it the ability of pattern recognition, so whatever.

Could you point out the specific tricks? Just fixing those up could be the easier way to go (I also don't see an offhand way of doing anything resembling learning - that's extremely problematic, even if it was actually successful.)

By the way - the "turn around to lure frigate in" trick should no longer work.


A) AI fleet composition - The AI never seems to have a good mix of ships. A little fine tuning in the variants and fleet compositions could go a long way in making the late game AI a lot more difficult.

Fair point, though I don't think that's really related to the AI.

B) Admiral AI: Reinforcements - The enemy AI always seems to deploy the small ships first. This isn't a bad strategy, but it is very predictable, and a player can usually crush the weaker ships before the bigger ships get in range. I would like to see the enemy ships stay a little closer together upon entering the battlefield, and maybe deploy a mix of heavy and light ships.

Right... yeah. I'd like to have the campaign take shape before really messing with this very much. The same really goes for the fleet compositions issue, too.
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Combat AI Tweaks
« Reply #5 on: December 16, 2012, 08:00:51 PM »

If it's about having the AI possibly being abused by making these mistakes, then how difficult would it be to try and get the AI to use the same tactics against the player? Or on an even more unreasonable level, some kind of "learning" AI, that on a savefile basis takes on lessons on what the player does and adapts its own strategies to match, though only against tactics where the player came out on top, and there were enemy ships that managed to retreat (though that again is mostly for an immersion standpoint). While it would be a very nice thing to see, I'd understand fully if such things are getting to the more... ambitious side of the fence :P
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Combat AI Tweaks
« Reply #6 on: December 16, 2012, 08:15:25 PM »

Yeah, that's entirely unrealistic, for numerous assorted reasons :) Things like divining the intent behind the player's actions (or risking learning the wrong lesson), the number of opportunities to learn being woefully inadequate to produce useful results, and the questionable desirability of having the AI behave differently in different savefiles, etc.

If it's about having the AI possibly being abused by making these mistakes, then how difficult would it be to try and get the AI to use the same tactics against the player?

The AI already tries to punish player mistakes and tries a few occasional tricks to get them in a bad spot...

But more importantly, I don't understand how this would make AI mistakes any less abusable, if that's what you're saying. My apologies if I misunderstood.
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Combat AI Tweaks
« Reply #7 on: December 16, 2012, 08:23:32 PM »

Well, I was more meaning since it's a given that players will abuse faults in the AI's tactics, since that in itself is an aspect of superior tactics: using the adversary's weaknesses to your own advantage. What I was saying in the last post of mine was that the AI try the same trick, finding patterns in the player's working, and punish them for falling into said pattern. Since creating a truly flawless AI would be as much a gamebreaker as an AI riddled with faults and held up with stat boosts and the like (which very thankfully isn't the case here), having one that still makes the occasional mistake and a less accurate gauging of ranges and the like would help things along. Really, even if the ships stayed a bit further out it would look better, as opposed to staying literally pixels out of the onscreen arc, since erring on the side of caution tends to be the way that the AI works towards when possible
Logged

Jazwana

  • Commander
  • ***
  • Posts: 108
    • View Profile
Re: Combat AI Tweaks
« Reply #8 on: December 16, 2012, 10:07:23 PM »

one AI behavior that I find irritating is that ships with shields will wait UNTIL they get damaged by a floating hulk / asteroid and THEN raise the shields...after they've bounced the object away on a new trajectory.
Logged

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4403
  • Eschewing obfuscatory verbosity.
    • View Profile
Re: Combat AI Tweaks
« Reply #9 on: December 17, 2012, 10:40:29 AM »

So, I don't know. This is hard - on the one hand, you want to avoid doing anything obviously automated-looking. On the other hand, players know it's an AI, so they also have the expectation of it not making the kind of "obvious" mistakes that it'd be simple for an AI not to make. Especially if these can lead to the loss of friendly ships.

That is true for any medium, it's the mediums responsibility to make the consumer forget what he knows. That's what immersion is all about. That actually happened several times for me in Starfarer, for example the first time a escorting ships jumped obviously purposefully between overloaded me and the enemy to save my ass. Great feeling :)

If you are seriously intend on making the AI even more immersive (rather then spending that time on the campaign layer), I think that simulated learning is the way to go. Even if it costs some AI performance it will be worth it. Learning is THE behavioral aspect that we associate the most with intelligence, if you can convince a player that his opponent just learned something that will surely baffle him. That's something I for one have never seen in any videogame.

There's a reason for that obviously, it's fracking hard to do. I think it would serve the game better to improve campaign aspects (...first).
I have some ideas how learning could be simulated anyway:

1) Make several values deviate from the optimum at the start of an encounter. Let them slowly return to optimum as the (direct) battle goes on.
That could lead to a situation where I get a ship to overload/slip shots past its shield/fire weapons too early/etc. with a certain tactic once, but not a second time.  

2) Give the AI several pre-programmed behavior sets and let it switch after certain trigger events. You already do that, but only in respect to the ships own status like missile count or hull integrity (which works really great btw). You could expand that to preemptive triggers like
- ratio of inflicted damage on AI ships VS enemy ships in comparison to expected ratio (from a table)
- number of certain events within a certain time span (overload, venting, engine damage ) VS expected number
- time an enemy is outside weapon range/AI ship is within enemy weapon range
- Hit ratio on enemy target with weapon x above distance x


Could you point out the specific tricks? Just fixing those up could be the easier way to go.

There were dozens, but most only work with a specific ship combination so I forgot them again. There's often behavior involved that is completely reasonable in most cases, but has this one tactic with this one ship that can exploit it. I will open a new thread for that, see what others find.
« Last Edit: December 17, 2012, 10:52:27 AM by Gothars »
Logged
The game was completed 8 years ago and we get a free expansion every year.

Arranging holidays in an embrace with the Starsector is priceless.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Combat AI Tweaks
« Reply #10 on: December 17, 2012, 11:12:15 AM »

Hmm. Good points, all. I like the "triggers" idea in particular - a wide enough range of those could simulate learning - or at least a higher-level response to changing circumstances - effectively. And, like you said, there's already an example of it working, which is always encouraging when considering something theoretical :) Yeah, really like it.

If you are seriously intend on making the AI even more immersive (rather then spending that time on the campaign layer), I think that simulated learning is the way to go.

The campaign definitely takes priority. Honestly, the AI has probably been "good enough" for a while, but I just can't help tinkering with it.

There were dozens, but most only work with a specific ship combination so I forgot them again. There's often behavior involved that is completely reasonable in most cases, but has this one tactic with this one ship that can exploit it. I will open a new thread for that, see what others find.

I think this is probably a good thread for it, since that seems to be what it's all about.
Logged

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4403
  • Eschewing obfuscatory verbosity.
    • View Profile
Re: Combat AI Tweaks
« Reply #11 on: December 17, 2012, 12:48:32 PM »

Hmm. Good points, all. I like the "triggers" idea in particular - a wide enough range of those could simulate learning - or at least a higher-level response to changing circumstances - effectively. And, like you said, there's already an example of it working, which is always encouraging when considering something theoretical :) Yeah, really like it.

 :)

I think this is probably a good thread for it, since that seems to be what it's all about.

Mhh....no. I'm a rebel! Haharr!
Seriously though, I was thinking it might become a bit like the Typo thread, and that would not happen here I think.





Logged
The game was completed 8 years ago and we get a free expansion every year.

Arranging holidays in an embrace with the Starsector is priceless.

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Combat AI Tweaks
« Reply #12 on: December 17, 2012, 01:00:34 PM »

Well, this thread IS the combat AI tweaks thread after all. For making the AI seem more "real". Removing the little exploitable quirks is just one way to achieve that, no? :)
Logged

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4403
  • Eschewing obfuscatory verbosity.
    • View Profile
Re: Combat AI Tweaks
« Reply #13 on: December 17, 2012, 01:20:44 PM »

Well, this thread IS the combat AI tweaks thread after all. For making the AI seem more "real". Removing the little exploitable quirks is just one way to achieve that, no? :)


Mh, this thread seemed like a broader discussion thread about AI, not a exploit report thread. The idea was to lower the barrier of reporting minor things like in the Typo thread. And after all we did not talk about a single trick/exploit till now, it seemed a bit like re-purposing your thread to ask people to report them here. I don't really mind either way, though.
Logged
The game was completed 8 years ago and we get a free expansion every year.

Arranging holidays in an embrace with the Starsector is priceless.