Search Unity

AI for Spaceships, which Asset?

Discussion in 'Getting Started' started by matzomat, Nov 27, 2019.

  1. matzomat

    matzomat

    Joined:
    Mar 4, 2018
    Posts:
    9
    Hey Guys,

    I'm a little lost. Fopr days I've been reading about behavior trees and AI in Unity. I also already wrote my first State Machine and I love the "Plugable AI" tutorial on Youtube. But... I figured I will need some help.

    My goal:
    I want to make spaceships have a mission that the player can select (he will have hundreds of ships) like: Go to Station X, collect the Gas, take it to station Y and unload. Go back to station X. Now such a ship might get attacked and might need to defend itself or call for help. Also that old coffee machine on the bridge will need a replacement soon, the hull has seen better days and so on. With my little brain I know I will need some visual scripting to get this running. I tried Bolt a while ago but it turned out that cutting it out of a project later on is quite a hassle. So which AI would you guys suggest that can

    1. Handle complex tasks that might run over serveral sessions in the game (I need to conquer xyz! But I need to build a fleet for that but I need resources for that so I need to buy one ship and send it to harvest asteroids...)
    2. Handle cascaded complex scenarios (see 1)
    3. Can handle urgent tasks (I'm being shot at, I should pause the main tree and handle that first. After that I need to remember where I was.)
    4. Can handle parallel tasks on units (I need to order a repair bot soon to meet me half way, the coffee machine doesn't sound good and needs repairs.)
    5. Handle Spaceships. At the moment I'm working with NavMesh and fake 3D but that might change later. After watching tutorials and examples for many AI/FSM/BT Assets in the Assetstore, it seems to me they clearly focus on NavMesh. I will need a different system with real 3D one day and I'd hate if I have to switch AI then. (I found "Spaceship AI" that seems to be a navigation system to me, something like that might be built in later on.)

    Thank you in advance!

    P.S.: And yes, I'm putting cookies on the desk for your time.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,334
    I don't know of an off-the-shelf asset, but to do what you describe, I would use a utility approach. Look up how AI works in The Sims. It's not that complicated, and it does a good job of responding to emergencies etc. I think it would be a good approach for your ship AI.
     
    matzomat likes this.
  3. matzomat

    matzomat

    Joined:
    Mar 4, 2018
    Posts:
    9
    Thank you for your reply. That’s a great idea,

    I should add that I very well know that I will have to wrote most functions myself but I’ll need help keeping them structured and organized.
     
    JoeStrout likes this.