Advertisement

ANN for racing game: Problems

Started by August 02, 2006 07:10 PM
3 comments, last by aparaske 18 years, 3 months ago
Hi, I'm working on this racing sim demo, to create AI using ANN. The inputs(4) are: Position: In width(from 0 to 1) and length(from 0 to 156) (transformed coordinates to track space) Speed Direction: from 0 to 360 The outputs(4) are: Gas: from 0 to 1 Brake: from 0 to 1 Steer: from -1 to 1(below 0 steer left, above 0 steer right) Gear: from -1 to 1 (below 0 down gear, above 0 up gear) I have 6 hidden layers with 8 nodes each and 30000 iterations that last about 100 seconds, enough to complete one lap plus a bit more. On start up, the car is loaded having position just above the ground. Once it drops, the user can control the car. The training is done as the user drives the car. When it completes 30000 iterations training stops When restarted and set to use the NN i get results for before it touches the ground like so: Gas: 0.968732. Brake: 0.006889. Steer: 0.000742. Gear: 0.000264 and after it touches the ground like so: Gas: -1.#IND00. Brake: -1.#IND00. Steer: -1.#IND00. Gear: -1.#IND00. They both have problems. The first should have nil values since I dont press buttons before it touches the ground. The second, well, it's obvious. Any ideas anyone!? Alex [Edited by - aparaske on August 3, 2006 4:35:46 AM]
This was my very first ANN, and its application to racing, let alone racing sim is not so easy. I would appreciate any pointers you could give me for a better choice of input and output representations, and number of hidden nodes. Also, for each second there are 300 iterations by default(physics engine). It would be a good idea to decrease that down to 20 iterations per second right? That way, instead of about 30000 training sets for each lap, i would need 2000 or less. Lastly, do u think that i should restrict my values to one decimal place, or 2 the most?

Alex
Advertisement
Might be worth re-thinking it a bit. I would have a defined racing line and have the ANN try to keep the car on the line (and go fast).

This would change your inputs to crosstrack error, heading error and speed. Might be worth adding your current gear to the input too.
so you think that the width and length is completely unnecessary? What about the number of hidden layers and nodes? And why do you think I get such an output that makes the vehicle jump up in the air like a bird? heh :)

Alex
The output i get from the ANN is not the problem. After some extensive bug search i found out more or less the cause of it. (I still can't get it to work properly, but it's not the ANNs fault). If i use crosstrack error, heading error and speed do you think the ANN would be able to generalize as well as decrease speed in time to make a turning? Would it be able to drive a different track if I give it different track data and racing line without having to retrain?

Alex

This topic is closed to new replies.

Advertisement