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: Configurable AI  (Read 2989 times)

Oathseeker

  • Lieutenant
  • **
  • Posts: 67
    • View Profile
Configurable AI
« on: June 22, 2014, 09:46:28 AM »

First of all, this being my first post on this forum, I would like to praise Alex for creating this amazing game. Something along the lines of full scale fleet combat with rpg elements etc. is something I've been hoping would eventually be picked up, but it took about 10 years longer then I'd hoped! Thank god for indie games!

I have many ideas to hopefully help improve this game, but let's just focus on one for now: Configurable AI.
There have been many suggestions for AI tweaks etc, but what I'm proposing is more of a long term AI overhaul.
In a game like this no-one is going to be satisfied with the AI, even if it is amazing. This is because everyone likes to use different setups and playstyles. One way to adress this is by letting the player select different AI packages per ship. However this in my eyes is still not good enough. I propose a deeply configurable AI per ship.
How would one go about this? Simple, through an if/or/and command interface. Which allow you to configure your different ships for any and all situations and roles.

Let's give an example:

if [hull < 30%] then [retreat to waypoint Alpha] and [switch to missile support]
Which would send your ship back to wherever you designated waypoint alpha and start throwing out long range missiles when they get too low. Simple, but effective.
With a system like this you can quite easily configure your ships to complex tasks dynamically, from sending out bombers around the flanks to take out their carriers to having one ship strip shields with kinetic weapons and having another swoop in with high explosive shots to finish the job.

It also ties in quite well with the whole rpg aspect, as you could for instance unlock more command lines or different commands, for investing in the leadership tree. And, depending on how officers are implemented, specialized officers could have special commands only their ship can use.

Let me know what you think!
Regards, Oathseeker
Logged

Pax_Empyrean

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: Configurable AI
« Reply #1 on: June 22, 2014, 10:32:50 AM »

I take it you're suggesting that this would overwrite the ship officer system?
Logged

Oathseeker

  • Lieutenant
  • **
  • Posts: 67
    • View Profile
Re: Configurable AI
« Reply #2 on: June 22, 2014, 11:22:44 AM »

In my initial draft I included an introduction, explaining I've only discovered this game about 2 days ago (and nights, considering the fact that I'm so addicted I barely got any sleep). And apologizing if my knowledge on the game is lacking.
I removed at as it was boring and didn't seem to serve a purpose. Unfortunately now I regret removing it, seeing as I don't know what officers are going to be. Could you maybe point me to whatever article explains that?

Regards,
Oathseeker

EDIT: I'm having trouble finding a clear overview of upcoming features etc. Other then patchnotes and the dev log. (I'm assuming there is none, as obviously almost everything is subject to change anyway, but it does make it harder for me to know whats up without having been around to see it develop)
« Last Edit: June 22, 2014, 11:32:14 AM by Oathseeker »
Logged

Pax_Empyrean

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: Configurable AI
« Reply #3 on: June 22, 2014, 02:02:12 PM »

The idea as described so far is that you would get officers to fly your other ships, and their behavior would be a function of officer traits. A more aggressive officer would be more likely to close distance with enemy ships and pull back later, while a more skittish officer would try to keep his distance. It's not in the game at this point, and I have no idea how far along it is or how much it will change by the time we see it.
Logged

Oathseeker

  • Lieutenant
  • **
  • Posts: 67
    • View Profile
Re: Configurable AI
« Reply #4 on: June 22, 2014, 06:33:40 PM »

Ah, alright. I missed that. Also a vary interesting way of doing things.
Though it doesn't necessarily exclude my idea entirely. There are still many ways of being aggressive and many ways of reacting to situations. Perhaps different commands can be given to officers with different personalities. It's only realistic you get to encourage or restrict your officers strengths and weaknesses, any good admiral would ;)
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Configurable AI
« Reply #5 on: June 22, 2014, 08:03:32 PM »

Customizable AIs are already a thing; Vacuum features several custom behaviors including a sniper AI and a close-in brawler AI :) 

I think that it's likely that Alex will include this kind of feature in the Vanilla game in the future, as it's relatively simple to make the AIs behave a little differently in terms of "aggressiveness", etc., and it's mainly just a matter of finding the time to code it and polish it.

That said, if you're looking for a roadmap of "definite" features, there isn't one.  Each section of the game gets completed, adding more framework, but very little is totally set in stone.  There is no master GDD to check against here; Alex holds his cards pretty close to his chest about major features until they're operating and he's pretty sure about the direction he wants to take :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Oathseeker

  • Lieutenant
  • **
  • Posts: 67
    • View Profile
Re: Configurable AI
« Reply #6 on: June 23, 2014, 03:08:54 AM »

As I suspected in regards to features, can't blame him ^^

And yeah, I know of the vacuum AI thing. Unfortunately the AI is pretty bad in that, but that aside, it's clearly not what i was suggesting. There is a difference between being able to pick one of four default AI packages and being able to give complicated custom commands. This isn't a suggestion for a "quick fix" to the AI system that is in place now, but rather an idea that hopefully can at least inspire Alex in terms of where he's going in the future.
« Last Edit: June 23, 2014, 03:15:08 AM by Oathseeker »
Logged

Pax_Empyrean

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: Configurable AI
« Reply #7 on: June 23, 2014, 06:08:10 AM »

I initially wasn't thrilled with the limited control I have over my ships, but there is a method to this madness. By preventing you from micromanaging your ships, you are freed from the responsibility of micromanaging your ships, and optimal play isn't a matter of constantly pausing the game to update orders on the map. The somewhat independent AI behavior and the limited number of orders you can give in any battle are a deliberate design decision to keep you from doing second-by-second micromanaging of your forces.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Configurable AI
« Reply #8 on: June 23, 2014, 08:30:03 AM »

Quote
Unfortunately the AI is pretty bad in that
Really?  I think it works great, personally; it's certainly better than Vanilla's AI for Vacuum's gameplay.  But I'm a little biased, since I wrote it :)

Anyhow, in terms of "customizeable" AI... state-machine AIs for this kind of gameplay are pretty straightforward, but it all kind of depends on what you want it to do.  Gameplay is pretty simple, in terms of entity-entity relationships, but there are a lot of behaviors that aren't so simple.  Say, missile-dodging vs. using a weapon that doesn't normally do PD to shoot it down; this is something players do routinely, but it's hard to get an AI to make that decision correctly, and incorrect decisions can be a greater waste of DPS than not doing anything.  Or working with partners; this is something where a lot of things can go wrong, even if the logic makes sense; "stay close to me and shoot what I shoot at if you can" is usually pretty inefficient in Vanilla because of friendly-fire, but "wander around but help me if you can" can often get AI escorts for a human player killed; it's just how it is.

Without getting into a lot of detail, there are a lot of things where AIs won't be very "smart" no matter how you configure them, or can only be "smart" at the cost of a lot of computation per decision cycle, and they're still only "smart" in limited circumstances.  Which is why the Vanilla AI has so much trouble with most of the modded faction ships.

It's also why the Vacuum AI has a relatively small number of customizations; the core AI is reasonably robust, but it's not going to do certain things, like close for a kill, because generally speaking, kiting is safer, so I made it kite and circle-strafe and not bother being very fancy, because while that isn't always "smart", it's pretty efficient... and, for players who get to the end-game battles, with maybe 200-300 ships on the field, it's relatively cheap, computationally-speaking. 

But when you think about how you'd want to change an AI's behaviors, you either want the AI to be better at face-hugging, you want it to keep its distance and snipe, or you want it to be more careful about staying away from the enemy if it can (the Carrier AI) or you need it to do something real, real special (the Repair AI). 

There just isn't a lot of variety that will be more effective than the general-purpose behavior; with this kind of AI, you generally want it either to go one way or the other in terms of its main behavior, and a slider would just push it over the tipping-point either way.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Oathseeker

  • Lieutenant
  • **
  • Posts: 67
    • View Profile
Re: Configurable AI
« Reply #9 on: June 27, 2014, 04:29:31 AM »

Clearly no-one shares my view that this would be a cool system. I just figured since you basically have no control over your fleet (or at least you want to control them as little as possible because of the command points and the fact that you are so much more effective at killing *** then they are anyway). But if it's not even possible then the idea ends right there anyway.

Sorry for insulting your AI xenoargh, to be fair I've mostly tried the brawler AI, and it made my ships just wiggle back and forth while reversing out of the map most of the time. And if it didn't, they got so close they kept bumping into the enemy ships and died instantly whenever i blew up a capital due to the explosion. But you already pointed out it's quite hard to make them close in for the kill, which is what I wanted them to do. Also my computer is quite old and messed up, so might just not be working properly.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Configurable AI
« Reply #10 on: June 27, 2014, 08:06:38 PM »

Hey, it's cool; I'd be the first to say that the Brawler's a little rough in spots.  If you'd left me feedback about the problems you saw, I would have taken a look-see and fixed the specific stuff.  I'll probably take a look at these now :)

The Brawler AI's generally a pain in the rear to get right due to the getting-blown-up aspects, I agree; kind of hard to fix it but I might look at that and make it retreat if the enemy ship's Cruiser+ and hitpoints are low :)

On the general issues of what you've said- it's just hard to get AIs to be super-duper customizable in a way that will actually improve them much; it'd probably be possible to have a few context switches that changed behaviors and some sort of distance / kiting slider, but it's hard.  

The Brawler AI's one example of the problems with the concept; if you tune a ship to stay close, then it raises all the problems of face-hugging, which is an issue in Vanilla as well as in Vacuum.

Personally, I'd really like the Vanilla AI to do a "better" job of flying in formations and fighting defensively to hold an area, rather than wandering all over the place.  But that's tricky, too; sometimes following orders will just get the ships killed.  I'd sure be nice to be able to get them to fly in line abreast formations, though, so that they'd max out their initial firepower and encircle enemy fleet groups, but I really think Alex is done messing with the core AI until the RPG stuff is done :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Oathseeker

  • Lieutenant
  • **
  • Posts: 67
    • View Profile
Re: Configurable AI
« Reply #11 on: July 01, 2014, 05:37:30 AM »

To be honest, since I'm fairly late to the starsector party I expected these obvious flaws in the AI to be known. And as the only thing I know about code is roughly what it looks like, I really can't give any insights into improving it ;)
To be fair to you though Xenoargh, the way vacuum plays is amazing, Though I found it quite hard to get into because the customization options where a bit overwhelming, that's also the reason I stuck with it. Because I saw the potential that was there, if only I understood how to use it ;)
Unfortunately my computer can't handle it and it slows down to a crawl as soon as there are more then 5 ships in a battle. But that's hardly your fault ;)

I just always thought the "if/or/and - then" system seemed like a great idea to configure an AI in a meaningfull way so you didn't have to bother micromanaging in combat. Someone brought up a great point earlier about the limited battle command system being a good thing. And I completely agree, not having to micromanage your entire fleet is a good thing. It means you can focus on your own ship and increase your personal impact on the battle.

The first Dragonage did something like this. Though in a fairly limited way (the command options were fine, you just couldn't give vary many of them to each of your character)

But that's hardly a fair comparison. Dragon age is a game with a huge budget and even though its a vary deep rpg, each of the characters are fairly limited in the different roles they can play. Mages cast spells, warriors tank and rogues kick ass. And if they need to reposition they can just instantly walk there.
An ideal AI in starsector would have to plan their positioning based on incoming ships, missing ships, turret arcs etc. Something most humans will struggle with. Positioning is what it's all about in most games. But it's also what computers are worst at. So I can imagine making a really good AI will be near impossible.

That being said, there are still many things that could be configured. One thing that comes to mind is for instance: shield priorities. When a ship is about to explode in your face, focus on shielding that off instead of some random anti fighter missile coming in from the back. And when a huge torpedo is making its way to the engines, better focus on shielding that off instead of the PD lasers those pesky fighters are firing at you.

Other expamles could be:
Missile timing and targeting
fighter and bomber target selection
when to use phase cloak
Frontal shield management (The AI tends to use the shields the same way it would an omni shield and turn it off all the time, even if it's a 360 degree coverage)


Now again, I don't know if these are feasable at all, just throwing ideas around :)
Logged