After some changes, my pytorch RL self driving car game refused to learn

So previously, the AI would do several laps about 50 or 60 generations in and then after 80 generations it’d spin in circles. I managed to fix this by changing self.epsilon to be equal to 80-self.n_games*0.01 rather than without the *0.01. In this process though, i had changed several functions and variables to get there including:

play_step init and forward

and after changing all of these, the AI would not learn anymore and it would not perform several laps as it used to (even though it wouldnt go in circles anymore after 80 generations). So therefore i tried to change them all back but it still wouldnt learn anymore and wouldnt lap around the racetrack or survive long at all.

My question is, what is wrong with this AI and what do i need to fix for it to be able to learn properly again whilst not spinning in circles?

The AI project: