User Tag List

View Poll Results: Does the AI driving skill in its current form, look realistic?

Voters
20. You may not vote on this poll
  • Yes

    14 70.00%
  • No

    6 30.00%
Results 1 to 12 of 12

Thread: Blueprint Racing AI

  1. #1
    0

    Lightbulb Racing AI Project

    Hello!

    Here is a quick preview of how the system currently operates[This Is Me Racing The Ai]
    (Check Later Post To See How Updates Have Been Implemented)



    So i am creating a racing project for my last year at Uni At first I was going to use the other engine that starts with a U, but then i tried Unreal :P. This is my first Unreal Project so its all wip/learning . Anyways I was going to code the AI in C++, but i really like the easy control and debugging of blueprints, so I decided to use them . I haven't found many references for Unreal Racing AI so this system is built from the ground up.

    The AI controls the advanced car example, and uses all the same inputs a human player would use. The system currently uses just one lane. The user adds some way points along the track and then fine tunes splines between these tracks.


    THINGS TO DO
    1. Steering. Done
    2. Acceleration and Braking Based On Corner Curvature.Done
    2. Flying Balance(If the car is jumping stop it flipping over).Done
    2. Raycast Obstacle Avoidance.
    3. Random Error and Steer Target Based On Driver Skill.Done
    4. Anti-Reverse Driving(Stop the AI Driving Backwards Around the Track). Done
    5. More intelligent braking.
    7. Clean All Blueprints(Create Functions, Remove Unnecessarily Variable etc...)

    Any suggestions or tips would be greatly appreciated, please scroll down to see how the AI has been implemented.
    Last edited by StonedRhino; 08-19-2016 at 12:23 PM.

  2. #2
    0
    Promoter
    Join Date
    Oct 2015
    Posts
    289
    This looks great work. Are you gonna add this someday to marketplace, because many has waited proper Car AI years. And is those things easy to add different track. I am making racing game where are tracks and cars, but need someday maybe in the end of year to learn AI or buy if there is somewhere easy system to adjust own game

  3. #3
    0
    Thanks!

    To lay out a new track you simply adds way points along the track(these way points contain a perfect apex, middle, and worst apex marker), the script then auto generates the line based on these markers
    (I am currently updating the logic so cleaner racing lines are produced and less user input is required).

    I do plan on making this available to the public, but my main priority is getting it finished for Uni(Next year) .
    Last edited by StonedRhino; 07-16-2016 at 01:57 PM.

  4. #4
    0
    Promoter
    Join Date
    Oct 2015
    Posts
    289
    Okay so not coming marketplace before that. Too long time to wait next year. But still great work

  5. #5
    0

    Ray Cast Braking and The Beginning of overtaking choices

    Sorry Dude I have no reason to rush
    Last edited by StonedRhino; 08-04-2016 at 09:55 AM.

  6. #6
    0
    Its been a while since I updated this post, but I have been working hard :P The project became overly complex and required to much input from the level designer(Maximum corner speed, Braking Zones, etc etc...) So I decided to take the project back to basics.

    The racing AI will now use the spline to calculate maximum cornering speed, to brake or accelerate accordingly!
    The AI uses then radius of a corner to determine how fast it can take the corner without loosing grip, the radius of a corner is calculated using the following formula:
    Name:  yay.png
Views: 904
Size:  27.8 KB

    Once the AI knows the radius of a corner it can then calculate the maximum cornering speed, so long as it knows a few other variables such as mass or down force. The maximum cornering speed is calculated using this formula:
    MaxCorneringSpeed = sqrt(((Tire-RoadCoefficient * CornerRadius) * (GravityForce + (DownForce / Mass))))
    This formula was taken from this paper, http://game.itu.dk/cig2010/proceedings/papers/cig10_048_083.pdf
    Here is a video showing the formula in opertation:


    And Finally A video of the AI doing some laps on the freshly created track.
    Last edited by StonedRhino; 08-20-2016 at 08:58 AM.

  7. #7
    0

    Another Day Another Update - Direction Detection and Flying Stabalisation

    LEGACY UPDATE HAS BEEN REDESIGNED

    So I have completed the logic that stops the AI driving backwards around the track, this turned out to be a little more complex that I thought as the track is made up of multiple splines. But it works now so I am going to move on, the logic compares a distance along a specific spline and the cars distance along the spline. The car is then only allowed to accept a steering target if the distance conditions are correct, if they are not then the car will attempt to drive back to the closest track point.

    Here is a video showing the system in operation.
    I started the car backwards on the track, set the tire data incorrectly and added obstacles placed to make the AI crash and flip.
    The video shows the AI crashing multiple times and then rejoining the track(in the correct direction).


    I have also completed the 'flying stabilization', this just stabilizes the car so it does not flip while in the air.
    The video below shows the same track with the obstacles removed, and tire info set correctly.


    And here is a preview of the blueprint, I don't really want to show it in full resolution just yet. (But that will come soon once it has been cleaned up :P)
    Name:  waga.png
Views: 898
Size:  401.8 KB
    Last edited by StonedRhino; 08-19-2016 at 09:12 AM.

  8. #8
    0
    Promoter
    Join Date
    Oct 2015
    Posts
    289
    Nice work. I appreciate everyone who is making some car AI

  9. #9
    0

    Update 3: Another Complete Rebuild

    As the subtitle suggest I have rebuilt the entire system again to give better results.

    • Laying down the spline track is now easier than ever!
    • Adjustments have been made so that cars more accurately determine the maximum corner speed.
    • The racing is now made up of a single spline, allowing for simpler codes(blueprints).
    • I have also added some better overtaking conditions, there is now a single 'race controller' object that each car references and queries to find out whether it should overtake or defend its current position.





    A Video Of me Laying down a bran new track!


    A Video of the AI racing the bran new track!


    A Video Of Me Racing The Ai's (These Cars Are Front Wheel Drive Open Diff, but the Ai can handle any transmission setup)


    A Quick Screen Shot Of the Racing AI blueprint, Im still not sure if i want to show full resolution screen shots.
    Name:  picture.png
Views: 840
Size:  270.7 KB

    • Next Thing's To Do : Local Obstacle Avoidance, Better Lane Changing Control (Sometimes the AI Will spin out when attempting to overtake), Better Car senses in general(Are we skidding, understeer/oversteer etc).
    Last edited by StonedRhino; 08-20-2016 at 10:25 AM.

  10. #10
    0
    This looks really good

  11. #11
    0
    Are you still working on it?

  12. #12
    0
    Hi StonedRhino!
    Do you plan to release this project or make a tutorial?
    I'm in search for something like this!
    Thank You

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •