Hi folks,
Just to show off my small little coursework project: the possible use of neural networks in car racing games.
It uses :
- Ogre
- ogre newton + simple vehicule class
- a track from "Drive Vehicle Dynamics Demo", posted some months ago on this forum (by Pierre Blanc)
- a neural network class from the book AI for games developer.
I almost did not code anything
how it works :
- 5 rays in front of the car are giving the distances from the car to the borders of the track and are used as Input sensors for the ANNET.
- the inputs/outputs pairs are recorded from a player (the output are: move forward, backward, turn right or left)
- the network is trained to adjust all the perceptrons weights with these pairs of inputs/output
results : the ANNET is able to imitate/learn from a player !
I put here only a video since screens wont show anything interresting...
http://www.youtube.com/watch?v=FKAULFV8 ... re=related
Neural network in racing games
- NickM
- Bronze Sponsor
- Posts: 65
- Joined: Sat Jul 01, 2006 10:41 pm
- Contact:
-
- Gnoblar
- Posts: 22
- Joined: Wed Sep 26, 2007 10:27 am
-
- Halfling
- Posts: 77
- Joined: Tue Mar 01, 2005 1:45 pm
thanks!
happy to see that some of you find it interresting
I have not planned anything, it was just a simple test / proof of concept, most of racing game use a racing line, the idea here is that ANNET can give emmergeant and maybe more natural behaviours.
But there is a lot of thing to research especially the kind of Input sensors that would have to be used, I was thinking about physX triangle or sphere shapped triggers to detect other cars.
Another investigation would be about the use of evolutionnary ANNET, capable of learning by themself (unsupervised techniques).
happy to see that some of you find it interresting
I have not planned anything, it was just a simple test / proof of concept, most of racing game use a racing line, the idea here is that ANNET can give emmergeant and maybe more natural behaviours.
But there is a lot of thing to research especially the kind of Input sensors that would have to be used, I was thinking about physX triangle or sphere shapped triggers to detect other cars.
Another investigation would be about the use of evolutionnary ANNET, capable of learning by themself (unsupervised techniques).
-
- Gnoblar
- Posts: 17
- Joined: Sat Nov 24, 2007 3:07 pm
Re: Neural network in racing games
you should also reinject output as input or add speed, turning speed etc .. as inputhelloween wrote:Hi folks,
Just to show off my small little coursework project: the possible use of neural networks in car racing games.
It uses :
- Ogre
- ogre newton + simple vehicule class
- a track from "Drive Vehicle Dynamics Demo", posted some months ago on this forum (by Pierre Blanc)
- a neural network class from the book AI for games developer.
I almost did not code anything
how it works :
- 5 rays in front of the car are giving the distances from the car to the borders of the track and are used as Input sensors for the ANNET.
- the inputs/outputs pairs are recorded from a player (the output are: move forward, backward, turn right or left)
- the network is trained to adjust all the perceptrons weights with these pairs of inputs/output
results : the ANNET is able to imitate/learn from a player !
I put here only a video since screens wont show anything interresting...
http://www.youtube.com/watch?v=FKAULFV8 ... re=related
in this way you'll add a little memory to your neural network it will probably smooth the behavior.
- Evak
- Orc Shaman
- Posts: 707
- Joined: Sun Apr 02, 2006 7:51 pm
- Location: Sacramento, CA
- x 1
- Contact:
we did something similar for a racing game. It's not done in Ogre but we have a demo. It works in a similar fashion to yours.
Originaly we had a racing line, but only ended up using it to make sure the cars were driving in the correct direction.
If you want to check it out, theres a 12mb Fun Racer demo on my web page at:
http://www.kineticrealities.com/
The AI is kind of cool, and were hoping to do something similar in ogre when we have time. You can edit parameters in the .ini file. 12 cars work fine on a older 1.2ghz machine
Whats kind of cool with this kind of AI is watching cars make mistakes, and how they try and avoid other vehicles and track side barriers and walls. It's all very convincing and a lot of fun when compared to the usual race on rails of almost all commercial games.
Originaly we had a racing line, but only ended up using it to make sure the cars were driving in the correct direction.
If you want to check it out, theres a 12mb Fun Racer demo on my web page at:
http://www.kineticrealities.com/
The AI is kind of cool, and were hoping to do something similar in ogre when we have time. You can edit parameters in the .ini file. 12 cars work fine on a older 1.2ghz machine
Whats kind of cool with this kind of AI is watching cars make mistakes, and how they try and avoid other vehicles and track side barriers and walls. It's all very convincing and a lot of fun when compared to the usual race on rails of almost all commercial games.
- walaber
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
- Contact:
-
- Gnoblar
- Posts: 13
- Joined: Tue Mar 07, 2006 8:19 pm
- Location: Spain
- Contact:
If you are more worried about the ANN or AI research than Ogre /visual research, check out Gazebo (yes, I am contributing there, this is an ad )
http://playerstage.sourceforge.net/doc/ ... pre1-html/
It is a Ogre and Ode based robot simulator. It has a laser sensor that should work for you as your ray sensors and let you send command ands get info from the world totally in a totally different program than the simulation (useful to work with unrelated code, for instance in your case)
If you are more interested in integrating everything in a game, Good Luck! Let us know your progress!
http://playerstage.sourceforge.net/doc/ ... pre1-html/
It is a Ogre and Ode based robot simulator. It has a laser sensor that should work for you as your ray sensors and let you send command ands get info from the world totally in a totally different program than the simulation (useful to work with unrelated code, for instance in your case)
If you are more interested in integrating everything in a game, Good Luck! Let us know your progress!
Nobody looks so ugly as in the passport photo