Search Unity

How would you go about creating AI for planes that can race each other and shoot enemies?

Discussion in 'General Discussion' started by ynm11, Mar 18, 2022.

  1. ynm11

    ynm11

    Joined:
    Jul 6, 2021
    Posts:
    57
    I'd like to create a game like this -- a plane race where player races against AI players who shoot at the player and each other as they race along. But where would you begin making something like this, what keywords should be researched? Thanks.
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    What part are you having trouble with?
     
    ynm11 likes this.
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    "boids". "follow waypoint". "collision avoidance"

    Maybe "ai decision trees". Or just be direct and "racing ai".

    Boids will get you 90% towards your goal, I think.
     
    ynm11 likes this.
  4. ynm11

    ynm11

    Joined:
    Jul 6, 2021
    Posts:
    57
    Just the concept of something 'intelligently' racing around the track and shooting enemies that come within its radius. I just don't know where to begin.
     
  5. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    ynm11 likes this.
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    A basic ai would look like this:

    * While not waypoint reached, head to waypoint, if reached, switch to the next one.
    * Try to avoid crashing.
    * If enemy is ahead, then shoot.
    * If enemy is behind, drop bomb.
    * If enemy is to the left/right, ram.
    * Wobble around a bit to create illusion of intelligent behvioar.
    * Use difficulty tables to adjust steering behavior and reaction speed.
    * Yell random obscenities at the player using prepared list of approved insults.

    Basically, make a plane that can fly through a race course ALONE. Then look into boids.
     
    ynm11 likes this.