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: Ship master AI scripting  (Read 5137 times)

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Ship master AI scripting
« on: December 12, 2013, 08:10:17 PM »

I have been considering and I would like to try my hand at improving it up to a level at wich it is actualy as smart if not smarter then the avarage human player.
Thus it has come to a demand

IMPART!!

for need I have to see the curent code lest I miss out bits it already has...

also no idea where that code is atm and i don't think making a chess master enemy AI using EvryFrameCombat would work well
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship master AI scripting
« Reply #1 on: December 12, 2013, 08:20:29 PM »

While that would certainly be nice, all of the major puzzle pieces are available; we can set AI targets, auto-aim AI, etc., etc.

So I'm not quite sure what it'd accomplish, other than finding out that Alex's code is very, very complicated (and probably fairly messy in spots where it's trying to deal with all of the special cases).

It'd probably make a lot more sense to try and develop an AI that was really good at one of the edge-case ships.  I think that it'd be both easier and more likely to improve upon the generalized system that Alex has built, both in terms of CPU efficiency and actual play.

For example, an AI that could drive a Sunder worth a darn would be worth having around.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: Ship master AI scripting
« Reply #2 on: December 12, 2013, 09:17:15 PM »

Or any broadside ships.

EDIT: I don't know if it's feasible, but achieving a better AI would be priceless.
Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Ship master AI scripting
« Reply #3 on: December 12, 2013, 09:18:04 PM »

AI that can use a broadside ship effectively would be wonderful.

Spoiler
[close]

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship master AI scripting
« Reply #4 on: December 12, 2013, 09:42:44 PM »

Broadside ships would be pretty tricky, largely because so many of them are irregular. 

The AI would have to count / weight the firepower on each side and know which side was strongest, amongst other problems.  That'd be a real challenge :)

Another AI challenge: decent formation AIs.  Getting ships to form a line of battle, for example, with all of the ships playing follow-the-leader or forming a wall centered on a particular ship.  Not sure if that could be done without resorting to a more-general "admiral" system that could pass objectives to individual AIs, however.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Ship master AI scripting
« Reply #5 on: December 12, 2013, 10:02:10 PM »

How practical would it be to make a broadside AI that is customized for a specific ship then?

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Ship master AI scripting
« Reply #6 on: December 12, 2013, 10:35:21 PM »

The AI would have to count / weight the firepower on each side and know which side was strongest, amongst other problems.  That'd be a real challenge :)

not really:
im using 8 directional (45deg arks) to determine the broadside domains

an array
float [direction 1-8][avarage range, firepower, reload total]
a single run calculation that cycles through a ships weapons and stores the data in the array (any weapon that covers the domains ark is added to field)

some kind of managment script for determining the "optimal" domain to point at the enemy/enemies:
curent facing,
time to turn,
reload state of the domain (a boolean [] array tracker would work here)
range to target

maybe a second array to handle long range weapons as a seperate array (for long/short range mixes ect)

feed that into a controller for ship manuverability and you are done


decent formation AIs:the hard bit, this is probably for a "chess master/admiral" level ai, not an individual ship ai tho
« Last Edit: December 12, 2013, 10:44:22 PM by dmaiski »
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

Flare

  • Admiral
  • *****
  • Posts: 906
    • View Profile
Re: Ship master AI scripting
« Reply #7 on: December 13, 2013, 04:30:34 AM »

Broadside ships would be pretty tricky, largely because so many of them are irregular. 

The AI would have to count / weight the firepower on each side and know which side was strongest, amongst other problems.  That'd be a real challenge :)

Would making the side of the ship the "front" work?
Logged
Quote from: Thana
Quote from: Alex

The battle station is not completely operational, shall we say.

"Now witness the firepower of this thoroughly buggy and unoperational batt... Oh, hell, you know what? Just ignore the battle station, okay?"

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: Ship master AI scripting
« Reply #8 on: December 13, 2013, 05:32:33 AM »

A good idea would be moving the ship front based on current weapons availability
Logged

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Ship master AI scripting
« Reply #9 on: December 13, 2013, 10:18:03 AM »

A good idea would be moving the ship front based on current weapons availability

I have to ask how?
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: Ship master AI scripting
« Reply #10 on: December 13, 2013, 10:21:12 AM »

A good idea would be moving the ship front based on current weapons availability

I have to ask how?

I have no idea :D. It would be cool if it was possible
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Ship master AI scripting
« Reply #11 on: December 13, 2013, 11:03:04 AM »

You could run the 8-arc code every few seconds, looking at the damage state of the Weapons :)

The other challenge with "broadside" AI is that you'd ideally want it to:

A. Only react to targets that are observable.
B. Be able to follow "go here" and "follow me" orders.
C. Dodge other ships.

Those things are all core-AI behaviors that pretty much any AI needs.  I'm not sure what, if any, tools we have right now for getting the Admiral-level orders, though.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Ship master AI scripting
« Reply #12 on: December 13, 2013, 01:58:04 PM »

A. Only react to targets that are observable.
B. Be able to follow "go here" and "follow me" orders.
C. Dodge other ships.

ive been thinking od using a tripple level ai for ships (assuming i can ever get even the basic ai to work)

teir 1: tactical AI (governs the short term operation of the ship (shooting, dodging, moving to point if given order))

teir 2: strategic AI (implemented through some form of evry frame script) manages the high level decision making like commander agrecivness, target prioritisation, general formation managment, deciding how to respond to an order...

teir 3: command AI (" ") manages the decision making for AI players such as giving orders via command points


just making a working tactical AI would be nice, but I am having trouble implementing even a basic AI script
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: Ship master AI scripting
« Reply #13 on: December 15, 2013, 01:50:13 PM »

I would be indebted to anyone who put together a better "engage" command.  ::)

Currently, I'll tell a ship to "engage" something, and then the AI captain goes "meh." Eventually it attacks my target, but only from a "safe" range and ends up dealing like zero damage lol. The target then shoots an LRM or something and all my ships run away in terror...

Ideally, I would push a magic "KILL THAT ----ER NOW" button and all of my ships would drop what they're doing, dive bomb the target, and blow its brains out at minimum range. If my ships explode and take the other guy with them, all the better. Tales of their bravery will be told for generations to come.
Logged

GenBOOM

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Ship master AI scripting
« Reply #14 on: January 28, 2014, 06:52:28 AM »

I know what you mean...
Spoiler


I wish I had this option as a last (defensive) resort.

<.< Kamekazi Training...?
[close]
« Last Edit: January 28, 2014, 07:09:05 AM by GenBOOM »
Logged