Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 4 5 [6] 7

Author Topic: Ship AI Q&A  (Read 27231 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #75 on: January 29, 2014, 04:11:36 PM »

Basically, all you need is to get the Player's currently-piloted ship via getPlayerShip() then get the target; if not null, then <do something>.  

It's not that this is hard to do (re-targetting is an inherent part of the AI, of course), I think it's just too much advantage to give to the player, since that gets around the Command Point system to a large extent.  

It would also have unintended consequences sometimes (for example, those fighters that were guarding a Nav Point have now abandoned their task, which also masked a nearby Carrier, which kept the fighters alive...), which, given that there isn't any way to customize fighters to ignore such things, might be a Bad Thing.  I feel that the Command system is really where that kind of thing should be done; the Target system is a pretty crude tool.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Ship AI Q&A
« Reply #76 on: January 29, 2014, 05:09:03 PM »

I'll be honest I never put skill points in command points, it's a useless system. I make do with the 3 points given rather well. Whether giving it's giving too much advantage to the player implementing that AI behaviour is something that would need to be tested - but hey it's would be a mod.

A player assist AI does get 'around' the command points part a little bit, however in really big battles - particularly mod fleets - do you want to be pausing combat every 5 seconds to issue the 'attack target' command with limited command points? Honestly? No.

What I generally do in Vanilla is split my deployed ships into 3 groups:
1. Principle attack group, with smaller frigates/fighters/bombers assisting a destroyer/capital
2. Another group as above
3. Support ships (carrier) sent to hover close to starting point.

And that's it. Once the enemy says 'defeated' I give the search and destroy command so all allied ships can attack at will and go at whatever speed they like. By having allied ship's moving in groups there is a higher chance of them engaging the same target.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #77 on: January 29, 2014, 05:45:39 PM »

Quote
A player assist AI does get 'around' the command points part a little bit, however in really big battles - particularly mod fleets - do you want to be pausing combat every 5 seconds to issue the 'attack target' command with limited command points? Honestly? No.
Ever watched Uomoz's stream?  Some players literally do that.  Personally, I find it abusive that the game goes into Pause every time you visit Command, simply because of the big boost to situational awareness it gives you.

Anyhow, that's basically just a simple feature somebody will have to figure out. 

I hit one more fairly-serious bug, though; of all things, the AI isn't handling Escape scenarios properly, presumably because the destinations aren't being set.  Will fix that one asap so that I can get back to polishing stuff up.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #78 on: January 30, 2014, 10:14:55 AM »

Tried out shield controls.  Major difference in survival for most ships that normally just got crippled by constant Overload, yay!

So now I just need to wrap up Escape, I guess, port over my changes to all of the different sub-AI variants... see about the Hull Mod thing... and then it's done.  Whew.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Tecrys

  • Admiral
  • *****
  • Posts: 596
  • repair that space elevator!
    • View Profile
Re: Ship AI Q&A
« Reply #79 on: January 30, 2014, 10:23:28 AM »

I've been following this thread for a while now and I have to say I'm amazed by the possibilities! Maybe in the distant future (when my mod is ready) we could work out an AI for my ships? If they will need it, I'll get back to you. First ma mod needs to be done, don't want to waste anyones time writing an AI for an unfinished mod.
Anyways, just some thoughts of mine while I'm borrd at work.
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #80 on: January 30, 2014, 11:12:45 AM »

Hrmm.

It appears that getting the state of the Battle Context and sensing when Escape is happening is going to be harder than I thought. 

In Missions, it doesn't appear to be working properly.  Not quite sure where I'm going wrong here.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: Ship AI Q&A
« Reply #81 on: January 30, 2014, 11:23:40 AM »

Added FleetGoal CombatFleetManagerAPI.getGoal(). For missions, for now, you could just set some static variables in a class somewhere and have the AI work off that. Obviously, this limits it to missions that you've tweaked to do that.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #82 on: January 30, 2014, 11:39:53 AM »

All right, that seems straightforward enough.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Ship AI Q&A
« Reply #83 on: January 30, 2014, 12:01:13 PM »

I'm not sure at what time you can sense the direction vector of enemy ships. But when it's an escape scenario, their vector is at first always north, always. When they're joining the engagement their vector is south towards the player.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #84 on: January 30, 2014, 02:11:47 PM »

Alex is basically just saying that I need to set up a singleton that can be accessed from the AIs and the mission code; not a big deal :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #85 on: January 30, 2014, 02:48:15 PM »

Done with that part; ships need to be given Retreat orders, though; they aren't getting it from the Escape scenario parameters.  I guess I could set that via the same singleton, but that kind of takes away all player choice, so I think I'll leave it alone.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship AI Q&A
« Reply #86 on: January 30, 2014, 09:16:55 PM »

Added:  if using ENGAGE / HARRASS / STRIKE / INTERCEPT orders, the AI shall focus on that target, even that means their doom.  It's pretty interesting, given that it takes away their leashed maneuvers around a target ship and gets them to truly focus.  

Has both good points and bad, in that you really can get Frigates to suicide-charge a Cruiser they have zero chance of defeating one-on-one, but they can defeat it if they all attack at once, at a loss.  For the AI Admiral (presuming I get around to writing one) this would be a godsend, I think, because the AI usually has a preponderance of numbers but does not focus well.

So I think I'm down to writing up a Hull Mod override system, then it's really ready.  Everything else appears to check out.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7221
  • Harpoon Affectionado
    • View Profile
Re: Ship AI Q&A
« Reply #87 on: January 31, 2014, 07:35:50 AM »

Hey Xenoargh - when you are done, would you mind writing up a short tutorial/blog post about the quirks of writing your own AI? From reading this thread it seems like you overcame a bunch of stuff.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Ship AI Q&A
« Reply #88 on: January 31, 2014, 09:15:19 AM »

Hey Xenoargh,

Would it be fairly simple to code an AI that targets allied ships? I'm looking into allied ship utility 'weapons' that can heal/buff friendly units.

It may need to come down to how the AI treats a particular weapon hint, as you may have a ship with both offensive as well as utility capabilities.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Ship AI Q&A
« Reply #89 on: January 31, 2014, 09:43:04 AM »

Oh here is another one, can you get the AI to fly backwards while retreating so their weapons are pointing at the engaging enemy?
Logged
Pages: 1 ... 4 5 [6] 7