# Tutorial: Learning to Drive

**URL:** <https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490>\
**Category:** Tutorial & Course Discussions\
**Tags:** unreal-engine\
**Created:** [August 28, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490 "2023-08-28T15:43:16Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Neuro](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neuro](https://forums.unrealengine.com/u/Neuro)\
**Post date:** [September 14, 2023, 7:34am UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/42 "2023-09-14T07:34:36Z")

</div>

Hey Brendan, thanks for the excellent reply!

I’ve got one further question regarding observations.

you say they should be normalized between -1,1; does that mean that they should be from -1 to 1, _SPECIFICALY_, or can these values also be from 0,1, or for example, -1, to 0?

in the case of a line trace distance for example, intuitively speaking, it doesn’t make sense to me to have this between -1 and 1.

Would appreciate your insight!

---

<div class="post-metadata">

**Author:** ![Deathcalibur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deathcalibur/32/1037610_2.png) [@Deathcalibur](https://forums.unrealengine.com/u/Deathcalibur)\
**Post date:** [September 14, 2023, 1:08pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/43 "2023-09-14T13:08:18Z")

</div>

All of those should work. The thing you don’t want is some of the inputs to the network being huge compared to other inputs.

This is general advice. I tried to say “roughly” prior to mentioning this everywhere because it’s not some kind of law of neural networks… it’s mainly good practical advice.

---

<div class="post-metadata">

**Author:** ![JamesYoo82](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamesyoo82/32/1047479_2.png) [@JamesYoo82](https://forums.unrealengine.com/u/JamesYoo82)\
**Post date:** [September 15, 2023, 6:36am UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/44 "2023-09-15T06:36:08Z")

</div>

@Deathcalibur,

FYI, Learning-Agents is not working under Linux due to wrong python executable path.

LearningTrainer.cpp - Line 48  
return EngineDir / TEXT(“Binaries/ThirdParty/Python3”) / FPlatformMisc::GetUBTPlatform() / (PLATFORM\_WINDOWS ? TEXT(“python.exe”) : TEXT(“bin/python”));

It may work with code change like this:  
return EngineDir / TEXT(“Binaries/ThirdParty/Python3”) / FPlatformMisc::GetUBTPlatform() / (PLATFORM\_WINDOWS ? TEXT(“python.exe”) : TEXT(“bin/python3”));

---

<div class="post-metadata">

**Author:** ![Deathcalibur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deathcalibur/32/1037610_2.png) [@Deathcalibur](https://forums.unrealengine.com/u/Deathcalibur)\
**Post date:** [September 15, 2023, 1:11pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/45 "2023-09-15T13:11:18Z")

</div>

Yes, I will add a note to the intro article that Learning Agents currently only works on windows. As I stated previously, since this is only an experimental release, we didn’t have a ton of room to test for Mac and Linux yet. We were hopeful they would work but as is often the case - untested code doesn’t work 😢

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 15, 2023, 6:42pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/46 "2023-09-15T18:42:40Z")

</div>

Hi !

I have this warning message. Any idea where it could come from?  
Thanks !

> LogLearning: Warning: SplineComponmentHelper\_2: Getting proportion along spline as angle, but spline is not closed loop. Consider using GetPropotionAlongSpline instead.

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 15, 2023, 7:09pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/47 "2023-09-15T19:09:45Z")

</div>

I have similar behavior

---

<div class="post-metadata">

**Author:** ![Deathcalibur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deathcalibur/32/1037610_2.png) [@Deathcalibur](https://forums.unrealengine.com/u/Deathcalibur)\
**Post date:** [September 15, 2023, 7:40pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/48 "2023-09-15T19:40:27Z")

</div>

I’m not an expert on the spline component but I believe this box needs to be checked and then the last node in the spline should connect back to the first. This is from the placed instance of the spline in the Outliner panel.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/2/c52586badf984a146338358a17f57d4feaf8fd91.png)

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 15, 2023, 8:58pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/49 "2023-09-15T20:58:34Z")

</div>

Thanks! the warning has disappeared

---

<div class="post-metadata">

**Author:** ![SeanskiW123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanskiW123](https://forums.unrealengine.com/u/SeanskiW123)\
**Post date:** [September 15, 2023, 9:35pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/50 "2023-09-15T21:35:22Z")

</div>

I hit this as well and resolved it in the following way:

- Find your BP\_SportsCarTrackSpline in the Outliner
- Under Details, select the “Spline” component that you’ve added to it.
- Check the “Closed Loop” box under the Spline details.

---

<div class="post-metadata">

**Author:** ![SeanskiW123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanskiW123](https://forums.unrealengine.com/u/SeanskiW123)\
**Post date:** [September 15, 2023, 10:44pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/51 "2023-09-15T22:44:29Z")

</div>

I was hitting the same problem and resolved it by tuning the tick interval for the manager to 0.0083 (120hz) instead of the 0.10 value from the tutorial. The actors started learning extremely quickly and were hitting 20 km/h in a couple of minutes. Excellent progress was made after 15 minutes and by 2 hours I was pretty impressed with the results.

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 16, 2023, 11:36am UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/52 "2023-09-16T11:36:22Z")

</div>

After 3 hours of training my agents have learned to go fast and to turn, which is really promising but like @tomhalpin8 my data asset with my neural network weights remains at 72kb and I don’t know if this is normal but it’s empty when I open it. So I don’t know where the weights are stored?

Also when I do the inference I see the other agents doing the loop well but the car on which I have the camera and which is the first doesn’t move.  
Have you experienced this kind of behavior before?

Thanks again for your help!

---

<div class="post-metadata">

**Author:** ![SeanskiW123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanskiW123](https://forums.unrealengine.com/u/SeanskiW123)\
**Post date:** [September 16, 2023, 12:40pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/53 "2023-09-16T12:40:25Z")

</div>

After a little over 2 hours of training my Data Asset is 73kb.

With respect to the inference, I had the same problem with the car not driving and resolved it by moving the PlayerStart marker to elsewhere on the map. I think I might have had it facing the wrong direction or something like that.

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 16, 2023, 2:17pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/54 "2023-09-16T14:17:54Z")

</div>

Thanks! , you’re right, my PlayerStart was pointing in the opposite direction!

---

<div class="post-metadata">

**Author:** ![PM\_Zahid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PM\_Zahid](https://forums.unrealengine.com/u/PM_Zahid)\
**Post date:** [September 18, 2023, 6:12pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/55 "2023-09-18T18:12:33Z")

</div>

if i wanted to setup observations for multiple parts of the car such as all 4 tires, wld i have to use the “array” variant of the add \_ observation nodes? if so how would i reference each tire? @Deathcalibur

---

<div class="post-metadata">

**Author:** ![tomhalpin8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomhalpin8](https://forums.unrealengine.com/u/tomhalpin8)\
**Post date:** [September 18, 2023, 8:02pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/56 "2023-09-18T20:02:41Z")

</div>

What’s the longest someone has trained this and what were you’re results?

---

<div class="post-metadata">

**Author:** ![PM\_Zahid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PM\_Zahid](https://forums.unrealengine.com/u/PM_Zahid)\
**Post date:** [September 19, 2023, 1:07pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/57 "2023-09-19T13:07:59Z")

</div>

i had my cars going 300kmh on a scaled up map. totally worth it.

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 19, 2023, 7:27pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/58 "2023-09-19T19:27:18Z")

</div>

on my side, after 3 hours, with the basic setting of the tutorial, I reach 100km.  
I have a few off-track but it’s due to my spline positioning.

---

<div class="post-metadata">

**Author:** ![FatemehMousavu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FatemehMousavu](https://forums.unrealengine.com/u/FatemehMousavu)\
**Post date:** [September 20, 2023, 3:26pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/59 "2023-09-20T15:26:12Z")

</div>

I have tried this tutorial 3 times, but even after 3 times the car’s steering is not working and cars have problems in the curves ( they move straight ). Can you tell me what you have done on your project? did you exactly follow the tutorial and for your run training are these the correct settings?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/0/420321223a775a2fea365039f246ede5f43619c3.png)  
Did you turn off the Brake in reverse? or did you change the manager’s tick?

---

<div class="post-metadata">

**Author:** ![Mahzad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mahzad/32/745429_2.png) [@Mahzad](https://forums.unrealengine.com/u/Mahzad)\
**Post date:** [September 20, 2023, 3:55pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/60 "2023-09-20T15:55:03Z")

</div>

for the spline did you try this :

> [@Tutorial: Learning to Drive](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/50):
>
> I hit this as well and resolved it in the following way: Find your BP\_SportsCarTrackSpline in the Outliner Under Details, select the “Spline” component that you’ve added to it. Check the “Closed Loop” box under the Spline details.

?  
It was my main issue

---

<div class="post-metadata">

**Author:** ![FatemehMousavu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FatemehMousavu](https://forums.unrealengine.com/u/FatemehMousavu)\
**Post date:** [September 20, 2023, 3:57pm UTC](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490/61 "2023-09-20T15:57:00Z")

</div>

I have done the close loop for spline. But it is not working . I put the spline actor in 0,0,0 and also create a close loop with spline point( the start location for spline point could not be at 0,0,0 since it is not in the path) .

[Previous page](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490.md?page=2)

[Next page](https://forums.unrealengine.com/t/tutorial-learning-to-drive/1275490.md?page=4)
