Search Unity

Free car Ai out there?

Discussion in 'General Discussion' started by tatelax, Sep 19, 2010.

  1. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    Is there a free vehicle Ai system out there. I have tried making my own but I can't get the effect of a car. Chances of a free car ai are slim but why not ask? Thanks
     
  2. moonman

    moonman

    Joined:
    Aug 21, 2010
    Posts:
    203
  3. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    That does not include an ai system.
     
  4. moonman

    moonman

    Joined:
    Aug 21, 2010
    Posts:
    203
    *looks at tatelax*
    *looks at car tutorial*
    *looks back at tatelax*

    and what would a car Ai system do that this tutorial cannot?
     
  5. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    um am I missing something? There is no ai system for opponents. :oops:
     
  6. Lab013

    Lab013

    Joined:
    Oct 22, 2008
    Posts:
    405
    A car AI system would allow you to easily set up tracks and what not for car artificial intelligence.

    There is no free solution that I'm aware of.
     
  7. Lab013

    Lab013

    Joined:
    Oct 22, 2008
    Posts:
    405
    A car AI system would allow you to easily set up tracks and what not for car artificial intelligence.

    There is no free solution that I'm aware of, other than making it yourself.
     
  8. moonman

    moonman

    Joined:
    Aug 21, 2010
    Posts:
    203
    oh! I don't think such a thing has been created, although, it should be rather easy with the right set of skills and the waypoint system.
     
  9. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    I setup a waypoint system and it looked awful and the car didn't react when I bumped it. Also it wasn't level to the ground and didn't rotate smoothly.
     
  10. moonman

    moonman

    Joined:
    Aug 21, 2010
    Posts:
    203
    You just need to try harder. Detect when it hits the waypoint and turn the wheels. Build in some random timing and stupidness and tada, you have yourself a car AI.
     
  11. callahan.44

    callahan.44

    Joined:
    Jan 9, 2010
    Posts:
    694
    Depends what you want your AI cars to do, track layouts and car physics.

    I'm using a waypoint system for my racing game, and use it to handle AI, lap times, respoting cars and placing powerups.

    You don't want to use it as a "rail" but make it freeform so they *aim* at a waypoint a bit further down the track (depends on distance between waypoints). The AI code only provides input identical to a player, like throttle, steering, brake.

    (based mine on http://www.gotow.net/andrew/blog/?page_id=78)

    The waypoints are taken directly from splines I used to create the tracks, and run down the centre. This lets me add lanes either side, that the AI can move to, allowing them to overtake/block etc. (easy to calculate a parallel point of whatever lane width)

    I've not got around to implementing a couple of things.
    The waypoints also contain other data, like change in heading and pitch, so they can see whats coming. Brake more for sharp bends, accelerate uphill, move into the inner lane on a bend.

    The most advanced feature I'm going to add, is where it samples when a player does a good lap, and stores that in the waypoint. Over time it should create a perfect race line.

    If you then add a few stats for your AI:
    skill%, chance they use the advanced features.
    reaction%, chance they react to things like upcoming bends.
    aggressive%, chance they ram/block, etc.

    There is only one problem, the AI can get stuck, so I have to respot them if they stop moving.


    Another method is to use something like OpenSteer/UnitySteer, and let them find their own way round.
     
  12. McKaners

    McKaners

    Joined:
    Mar 1, 2009
    Posts:
    45
    Your game is pretty good. A bit GUI front-end heavy. But, still the game idea is good.

    What code are your using for the player? Jcar or Sports car script from Unity Tutorial?

    Your cars a great. at slow speeds, but at high speed its out of control. :)

    lap time GUI over lays on itself after each lap. Kinda annoying.

    Keep going! looking good. (Not sure if it would ever work on iPhone)

    you will have to make your own AI or talk with the Tornado Twins to make a prefab coded AI for you (pay).
     
  13. GluedBrain

    GluedBrain

    Joined:
    Apr 12, 2013
    Posts:
    47