Race Sim Central
Rec.Autos.Simulators Archive

How does AI work in racing games?

39 posts by 17 people · 11 May 2004 17:48 UTC - 15 May 2004 11:19 UTC

Notable threadHow racing game AI drivers are programmed

A request for resources on racing AI drew detailed explanations from developers including J. Todd Wasson and Jeff of Razorworks, who described following predefined lines with steering formulas versus fully free AI that reads the road. Ruud van Gaal argued AI should aim for good gameplay and could cheat slightly on grip rather than emulate humans, while Peter Ives wanted varied, human-like braking behaviour. TORCS developer Bernhard Wymann pointed to TORCS and RARS as open AI projects, and the original poster mentioned a job opening for a race AI programmer.

With Jeff (Razorworks); J. Todd Wasson (Performance Simulations); Bernhard Wymann (TORCS)

physics/realism debateindustry/businessTORCS

Automated summary.

Joe62 11 May 2004 17:48 UTC#37780
Does anyone have pointers to articles or resources on the web where I can research this topic? I want to learn about the various approaches that have been tried, and understand their benefits and drawbacks.
On Tue, 11 May 2004 17:48:20 GMT, Joe62 <[email hidden]> wrote: >Does anyone have pointers to articles or resources on the web where I >can research this topic? I want to learn about the various approaches >that have been tried, and understand their benefits and drawbacks. Good question. I was just pondering that the other day. I'm no programmer, but I wondered just how much "hand- holding" an AI needs. For example, AFAIK most racing AIs are coded using various racing lines made by human programmers, which tell the AI where to go on the track in various situations. Would it be more advantageous to make it so that the AI can "tell" what the best line is through a corner without someone (human) having to draw a line on the track for it to follow? Or would the advantages of that approach be more than offset by the huge programming challenges that would entail? Will sims still be using LP lines 20 years from now? John DiFool
In article <[email hidden]>, John DiFool <[email hidden]> writes
Quoted text (22 lines)>On Tue, 11 May 2004 17:48:20 GMT, Joe62 ><[email hidden]> wrote: > >>Does anyone have pointers to articles or resources on the web where I >>can research this topic? I want to learn about the various approaches >>that have been tried, and understand their benefits and drawbacks. > >Good question. I was just pondering that the other day. >I'm no programmer, but I wondered just how much "hand- >holding" an AI needs. For example, AFAIK most racing >AIs are coded using various racing lines made by human >programmers, which tell the AI where to go on the track >in various situations. > >Would it be more advantageous to make it so that the AI >can "tell" what the best line is through a corner without >someone (human) having to draw a line on the track for it >to follow? Or would the advantages of that approach be >more than offset by the huge programming challenges >that would entail? Will sims still be using LP lines 20 years >from now? >
Let's hope not. In my view, AI won't come of age until you can give it a track and it can learn how to drive around it just like us humans, whilst at the same time, having various weightings which allow some AI to learn and drive better than others. -- Peter Ives (AKA Pete Ivington) Remove ALL_STRESS before replying via email If you know what's good for you, don't listen to me :) GPLRank Joystick -50.63 Wheel -25.01
Papyrus made a game called SODA Off Road Racing in 1997.You could make your own tracks. The thing is before you could race the AI on your track, they had to "learn" it.Could take 10 minutes or an hour or so, depending on how complex the track was.The AI , just looking now, seems to be in a dat file for each class of vehicle( 3 classes).No LP files like GPL -- Steve H GPL Rank -17.90 Can't help about the shape i'm in Can't win,it ain't pretty and my tires are thin.. "Peter Ives" <[email hidden]> wrote in message news:[email hidden]... > In article <[email hidden]>, John DiFool > <[email hidden]> writes > >On Tue, 11 May 2004 17:48:20 GMT, Joe62 > ><[email hidden]> wrote: > > > >>Does anyone have pointers to articles or resources on the web where I > >>can research this topic? I want to learn about the various approaches > >>that have been tried, and understand their benefits and drawbacks. > > > >Good question. I was just pondering that the other day. > >I'm no programmer, but I wondered just how much "hand- > >holding" an AI needs. For example, AFAIK most racing > >AIs are coded using various racing lines made by human > >programmers, which tell the AI where to go on the track > >in various situations. > > > >Would it be more advantageous to make it so that the AI > >can "tell" what the best line is through a corner without > >someone (human) having to draw a line on the track for it > >to follow? Or would the advantages of that approach be > >more than offset by the huge programming challenges > >that would entail? Will sims still be using LP lines 20 years > >from now? > > > > Let's hope not. In my view, AI won't come of age until you can give it > a track and it can learn how to drive around it just like us humans, > whilst at the same time, having various weightings which allow some AI > to learn and drive better than others. > -- > Peter Ives (AKA Pete Ivington) > Remove ALL_STRESS before replying via email > If you know what's good for you, don't listen to me :) > GPLRank Joystick -50.63 Wheel -25.01
> Papyrus made a game called SODA Off Road Racing in 1997.You could makeyour > own tracks. The thing is before you could race the AI on your track, they > had to "learn" it.Could take 10 minutes or an hour or so, depending on how > complex the track was. Isn't that how LFS is? They supposedly get smarter the more they run the track. I never got to that point though. Last time I played, they were still running into tire stacks and such. Alan
Quoted text (11 lines)>From: John DiFool [email hidden] >Date: 5/11/2004 6:21 PM Central Daylight Time >Message-id: <[email hidden]> > >On Tue, 11 May 2004 17:48:20 GMT, Joe62 ><[email hidden]> wrote: > >>Does anyone have pointers to articles or resources on the web where I >>can research this topic? I want to learn about the various approaches >>that have been tried, and understand their benefits and drawbacks. >
I've tried a couple of ways. Both were basically the same in regards to how the cars are steered. There are a lot of different pre-defined lines that the cars try to follow. I use a formula to calculate what the target steering angle should be based on how far away from the line the car is (actually, a hermite spline), as well as how quickly it's approaching or going away from it in the tangential direction. The wheels then steer towards this target steering angle at a prespecified speed so it's all reasonably smooth. So in that sense, you're not literally racing against a car that's glued to a line as you might imagine. The car wanders off it a bit, but if you let it run lap after lap it'll do very close to the same thing each time. So to throw a little flavor in it'll randomly pick a different line each lap, or you could have it switch lines at a random time around the track, although that can look a little wierd.. Aside from the steering controller is a throttle/brake controller. I've tried 2 different things: 1) The first way I tried was to use the same type of approach as was done for steering. Using the distance and tangential speed from the racing line the car wanted to follow, the throttle gain might be reduced. I.e., if the car went a bit too far off the line the throttle is "slowly" released and if that's not enough to fix the situation, the brake is progressively applied. Eventually the car slows down enough to get back on the line, and the throttle increases again on its own. That works pretty well as long as you're not coming off a straight into a tight turn. The car won't see ahead far enough to know that it's going to go off the line. So what I did was come up with a learning algorithm that was pretty slick. The cars would run through a learning phase (just during development). The car would basically race full blast into the first turn and if it went too far off the line, it would create a braking point some distance behind where it went off. Eventually the car would return to the line and it would remember an "end brake" point. So basically it created its own braking zone. It would then run the rest of the track (while possibly going off at all the other corners) and when it ran through turn 1 again it would adjust the "start braking" point forward or backwards a little bit each lap until the car didn't go too far off the line. Then it would adjust the "end braking" point to the spot where the car went the furthest off the track, and voila, it would eventually learn to brake enough to make the turn on its own. Then it would proceed to the next spot where the car goes off, and after several laps it would learn where to brake and for how long. Eventually after 60-100 laps the cars would learn the whole track and turn not too shabby laptimes. It's neat to watch them learn the track that way, but they are still following racing lines that I'd lay down with a spline editor tool. 2) The method above turned out not work as well as I'd hoped for my particular application. The cars weren't as fast through the turns as they could be. So instead, I just recorded a bunch of my laps and set the AI throttle controller to simply try to match the speed I was running at various points around the track. This looks a lot better and the cars are faster, even though it's infinitely simpler to implement and the cars aren't really learning anything. Who knows though, maybe somebody else could make method 1 work better than 2... :-) After that, each car measures the distance to every other car and when one gets close to another, will try to steer away from it a little bit and when I get time, will adjust its throttle some as well if necessary. That actually looks pretty good as if you stick 10 cars on the track in close proximity to each other, they all drive totally unique lines even if you tell them to drive "line A." (Which is more than can be said for the Grand Turismo series!) Granted, my cars right now are crashing all over the place, so I may put my foot in my mouth later over that approach ;-) Also note that this is with AI cars that do nothing but understeer. If your AI cars can spin, you'll need extra stuff to get them to countersteer and so on like a human driver would try to do. One idea on that would be to keep an eye on the slip angles of the tires.
Quoted text (7 lines)>Good question. I was just pondering that the other day. >I'm no programmer, but I wondered just how much "hand- >holding" an AI needs. For example, AFAIK most racing >AIs are coded using various racing lines made by human >programmers, which tell the AI where to go on the track >in various situations. >
Yep :-) >Would it be more advantageous to make it so that the AI >can "tell" what the best line is through a corner without >someone (human) having to draw a line on the track for it >to follow? That is something I'd very much like to try, but it's truly a horrendously complicated thing to write code that lets a computer "learn" how to drive a car around a given track as fast as possible. How does a human decide what to do, and when, to accomplish this task? It's remarkably complicated to quantify it. However.... Fuzzy logic in combination with some learning algo seems to be the most promising way to go about it, but I haven't tried it so can't give any tips on it. Or would the advantages of that approach be >more than offset by the huge programming challenges >that would entail? Basically yeah, although different developers probably feel differently about it. I think it'd be cool to do, but on the other hand I think it's very unlikely that even a good fuzzy logic system will run a car faster around a track than a good human driver will. Hence, I figured it was best to save myself the trouble and just record the lines and target speeds from the superior human driver and be done with it ;-) There are options though for creating AI that really learn the tracks on their own. For instance, I have gates set up across the track where the points that the AI splines run through. It should be feasible to let a genetic algorithm adjust the points around and try to figure out a "best line" without even bothering with recording a replay. The target speeds could be initially set based on the curvature of the spline in all locations, and an estimate of laptime might be made based on this without actually making the AI drive countless laps for weeks on end to figure out what works... But even then, a good human driver will pop off a faster lap anyway so it may not be worth the trouble :-) Will sims still be using LP lines 20 years >from now? > > John DiFool > Some probably will. However, if you can say that your sim uses an approach like you described where it truly learns the track on its own and has all of this extra sophistication, it will probably sell more so you have to weigh that in with your decision as to how to implement the AI. Technology will probably move away from replay lines 20 years from now as folks figure out new methods, computers get fast enough to run them in real time, and people communicate this stuff with each other. Todd Wasson Racing Software http://PerformanceSimulations.com http://performancesimulations.com/scnshot4.htm
Good post Todd, just to add my 2p to the thread as another developer: Racing AI at the bottom end tends to be totally pre-determined, and at the top end totally "free" (i.e. the AI works everything out for itself on the fly). The main problem is, totally free is complex, and the hardest part is "reading the road" - mainly because of the volume of data you have to process to get good results. Think about what it takes to work out a racing line - a mental representation of the road, experience of having driven it, knowledge of your car, track conditions, etc, and then add on all the stuff in your brain that processes spatial information! So what tends to happen is you approximate. Racing lines will probably be around for a while yet, because its a massive compression of complex information into simple information. I've written a Genetic Algorithm to get cars creating their own racing line and it works, but it takes quite a while. You wouldn't let a consumer run it on the their PC or PS2. You can relax a lot of the other constraints though - for example, if your AI "knows" how much grip it's got, the width and radius of the track and a racing line at various points, it can calculate it's braking and acceleration and can wander off the line, or modify it on the fly to try out variations or avoid other cars, giving an impression of a sentient driver. You can also play with these values based on the drivers personality and "emotion" to further vary it. I've used a method like this for a while and it works well. To answer the initial post, you won't find too much. I once saw a paper on Midtown Madness AI, but that's it. Try to think of all the data an AI needs, then think about how to represent this in a way that can be used realtime, then think about how you can modify the information on the fly. Think about the constraints of your system, and what happens if you can relax them. You should be able to come up with quite a few ideas, but many will have been done before! Other key things are, you have to consider the ability levels of your players, whether your AI will cheat ,and ideally all behaviour will be deterministic. Have fun, Jeff.
"Jeff" <[email hidden]> wrote in news:c7tgot$4gq$1$[email hidden]:
Quoted text (11 lines)> Good post Todd, just to add my 2p to the thread as another developer: > > Racing AI at the bottom end tends to be totally pre-determined, and at > the top end totally "free" (i.e. the AI works everything out for > itself on the fly). The main problem is, totally free is complex, and > the hardest part is "reading the road" - mainly because of the volume > of data you have to process to get good results. Think about what it > takes to work out a racing line - a mental representation of the road, > experience of having driven it, knowledge of your car, track > conditions, etc, and then add on all the stuff in your brain that > processes spatial information!
Wow! maybe that's my problem. I was always told to drive with the seat of my pants. Whats this Brain thingie? > (snip)
Quoted text (17 lines)> > To answer the initial post, you won't find too much. I once saw a > paper on Midtown Madness AI, but that's it. Try to think of all the > data an AI needs, then think about how to represent this in a way that > can be used realtime, then think about how you can modify the > information on the fly. Think about the constraints of your system, > and what happens if you can relax them. You should be able to come up > with quite a few ideas, but many will have been done before! Other key > things are, you have to consider the ability levels of your players, > whether your AI will cheat ,and ideally all behaviour will be > deterministic. > > Have fun, > > > Jeff. >
Has any sim attempted to creat BOTS rather than packs? From what I gather, all the AI cars try to basically follow the same set of parameters regarding lines, speed, etc. I know many sims allow a range of responses within that set, but still, the whole field is all using the same info. Would not a BOT system, similar to the FPS games allow more freedom from each car/driver? For instance, Michael Andretti has always taken flat ovals in a Diamond patterned turn. Instead of starting wide and clipping the middle of an oval's corner, he regularly dives sharply early and apexes halfway up the track surface. Almost squaring the corner. Most of the rest of the field he's competed against take a smoother late entry line. Could this sort of behaivor be simulated? dh >
Todd Gibbs 12 May 2004 16:15 UTC↳ reply to Jeff#37734
Very true. From a Game-Development perspective another thing to consider is "what is actually perceivable by the consumer?" and "What is the minimum work to do the job effectively and efficiently?". Given the tight deadlines that games are developed to nowadays there is little point investing a year developing a really clever algorithm that automatically calculates the best racing line, braking points and everything when a simple hand-drawn racing line will give the same results in a fraction of the time. Its kind of sad really but unless there are some really noticeable advantages of the more complex techniques I can't see games moving on. Regards, Todd. "Jeff" <[email hidden]> wrote in message news:c7tgot$4gq$1$[email hidden]...
Quoted text (42 lines)> Good post Todd, just to add my 2p to the thread as another developer: > > Racing AI at the bottom end tends to be totally pre-determined, and at the > top end totally "free" (i.e. the AI works everything out for itself on the > fly). The main problem is, totally free is complex, and the hardest part is > "reading the road" - mainly because of the volume of data you have to > process to get good results. Think about what it takes to work out a racing > line - a mental representation of the road, experience of having driven it, > knowledge of your car, track conditions, etc, and then add on all the stuff > in your brain that processes spatial information! > > So what tends to happen is you approximate. Racing lines will probably be > around for a while yet, because its a massive compression of complex > information into simple information. I've written a Genetic Algorithm to get > cars creating their own racing line and it works, but it takes quite a > while. You wouldn't let a consumer run it on the their PC or PS2. > > You can relax a lot of the other constraints though - for example, if your > AI "knows" how much grip it's got, the width and radius of the track and a > racing line at various points, it can calculate it's braking and > acceleration and can wander off the line, or modify it on the fly to try out > variations or avoid other cars, giving an impression of a sentient driver. > You can also play with these values based on the drivers personality and > "emotion" to further vary it. I've used a method like this for a while and > it works well. > > To answer the initial post, you won't find too much. I once saw a paper on > Midtown Madness AI, but that's it. Try to think of all the data an AI needs, > then think about how to represent this in a way that can be used realtime, > then think about how you can modify the information on the fly. Think about > the constraints of your system, and what happens if you can relax them. You > should be able to come up with quite a few ideas, but many will have been > done before! Other key things are, you have to consider the ability levels > of your players, whether your AI will cheat ,and ideally all behaviour will > be deterministic. > > Have fun, > > > Jeff. > >
> Has any sim attempted to creat BOTS rather than packs? From what I > gather, all the AI cars try to basically follow the same set of > parameters regarding lines, speed, etc. I know many sims allow a range > of responses within that set, but still, the whole field is all using the > same info. Would not a BOT system, similar to the FPS games allow more > freedom from each car/driver? Well, I'd think of a car / driver system as a kind of paired bot system - and yes, there are games that have treated drivers as bots - the one semi-sim I worked on did for instance, I'm sure many others do, not least F1 games.
Quoted text (9 lines)> For instance, Michael Andretti has always taken flat ovals in a > Diamond patterned turn. Instead of starting wide and clipping the middle > of an oval's corner, he regularly dives sharply early and apexes halfway > up the track surface. Almost squaring the corner. Most of the rest of > the field he's competed against take a smoother late entry line. Could > this sort of behaivor be simulated? > dh > > >
Without a doubt. As long as you isolate your driver code from your racing code and your car code, it should be fine. You could either model sections of racing line, or in a nicer way, set some parameters that define how that driver tweaks the racing line in a given set of circumstances. This would be a fun one to play with, because your relaxing few constaints and adding a lot of personality to your game.
"Alan Le" <[email hidden]> wrote: | Isn't that how LFS is? They supposedly get smarter the more they run the | track. I never got to that point though. Last time I played, they were | still running into tire stacks and such. I don't know about "smarter", but LFS AI drivers become more familiar with the track. They don't, however, keep their cars off your paint job, but they do pull some quick lap times. What I've done before is make a car setup with zero damping, maximum ride height, nice springy springs (not absolutely stiff), outrageous positive camber and toe-out, and run high-pressure knobbies. Despite this horrible setup, the AI are able to somewhat maneuver these jacked-up GTIs around the track, bobbling around. This was done to watch how the AI re-learns the track with such poor handling. [plus it's fun to get in the MRT5 and zig-zag through the slow field...] But I digress. -bpb
On Tue, 11 May 2004 23:21:18 GMT, John DiFool <[email hidden]> wrote:
Quoted text (8 lines)>On Tue, 11 May 2004 17:48:20 GMT, Joe62 ><[email hidden]> wrote: > >>Does anyone have pointers to articles or resources on the web where I >>can research this topic? I want to learn about the various approaches >>that have been tried, and understand their benefits and drawbacks. > >Good question. I was just pondering that the other day.
There's a book called 'AI Programming Wisdom' which has a couple of chapters on AI driving. Some presumably from a programmer who did Midtown Madness, others by people who tackled the program in a far more elegant way. ;-) >I'm no programmer, but I wondered just how much "hand- >holding" an AI needs. Quite a bit it seems. Depends on how far you want to stretch your driver model. The better the driver model, the less performance CPU-wise, and the less hand-holding.
Quoted text (9 lines)> For example, AFAIK most racing >AIs are coded using various racing lines made by human >programmers, which tell the AI where to go on the track >in various situations. > >Would it be more advantageous to make it so that the AI >can "tell" what the best line is through a corner without >someone (human) having to draw a line on the track for it >to follow?
Advantageous in what way? It WILL cost more CPU, so that's not an advantage. The driving line from a human driver is a nice starting point, even when the AI would make up its own mind. At least it has a starting point and then can choose to brake later, brake sooner, turn in more etc... Ruud van Gaal Free car sim: http://www.racer.nl/ Pencil art : http://www.marketgraph.nl/gallery/
On Wed, 12 May 2004 01:40:50 +0100, Peter Ives <[email hidden]> wrote: >In article <[email hidden]>, John DiFool ><[email hidden]> writes... >>Would it be more advantageous to make it so that the AI >>can "tell" what the best line is through a corner without >>someone (human) having to draw a line on the track for it >>to follow?... >In my view, AI won't come of age until you can give it >a track and it can learn how to drive around it just like us humans, >whilst at the same time, having various weightings which allow some AI >to learn and drive better than others. I'm not that sure; the point of AI is give nice gameplay, not be the smartest driver ever. That's another area of research which doesn't intersect that much with racing sims, I think. Ruud van Gaal Free car sim: http://www.racer.nl/ Pencil art : http://www.marketgraph.nl/gallery/
In article <c7tigq$1qo$1$[email hidden]>, [email hidden] (Todd Gibbs) wrote: > From a Game-Development perspective Oi! Stop working on driving games and get back to a sequel to EECH! Please? Pretty please? <pregnant pause> No? Bugger. What's wrong, you guys want to make a profit? ;-) Andrew McP... living in a dreamworld :-)
In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_A [email hidden]> writes
Quoted text (21 lines)>On Wed, 12 May 2004 01:40:50 +0100, Peter Ives ><[email hidden]> wrote: > >>In article <[email hidden]>, John >DiFool >><[email hidden]> writes >... >>>Would it be more advantageous to make it so that the AI >>>can "tell" what the best line is through a corner without >>>someone (human) having to draw a line on the track for it >>>to follow? >... >>In my view, AI won't come of age until you can give it >>a track and it can learn how to drive around it just like us humans, >>whilst at the same time, having various weightings which allow some AI >>to learn and drive better than others. > >I'm not that sure; the point of AI is give nice gameplay, not be the >smartest driver ever. That's another area of research which doesn't >intersect that much with racing sims, I think. >
But the trouble is with most sims that I've played, after a while you realise that the variation in AI lines into a corner is absolutely zero. This makes them very predictable and nothing like human drivers which destroys the illusion of racing against other real drivers. I'm not sure I agree with the point of AI is to give nice gameplay either, unless of course you mean by gameplay the feeling that you are racing against other 'intelligent' and 'unpredictable' drivers of course. :) -- Peter Ives (AKA Pete Ivington) Remove ALL_STRESS before replying via email If you know what's good for you, don't listen to me :) GPLRank Joystick -50.63 Wheel -25.01
In article <[email hidden]>, J. Todd Wasson <[email hidden]> writes <snip>
Quoted text (33 lines)> >Aside from the steering controller is a throttle/brake controller. I've tried >2 different things: > >1) The first way I tried was to use the same type of approach as was done >for >steering. Using the distance and tangential speed from the racing line the >car >wanted to follow, the throttle gain might be reduced. I.e., if the car went a >bit too far off the line the throttle is "slowly" released and if that's not >enough to fix the situation, the brake is progressively applied. Eventually >the car slows down enough to get back on the line, and the throttle increases >again on its own. > >That works pretty well as long as you're not coming off a straight into a tight >turn. The car won't see ahead far enough to know that it's going to go off the >line. So what I did was come up with a learning algorithm that was pretty >slick. The cars would run through a learning phase (just during >development). > > >The car would basically race full blast into the first turn and if it went too >far off the line, it would create a braking point some distance behind where it >went off. Eventually the car would return to the line and it would remember >an >"end brake" point. So basically it created its own braking zone. It would >then run the rest of the track (while possibly going off at all the other >corners) and when it ran through turn 1 again it would adjust the "start >braking" point forward or backwards a little bit each lap until the car didn't >go too far off the line. Then it would adjust the "end braking" point to the >spot where the car went the furthest off the track, and voila, it would >eventually learn to brake enough to make the turn on its own. >
But are the AI cars braking as efficiently as a human driver? Also, how do you create a little variety in their braking ability to avoid them all braking at exactly the same point and at the same rate of deceleration?
Quoted text (17 lines)>Then it would proceed to the next spot where the car goes off, and after >several laps it would learn where to brake and for how long. Eventually after >60-100 laps the cars would learn the whole track and turn not too shabby >laptimes. It's neat to watch them learn the track that way, but they are still >following racing lines that I'd lay down with a spline editor tool. > >2) The method above turned out not work as well as I'd hoped for my >particular >application. The cars weren't as fast through the turns as they could be. So >instead, I just recorded a bunch of my laps and set the AI throttle controller >to simply try to match the speed I was running at various points around the >track. This looks a lot better and the cars are faster, even though it's >infinitely simpler to implement and the cars aren't really learning anything. >Who knows though, maybe somebody else could make method 1 work >better than 2... >:-) >
Is that because the cars are slower through the corner or into the corner? You already have a way of measuring whether they are drifting away from the ideal line under braking. Did you use method 1 to determine the optimum speed through the corner as well? If so, then perhaps the algorithm used is too slow in that it allows the AI driver to lift/brake for too long before getting back on the ideal line or waits too long before determining whether the car has drifted too far off the line? Mind you , I just noticed that you stated later that your AI cars just understeer at the moment. I'm sure that goes a long way to preventing decent laps. A human driver probably makes 10 or 20 minor adjustments from understeer to oversteer whilst taking any one corner. If all we could do as drivers was to turn in and hope the car wasn't going to understeer away from the corner then I'm sure our laps would be pretty shabby as well. <snip> -- Peter Ives (AKA Pete Ivington) Remove ALL_STRESS before replying via email If you know what's good for you, don't listen to me :) GPLRank Joystick -50.63 Wheel -25.01
>And ultimately is it worth while at all going to the lengths to get an AI to >ack like a human when our technology is improving all the time for "online" >human vs human racing. Sure, it's worthwhile. Some people don't have a fast enough internet connection. Others tire of getting beat everytime they go online. Having AI in the game means they can run in a fairly competitive race occasionally. Eldred -- http://www.umich.edu/~epickett Screamers League IICC League GPLRank -6.0 MoGPL rank +267.80 Ch.Rank +52.58 MoC +741.71 Hist. +82.34 MoH:na N2k3 rank:in progress Slayer Spektera lvl 72 assassin Slayer Spectral_K lvl 38 Necro US East
>If all we >could do as drivers was to turn in and hope the car wasn't going to >understeer away from the corner then I'm sure our laps would be pretty >shabby as well. > You've been spying on me, haven't you? Eldred -- http://www.umich.edu/~epickett Screamers League IICC League GPLRank -6.0 MoGPL rank +267.80 Ch.Rank +52.58 MoC +741.71 Hist. +82.34 MoH:na N2k3 rank:in progress Slayer Spektera lvl 72 assassin Slayer Spectral_K lvl 38 Necro US East
Its a nice idea... how about if we strap a radar and some Hellfires to a Mustang 68' instead ? :) Todd. "Andrew MacPherson" <[email hidden]> wrote in message news:[email hidden]...
Quoted text (17 lines)> In article <c7tigq$1qo$1$[email hidden]>, [email hidden] > (Todd Gibbs) wrote: > > > From a Game-Development perspective > > Oi! Stop working on driving games and get back to a sequel to EECH! > Please? > > Pretty please? > > <pregnant pause> > > No? > > Bugger. What's wrong, you guys want to make a profit? ;-) > > Andrew McP... living in a dreamworld :-)
In article <c7vbe6$l0d$1$[email hidden]>, [email hidden] (Todd Gibbs) wrote: > Its a nice idea... how about if we strap a radar and some Hellfires to > a Mustang 68' instead ? :) Stop it, you're playing with my dreams ;-) On a serious note, EECH really was only a few major tweaks away from being the perfect combination of simulation and game. The gameplay side of thing has been ignored by far too many developers. So thanks for that and good luck in your current/future projects. As long as you guys are still working there's always hope you'll get filthy rich and return to your flight sim roots as a hobby to stop you getting bored ;-) Andrew McP
Thanks Andrew :) Are you involved in the open-source EECH development project ? If you are interested I can provide a link/email address. Perhaps email me personally for more info. Kind Regards, Todd. "Andrew MacPherson" <[email hidden]> wrote in message news:[email hidden]...
Quoted text (16 lines)> In article <c7vbe6$l0d$1$[email hidden]>, [email hidden] > (Todd Gibbs) wrote: > > > Its a nice idea... how about if we strap a radar and some Hellfires to > > a Mustang 68' instead ? :) > > Stop it, you're playing with my dreams ;-) > > On a serious note, EECH really was only a few major tweaks away from being > the perfect combination of simulation and game. The gameplay side of thing > has been ignored by far too many developers. So thanks for that and good > luck in your current/future projects. As long as you guys are still > working there's always hope you'll get filthy rich and return to your > flight sim roots as a hobby to stop you getting bored ;-) > > Andrew McP
In article <c7vm5g$8mc$1$[email hidden]>, [email hidden] (Todd Gibbs) wrote: > Are you involved in the open-source EECH development project ? Only as an interested onlooker. I got as far as looking at the source code, then remembered it's ten years since I did any programming, and then it was pure ARM assembler. Curly brackets still scare the sh*t out of me :-) There's obviously a limit to how far the EECH code can be tweaked by enthusiasts, but I admire their efforts greatly. What I was looking for in the imaginary sequel was something that would allow complete (or at least more advanced) planning of the battlefield... tasking ground forces and creating missions (including establishing supply lines) to support them rather than having the campaign engine in full control. Still, at least it has a campaign engine, that's better than most! And I still think the virtual cockpit of the Hokum is *the* most immersive flight sim cockpit ever. Amazing detail, great sim. Anyway, I'm wildly off topic for the group. I'll stop leading you astray down memory lane. ;-) Andrew McP
On Wed, 12 May 2004 22:22:23 +0100, Peter Ives <[email hidden]> wrote:
Quoted text (8 lines)>In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_A >[email hidden]> writes >>I'm not that sure; the point of AI is give nice gameplay, not be the >>smartest driver ever. That's another area of research which doesn't >>intersect that much with racing sims, I think. > >But the trouble is with most sims that I've played, after a while you >realise that the variation in AI lines into a corner is absolutely zero.
That can be resolved in software.
Quoted text (7 lines)>This makes them very predictable and nothing like human drivers which >destroys the illusion of racing against other real drivers. > >I'm not sure I agree with the point of AI is to give nice gameplay >either, unless of course you mean by gameplay the feeling that you are >racing against other 'intelligent' and 'unpredictable' drivers of >course. :)
I do mean that indeed. :) The point I'm trying to make is that just because we humans use a sophisticated neural network to drive, your goal is not to come to a point where you use a similar neural network in the computer to do the same thing. Your goal is still to fake the human into thinking the drivers are as human as online players. The methods too achieve that are irrelevant to the user; they just want to see it work. From an engineering perspective though, it is ofcourse relevant. And you can take a lot of shortcuts that make it a lot simpler to simulate a basic AI driver. Then you start to add varying behavior, based on the things you miss. Realise that to do it the Wests' way takes ages and doesn't necessarily provide a better result. Simple principles are more easily adapted to include tiny things. Some basic principles even allow for a whole lot of complex behavior, see the laws of physics for example. Ruud van Gaal Free car sim: http://www.racer.nl/ Pencil art : http://www.marketgraph.nl/gallery/
On Wed, 12 May 2004 22:45:54 +0100, Peter Ives <[email hidden]> wrote: >In article <[email hidden]>, J. Todd >Wasson <[email hidden]> writes... >But are the AI cars braking as efficiently as a human driver? Would be nothing wrong in just modifying the grip a little for AI to get them at the same level of braking ability compared to humans (who can perhaps more intelligently process the brake). Instead of going through lengths to learn AI to trailbrake. ;-) > Also, how >do you create a little variety in their braking ability to avoid them >all braking at exactly the same point and at the same rate of >deceleration? That's easy, just add a random number to the brake point distance... Ruud van Gaal Free car sim: http://www.racer.nl/ Pencil art : http://www.marketgraph.nl/gallery/
Hi all > Does anyone have pointers to articles or resources on the web where I > can research this topic? I want to learn about the various approaches > that have been tried, and understand their benefits and drawbacks. There are two AI racing simulation projects (freely) available: - TORCS, www.torcs.org - RARS, rars.sf.net TORCS is a very sophisticated simulation, it supports also input devices, so you can drive a car yourself. There is a tutorial about how to implement a basic AI-driver at www.berniw.org in the TORCS section. In commercial games the AI-drivers follow more or less a given (by the developers) trajectory. In some games I have the impression that the AI physics is not simulated the same way like the players car. In TORCS and RARS you can find various implementations: - Searching a trajectory in a pre-process on- or offline (optimization problem -> least squares, A*, neural networks, other machine learning approaches, etc.). - Reactive behaviour without preprocess. bye, Bernhard. -- visit my homepage http://www.berniw.org
> There are two AI racing simulation projects (freely) available: > - TORCS, www.torcs.org > - RARS, rars.sf.net > I found TORCS and RARS useful when I was researching racing AI, it's a good place to start. There were some pretty clever methods in there. There's no reason not to cross the offline and online elements, you get the best of both worlds - intelligent basic behaviour with individual reactive elements that players hopefully notice. What's nice is when you get quasi-emergent behaviour from AI drivers, it's just that in reality, players rarely notice. One of my main aims (kind of ongoing research and application) is to look at what players do and try to emulate that as an extra dimension to the AI. You get much more noticable reactions from players racing the AI. We currently use the same physics for AI as the player, even the same car model, so the AI has the same interface as the player, i.e. via steering, throttle, brake and gears. In the past we've used simpler models for the AI, because you can't have 20 cars racing with a full physics and car model. If we went back to that number of cars I'd look at some kind of LOD'ing scheme. It's easier with one model though, you don't have to match the performance across the two, which is a nightmare job. When (if) we make another sim fitting for this forum, I'll be sure to let you all know what sort of techniques we use, hell, you'll probably be able to test the thing! Jeff.
In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_A [email hidden]> writes
Quoted text (21 lines)>On Wed, 12 May 2004 22:45:54 +0100, Peter Ives ><[email hidden]> wrote: > >>In article <[email hidden]>, J. >Todd >>Wasson <[email hidden]> writes >... >>But are the AI cars braking as efficiently as a human driver? > >Would be nothing wrong in just modifying the grip a little for AI to >get them at the same level of braking ability compared to humans (who >can perhaps more intelligently process the brake). Instead of going >through lengths to learn AI to trailbrake. ;-) > >> Also, how >>do you create a little variety in their braking ability to avoid them >>all braking at exactly the same point and at the same rate of >>deceleration? > >That's easy, just add a random number to the brake point distance... >
But won't that just even out the braking ability for all AI drivers? What I want is for some AI drivers to be harder to outbrake into the corner than others. Just like human opponents. -- Peter Ives (AKA Pete Ivington) Remove ALL_STRESS before replying via email If you know what's good for you, don't listen to me :) GPLRank Joystick -50.63 Wheel -25.01
On Tue, 11 May 2004 17:48:20 GMT, Joe62 <[email hidden]> wrote: >Does anyone have pointers to articles or resources on the web where I >can research this topic? I want to learn about the various approaches >that have been tried, and understand their benefits and drawbacks. I can't answer your question, but I would recommend ignoring this entire thread and trying to see if you can find contact information for Geoff Crammond. He's the only person in the history of driving games who has made believable AI. Jason
On Fri, 14 May 2004 00:44:48 +0100, Peter Ives <[email hidden]> wrote:
Quoted text (16 lines)>In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_A >[email hidden]> writes >>On Wed, 12 May 2004 22:45:54 +0100, Peter Ives >><[email hidden]> wrote: >> >>>In article <[email hidden]>, J. >>Todd >>>Wasson <[email hidden]> writes >>> Also, how >>>do you create a little variety in their braking ability to avoid them >>>all braking at exactly the same point and at the same rate of >>>deceleration? >> >>That's easy, just add a random number to the brake point distance... >> >But won't that just even out the braking ability for all AI drivers?
Not if you adjust it per AI driver. >What I want is for some AI drivers to be harder to outbrake into the >corner than others. Just like human opponents. Then you add some braking ability per AI, based on a personality factor. If that means braking a bit better than possible according to the physics model, you give it a little bit more grip, or add some to the resulting deceleration. Ruud van Gaal Free car sim: http://www.racer.nl/ Pencil art : http://www.marketgraph.nl/gallery/
Quoted text (32 lines)>From: Peter Ives [email hidden] >Date: 5/13/2004 6:44 PM Central Daylight Time >Message-id: <[email hidden]> > >In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_A >[email hidden]> writes >>On Wed, 12 May 2004 22:45:54 +0100, Peter Ives >><[email hidden]> wrote: >> >>>In article <[email hidden]>, J. >>Todd >>>Wasson <[email hidden]> writes >>... >>>But are the AI cars braking as efficiently as a human driver? >> >>Would be nothing wrong in just modifying the grip a little for AI to >>get them at the same level of braking ability compared to humans (who >>can perhaps more intelligently process the brake). Instead of going >>through lengths to learn AI to trailbrake. ;-) >> >>> Also, how >>>do you create a little variety in their braking ability to avoid them >>>all braking at exactly the same point and at the same rate of >>>deceleration? >> >>That's easy, just add a random number to the brake point distance... >> >But won't that just even out the braking ability for all AI drivers? >What I want is for some AI drivers to be harder to outbrake into the >corner than others. Just like human opponents. >-- >Peter Ives (AKA Pete Ivington)
You could make the randomness not quite so random. AI #1 might brake randomly between 20 and 50 feet before the "ideal" point. AI #2 might do it between 10 and 20 feet. AI #3 might be overly agressive and brake between 10 foot to early and 20 feet too late. Or, maybe AI #3 acted like AI #1 until you bumped him a few times from the back and ticked him off ;-) He gets impatient and starts making mistakes in an effort to brake later or whatever. Todd Wasson Racing Software http://PerformanceSimulations.com http://performancesimulations.com/scnshot4.htm
Quoted text (12 lines)>From: Peter Ives [email hidden] >Date: 5/12/2004 4:45 PM Central Daylight Time >Message-id: <[email hidden]> > >In article <[email hidden]>, J. Todd >Wasson <[email hidden]> writes ><snip> >> >>Aside from the steering controller is a throttle/brake controller. I've >tried >>2 different things: >>
<snip>
Quoted text (8 lines)>>Who knows though, maybe somebody else could make method 1 work >>better than 2... >>:-) >> >Is that because the cars are slower through the corner or into the >corner? You already have a way of measuring whether they are drifting >away from the ideal line under braking. Did you use method 1 to >determine the optimum speed through the corner as well?
No, method 1 didn't try to figure out the optimum speed. This was for RC cars where basically they run full steering lock in the corner, then use the throttle to keep the line. My thinking was basically that if I apply full or less than full steering lock and the car is having no problem following the line, then you should increase throttle. Once it's trailing off the line, reduce it. Nice and simple theoretically, but in the really tight corners it slowed down too much. Method #2 used target speeds instead and could run through the same corner much faster. If so, then >perhaps the algorithm used is too slow in that it allows the AI driver >to lift/brake for too long before getting back on the ideal line or >waits too long before determining whether the car has drifted too far >off the line? > I played a bit with the throttle/brake gain rates. Even if the AI car reaction time was 1/300 of a second and it had a lightning fast trigger finger, method 1 just didn't work as well.
Quoted text (8 lines)>Mind you , I just noticed that you stated later that your AI cars just >understeer at the moment. I'm sure that goes a long way to preventing >decent laps. A human driver probably makes 10 or 20 minor adjustments >from understeer to oversteer whilst taking any one corner. If all we >could do as drivers was to turn in and hope the car wasn't going to >understeer away from the corner then I'm sure our laps would be pretty >shabby as well. >
Maybe you're right, I don't know. Method 2 was just so much easier and it worked better straight off so I kept it. Granted, method 1 did work well everywhere except on the tightest corners. Plus it was just cool to watch the cars making essentially better and better lines by themselves (until they actually got on the line I defined, that is). I'd go take a smoke break and come back to check their laptimes. It was pretty fun and interesting to watch because it looks like they're really learning (they were, I suppose), but the performance just wasn't as good as letting them chase my laps around, especially in the slowest corners. Come to think of it, a lot of it might have been spline inaccuracy. If there's so much as a kink anywhere the car will think it's on a tight turn and let up. Also, the car wasn't really measuring from the center of the car, but from a point out in front of it that moved further down the track as the car went faster. Perhaps at low speed the point was too far forward so it thought it was going off when it really wasn't and slowed down too much. But if I didn't have the point out far enough, it would criss cross the line and dart around in a pretty fake way. It was just such a tough balance to work out that I tried the other way and it ended up working better all around, and it was much faster to come up with the lines in the first place; more driving lines to pick from. With 20 second lap times it doesn't take long to get 50 or so lines :-)
Quoted text (11 lines)>-- >Peter Ives (AKA Pete Ivington) >Remove ALL_STRESS before replying via email >If you know what's good for you, don't listen to me :) >GPLRank Joystick -50.63 Wheel -25.01 > > > > > >
Todd Wasson Racing Software http://PerformanceSimulations.com http://performancesimulations.com/scnshot4.htm
On Fri, 14 May 2004 02:06:28 GMT, [email hidden] (Jason Moyer) wrote: >I can't answer your question, but I would recommend ignoring this >entire thread and trying to see if you can find contact information >for Geoff Crammond. He's the only person in the history of driving >games who has made believable AI. Well, on that note ... if anyone knows an experienced race-AI programmer who's looking for work (Geoff or otherwise!) ... please pass along my email address. This would be for a real opportunity at a quality game dev company that's had some success with driving games. Online programming an asset.
In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_ [email hidden]> writes
Quoted text (23 lines)>On Fri, 14 May 2004 00:44:48 +0100, Peter Ives ><[email hidden]> wrote: > >>In article <[email hidden]>, Ruud van Gaal ><_KI_LLSP_A >>[email hidden]> writes >>>On Wed, 12 May 2004 22:45:54 +0100, Peter Ives >>><[email hidden]> wrote: >>> >>>>In article <[email hidden]>, J. >>>Todd >>>>Wasson <[email hidden]> writes >>>> Also, how >>>>do you create a little variety in their braking ability to avoid them >>>>all braking at exactly the same point and at the same rate of >>>>deceleration? >>> >>>That's easy, just add a random number to the brake point distance... >>> >>But won't that just even out the braking ability for all AI drivers? > >Not if you adjust it per AI driver. >
Not sure I made myself clear. What I meant was, that it appears that by just adding a random number for each driver that all you end up with are drivers who's braking ability varies each lap, but around the same braking point. So over a course of laps all drivers braking would even out. In my view, what would also need to be included is some kind of weighting factor per driver that influences the random number generated so that better AI drivers tend to brake nearer the perfect braking point, whilst lesser AI drivers tend to brake further away from it (both too early or too late). Similar to what you stated below, perhaps, though I'm just clarifying things. ;-)
Quoted text (8 lines)>>What I want is for some AI drivers to be harder to outbrake into the >>corner than others. Just like human opponents. > >Then you add some braking ability per AI, based on a personality >factor. If that means braking a bit better than possible according to >the physics model, you give it a little bit more grip, or add some to >the resulting deceleration. >
Only necessary if you cannot get the AI to brake as well under same physics as a human, of course. :) -- Peter Ives (AKA Pete Ivington) Remove ALL_STRESS before replying via email If you know what's good for you, don't listen to me :) GPLRank Joystick -50.63 Wheel -25.01
On Fri, 14 May 2004 21:56:59 +0100, Peter Ives <[email hidden]> wrote:
Quoted text (19 lines)>In article <[email hidden]>, Ruud van Gaal <_KI_LLSP_ >[email hidden]> writes >>>>That's easy, just add a random number to the brake point distance... >>>> >>>But won't that just even out the braking ability for all AI drivers? >> >>Not if you adjust it per AI driver. > >Not sure I made myself clear. What I meant was, that it appears that by >just adding a random number for each driver that all you end up with are >drivers who's braking ability varies each lap, but around the same >braking point. So over a course of laps all drivers braking would even >out. > >In my view, what would also need to be included is some kind of >weighting factor per driver that influences the random number generated >so that better AI drivers tend to brake nearer the perfect braking >point, whilst lesser AI drivers tend to brake further away from it (both >too early or too late).
As you stated just the implementation, that's certainly possible. ;-)
Quoted text (10 lines)>>>What I want is for some AI drivers to be harder to outbrake into the >>>corner than others. Just like human opponents. >> >>Then you add some braking ability per AI, based on a personality >>factor. If that means braking a bit better than possible according to >>the physics model, you give it a little bit more grip, or add some to >>the resulting deceleration. >> >Only necessary if you cannot get the AI to brake as well under same >physics as a human, of course. :)
That's the whole point; getting to that limit is very hard to do by emulating a human, and much much easier by just cheating a little bit. For a game, you quickly use the cheat, and as Todd found out, sometimes the cheating way is even better than trying to do the 'real thing'. :) Ruud van Gaal Free car sim: http://www.racer.nl/ Pencil art : http://www.marketgraph.nl/gallery/
No One 15 May 2004 04:07 UTC↳ reply to Joe62#37461
Joe62 wrote: > Does anyone have pointers to articles or resources on the web where I > can research this topic? I want to learn about the various approaches > that have been tried, and understand their benefits and drawbacks. They all seem to drive like graduates from the Michael Andretti Driving School for the Blind.
Hi Joe62 > Well, on that note ... if anyone knows an experienced race-AI > programmer who's looking for work (Geoff or otherwise!) ... please > pass along my email address. This would be for a real opportunity at a > quality game dev company that's had some success with driving games. > Online programming an asset. I'm an AI-Programmer of the TORCS (www.torcs.org) project. If you are interested in me, please visit my homepage www.berniw.org, you can find there a shortened CV of me and my TORCS robot (AI) tutorial. bye, Bernhard. -- visit my homepage http://www.berniw.org

Sponsors

Affiliate Links

Sim Gaming Expo MOZA Racing Sim-Lab Fanatec TrakRacer Asetek Internet Privacy From NordVPN Dreamhost Capital One Credit Card Application Fanatical CDKeys Amazon Amazon UK Project Motor Racing iRacing Get your racing gloves, boots and more from Demon Tweeks. Enlist at Roberts Space Industries, developers of Star Citizen and Squadron 42


Back from the ashes since July, 2019. First created in 2001 with the merger of Legends Central (founded 1999) and simracing.dk.

A site by a sort of sim racer, for sim racers, about racing sims. News and information on both modern and historic sim racing software titles.

All products and licenses property of their respective owners.


Facebook Threads Bluesky Twitter Mastodon Instagram YouTube Tiktok Twitch Reddit Google News Apple News Subscribe via WordPress Flipboard eBay

Race Sim Central © 1999-2026 | Some links pay RSC a commission. Advertising does not equal endorsement.Cookie Policy