What makes good AI?

This is becoming reminiscent of the sound argument. It's safe to say no game is good enough, and (just as with sound) I'd personally covet a sea change in approach before I'd covet X or Y game's slightly different take on the same old hacks, which I've endured for years already.
IMO Grid Autosport AI was good enough for me and more than a match for GT. Copy and paste it into GT7, tone down the aggressiveness and 99% of GT fans would be in heaven. They fought with each other for position, they ran different race lines, two wide was no problem around corners. People run into issues with them IMO because they try to drive like they do in GT, smash and crash their way to the front and they made the AI far more aggressive than they would normally be if you just drove like a real race driver. On the other hand I treated it like a real race and didn't rub and push my way to the front and had a fantastic experience while doing so.

Not sure if everyone here is aware, but Codies had a GTP Forum Ambassador of sorts, @anim8r_uk, and he was giving us guidance and asking questions even before the game was launched. I played the game based on his advice and it was a great experience, mostly offline.
 
False. Almost all (semi-)sim AI is groove based. Any "behaviours" you see are programmed deviations from that line. Please describe this "wide range of methods".

Please point me to the source of this "groove based" algorithm. Do you mean the optimum line (which of course is different depending on mass, grip, speed) or do you mean the track, which would of course be defined as a fuzzy boundary in any algorithm.

Some games pre-calculate a path for each vehicle. Easy to spot if you restart the event, hang back and watch the same cars perform identical moves each time.

However there are other ways of doing it, real time with binary decision trees for example.

I can't quite understand how overtaking is used as a point of contrast to GT's AI, when it clearly demonstrates the same.

You are simply not making sense to me. I look forward to a link referencing this "groove" algorithm, otherwise have a nice day.
 
AI means Artificial Intelligence. AI should behave like humans in every meaning. AI should be competitive and know it is driving against a human instead of just following its racing line as if no one else was on the track. We humans make mistakes, and so should the AI. AI should be much faster than it is and reckless as well, willing to take chances, even if that means making mistakes in the progress. The current AI is laughably bad, the fact that one can win a race over the span of two laps, starting from the back of the pack, with a worse car than the AI, shows the game is nothing like real life. Rubberbanding should be done for as well.

FIFA 14 has sliders that allow you to adjust the AI's style of play and skills. Something like that would be useful for GT, perhaps you could create your own AI drivers to race against, and adjust global scales on a different setting. Features like that always pay off because there are dedicated people willing to find the best balance between gaming and real life. It also prevents "good AI" from becoming "god-like AI".

EDIT: Just noticed the Madden post in the previous page, another EA Sports game.
 
Last edited:
IMO Grid Autosport AI was good enough for me and more than a match for GT. Copy and paste it into GT7, tone down the aggressiveness and 99% of GT fans would be in heaven. They fought with each other for position, they ran different race lines, two wide was no problem around corners. People run into issues with them IMO because they try to drive like they do in GT, smash and crash their way to the front and they made the AI far more aggressive than they would normally be if you just drove like a real race driver. On the other hand I treated it like a real race and didn't rub and push my way to the front and had a fantastic experience while doing so.

Not sure if everyone here is aware, but Codies had a GTP Forum Ambassador of sorts, @anim8r_uk, and he was giving us guidance and asking questions even before the game was launched. I played the game based on his advice and it was a great experience, mostly offline.
That's fine, as with sound, I'd still prefer the sea change, personally.

Please point me to the source of this "groove based" algorithm. Do you mean the optimum line (which of course is different depending on mass, grip, speed) or do you mean the track, which would of course be defined as a fuzzy boundary in any algorithm.

Some games pre-calculate a path for each vehicle. Easy to spot if you restart the event, hang back and watch the same cars perform identical moves each time.

However there are other ways of doing it, real time with binary decision trees for example.



You are simply not making sense to me. I look forward to a link referencing this "groove" algorithm, otherwise have a nice day.
How is the line different for differing mass? It's a pure geometric problem (my favourite). See here.

The groove implicitly stores radius of curvature, which implies acceleration if speed is known, so by cross referencing tyre grip (available acceleration), the "AI" knows exactly how fast it can go at every point on the track, regardless. Then you add deviations (e.g. decision trees, binary or otherwise) and corrections to that to give the impression of intelligence.

As for spotting the exact same behavior after a restart, never heard of a random number generator?

Don't think you can avoid describing this wide range of methods, Mr. Have-a-nice-day.
 
It wouldn't surprise me at all to learn that the AI in GT uses a reduced physics system as well. It seems like an easy way to save CPU cycles: you only need enough physics to generate a car that looks believable, which is a lot easier than generating a car that feels believable to drive.

In fact, if Polyphony didn't do that then they're idiots. There would be no excuse for wasting power like that when they're obviously so tight as it is.

Yep, agree with you totally. All that's needed is the illusion that other cars are really racing against you.
 
I never drive a "crash and bash" style in any game, even gt, and I had problems with brain dead ai in every codies game ive played (both grid games, dirt 2 and all the f1 titles). Maybe they are good enough for you, and that's fine. Personally I don't find they feel at all like racing against real drivers.
 
The differences are quite noticeable between games. For example watch a GT replay and cars rarely deviate from the driving line. In many other games you will see AI cars coming off-line in order to pass other AI cars not just the player.
I've often seen AI racing each other in replays, such as coming off-line to pass other AI. Most of it you never see unless switching between drivers in a replay. When they are alone they generally stick to the racing line though.
 
I never drive a "crash and bash" style in any game, even gt, and I had problems with brain dead ai in every codies game ive played (both grid games, dirt 2 and all the f1 titles). Maybe they are good enough for you, and that's fine. Personally I don't find they feel at all like racing against real drivers.

Even though Codies' AI is not perfect, it's flawed in ways such as being too aggressive. I can't see how you came to the conclusion of calling it "brain dead." It's not slow. In terms of speed Codemaster's games have one of the best AI around.

I've often seen AI racing each other in replays, such as coming off-line to pass other AI. Most of it you never see unless switching between drivers in a replay. When they are alone they generally stick to the racing line though.

It's not the AI racing amongst themselves. When an AI opponent gets close enough to the next opponent in front of them, they swoop in for a [slow] overtaking. And since they're all following the same line and traveling at the same speed, the only way AI opponents get closer to the opponent in front of them is if their car is faster than the rest.

It's pretty lame.
 
Last edited:
It's a pure geometric problem (my favourite). See here.

It's not quite a pure geometric problem.

Finding the shortest line around the track is pure geometry. Finding the fastest line around the track means that you have to take the sequence of corners and straights into account, as well as the car to some degree.

If there's a big straight after the corner you may be best taking a late apex to maximise your speed down the straight. If there are a series of corners then you may need to take a sub-optimal line through one or more of them to optimise your speed through all of them.
If your car has great traction, like a 911 or something, you may be more biased towards late apexes to take advantage of that.
Downforce modifies it even further, my favourite example being corners 3 and 4 at Watkins Glen. A car with significant downforce can pretty much just drive through on a geometrically optimal line, but a car without downforce has to make allowance for the fact that there's a significant crest at the end of 3.

It's not pure geometry, and while you could almost certainly write an algorithm to calculate the fastest line around the track, it would need to take the car and the rest of the track into account to calculate the optimal line for any given corner.

If you read further on in your own link you'll find that it says much the same thing in parts 17 and 18.
 
How is the line different for differing mass? It's a pure geometric problem (my favourite). See here.

Well when I am think about the racing line I am also thinking about the brake points not just the path geometry.

The groove implicitly stores radius of curvature, which implies acceleration if speed is known, so by cross referencing tyre grip (available acceleration), the "AI" knows exactly how fast it can go at every point on the track, regardless. Then you add deviations (e.g. decision trees, binary or otherwise) and corrections to that to give the impression of intelligence.

The algorithm you described is not difficult to understand. What I am asking for is some independent confirmation of this statement from you.

False. Almost all (semi-)sim AI is groove based. Any "behaviours" you see are programmed deviations from that line. Please describe this "wide range of methods".

As a Software Engineer, I have a professional interest in this and would like to see a formal description of this algorithm. So unless you invented the "Groove" algorithm in your head I would like to see a reference to it and it's prevalent use in almost all racing games. That's not unreasonable is it?

As for spotting the exact same behavior after a restart, never heard of a random number generator?

Of course I have. You should be asking the developers who have used this method. I have seen the described behaviour implemented by both Codemasters and PD. Codemasters used it in Grid 1 and can't remember which version of GT had it (I think GT5 and maybe earlier versions. I am old now & my memory is weak)

[edit]
I wasn't imagining it here's a review which describes exactly the pre-scripted behaviour I mentioned. http://www.hardwarebbq.com/gran-turismo-6-for-ps3-review/

The AI could have been better, much better. It feels as if the race is scripted, absolutely no challenges from AI while overtaking, follow a strict route. There has to be some difference, at least when you restart. What I came across is that the AI follows exact same pattern, when I restarted, I expected some change.

Don't think you can avoid describing this wide range of methods

Here's a single (peer reviewed) paper from The International Journal of Machine Learning and Computing, Vol. 2, No. 1, February 2012

The most common artificial intelligence in a racing game is waypoint navigation by carefully placing waypoints (nodes) in the game environment to move the game-controlled characters between each point. This is a very time consuming and CPU intensive problem. Using the A* algorithm can effectively solve the pathfinding problem in a static racing game environment; therefore, we present two modified A* algorithm instead of putting waypoints by hand and minimum the lap time. Finally, we propose a more general dynamic algorithm which can solve the random obstacles avoidance problem in a racing game. All the three algorithms are able to find the path for a car racing game and can save the most import resource in game, CPU cycles

As you can see the papers conclusion appears to directly contradict your assertion that almost all racing games use the "Groove" algorithm. In addition since it describes two separate existing algorithms and proposes a third I think it adequately supports my statement that there are more than one single (so far unreferenced) algorithm for driving AI.

Mr. Have-a-nice-day.

How very mature.
 
Last edited:
IMO Grid Autosport AI was good enough for me and more than a match for GT. Copy and paste it into GT7, tone down the aggressiveness and 99% of GT fans would be in heaven. They fought with each other for position, they ran different race lines, two wide was no problem around corners. People run into issues with them IMO because they try to drive like they do in GT, smash and crash their way to the front and they made the AI far more aggressive than they would normally be if you just drove like a real race driver. On the other hand I treated it like a real race and didn't rub and push my way to the front and had a fantastic experience while doing so.

Not sure if everyone here is aware, but Codies had a GTP Forum Ambassador of sorts, @anim8r_uk, and he was giving us guidance and asking questions even before the game was launched. I played the game based on his advice and it was a great experience, mostly offline.

👍 I'll add, even the randomness of AI spinning during practice, makes the experience feel more real.
The AI will do an undercut, will keep accelerating when you're coming out of corners and bump drafting, will try to pick up your draft, will try to outbrake and outbrake itself, will force you to yield, will pull a Plato and T-bone you, will yield at corners and put "pressure" on you, will pull away from you if you don't hit your apexes. I dont know the zeros and ones of how to make better AI, but Codemasters pretty much made it perfect for me.
 
It's not quite a pure geometric problem.

Finding the shortest line around the track is pure geometry. Finding the fastest line around the track means that you have to take the sequence of corners and straights into account, as well as the car to some degree.

If there's a big straight after the corner you may be best taking a late apex to maximise your speed down the straight. If there are a series of corners then you may need to take a sub-optimal line through one or more of them to optimise your speed through all of them.
If your car has great traction, like a 911 or something, you may be more biased towards late apexes to take advantage of that.
Downforce modifies it even further, my favourite example being corners 3 and 4 at Watkins Glen. A car with significant downforce can pretty much just drive through on a geometrically optimal line, but a car without downforce has to make allowance for the fact that there's a significant crest at the end of 3.

It's not pure geometry, and while you could almost certainly write an algorithm to calculate the fastest line around the track, it would need to take the car and the rest of the track into account to calculate the optimal line for any given corner.

If you read further on in your own link you'll find that it says much the same thing in parts 17 and 18.
Geometry exists in 3D, too; that link was a simplification for illustration, in the accompanying text, it was mentioned that compound corners (and indeed whole circuits) can be analysed. In that case, you're looking to maximise the radius of curvature (in 3D, warped to account for gravity).

I'm not sure there's an explicit form for that, but it can certainly be done computationally. Besides, that's why a groove is supplied by a human driven lap - it's just a shape. Remember, speed is irrelevant; downforce just increases the speed you can take all radiuses at, the same as a stickier compound will. Unless you're suggesting that an AI be given car-specific racing lines, or can "decide" to dodge said crest, which I'd love to see evidence of.
Well when I am think about the racing line I am also thinking about the brake points not just the path geometry.



The algorithm you described is not difficult to understand. What I am asking for is some independent confirmation of this statement from you.



As a Software Engineer, I have a professional interest in this and would like to see a formal description of this algorithm. So unless you invented the "Groove" algorithm in your head I would like to see a reference to it and it's prevalent use in almost all racing games. That's not unreasonable is it?



Of course I have. You should be asking the developers who have used this method. I have seen the described behaviour implemented by both Codemasters and PD. Codemasters used it in Grid 1 and can't remember which version of GT had it (I think GT5 and maybe earlier versions. I am old now & my memory is weak)

[edit]
I wasn't imagining it here's a review which describes exactly the pre-scripted behaviour I mentioned. http://www.hardwarebbq.com/gran-turismo-6-for-ps3-review/





Here's a single (peer reviewed) paper from The International Journal of Machine Learning and Computing, Vol. 2, No. 1, February 2012



As you can see the papers conclusion appears to directly contradict your assertion that almost all racing games use the "Groove" algorithm. In addition since it describes two separate existing algorithms and proposes a third I think it adequately supports my statement that there are more than one single (so far unreferenced) algorithm for driving AI.



How very mature.
Which games use A* for race AI? And how is the resulting node graph utilised by a physics abiding AI? I.e. not unlike waypoints, I imagine. That seems to have been motivated by a content issue, which they clearly didn't realise could be fixed by a skilled driver providing a lap or three

Forza 5 does not really use machine learning, it takes players' laps and, via distributed computing, turns them into an equivalent AI groove and tuning (which is a clever system in itself), which may involve a "machine learning" like step (much as any preprocessor might), but it's not actually a part of the game.

The groove itself is typically stored as a series of points, which would be treated as target waypoints, with plenty of look ahead. You can use multiple groove files per track. GPL had two: racing line and overtaking line; you still regularly saw cars three and four abreast because of how the "waypoint" navigation was coded, allowing deviations. I helped work on a similar system for grouping in crowd dynamics (not a software engineer), a final development of which was peer-reviewed. It was a total cheat :P

Braking points are a geometric concern, it's not difficult. You know what your deceleration rate can be, so you know explicitly when you need to start braking in order to meet the speed for an upcoming change in track curvature. Same for acceleration. You add additional controls in respect of vehicle balance (over- / understeer), add fudge factors to the predictors etc. Add a way of decreasing or increasing radius of curvature if off-line (wide or tight) and so on. It's not difficult. You can get quite sophisticated looking AI out of it, but fundamentally, it's cheating.

I want to make one thing clear: this isn't a GT vs. everything else argument. I'm talking about a potential paradigm shift in AI approach in general. If you're down with that, good, otherwise, have a nice day.
 
Last edited:
Geometry exists in 3D, too; that link was a simplification for illustration, in the accompanying text, it was mentioned that compound corners (and indeed whole circuits) can be analysed. In that case, you're looking to maximise the radius of curvature (in 3D, warped to account for gravity).

Take a simple oval with arbitrarily long straights and hairpins at both ends. Generally, you'll be faster around a lap with a slow in/fast out approach to the hairpins than you will following a line that is (Edit: removed - the geometric shortest distance) the largest radius of curvature around the track (unless your car is very low on power), because the time you lose following a longer line through the corner is more than made up for by spending more time on the throttle. Your link explained this very concept in part 17 and 18.

Do you disagree? Is this not the optimal line for such a simple course?

Then how can you claim that the optimum line is the one with the maximum radius of curvature, when this simple example demonstrates that there's at least one case for which that is not true?

This concept of balancing speed through the corners and exit speed onto the straights is key to a fast lap time at all tracks. You'll get a decent racing line by simply drawing the shortest line through the track, but it won't be optimal in all cases.

Remember, speed is irrelevant

Why is speed irrelevant? If you have a short path that can only be traversed at low speed and a longer path that can be traversed at a higher speed, how does one decide between them?

You know how F1 cars sometimes go around the outside of corners in the rain? Why do they do that?

downforce just increases the speed you can take all radiuses at, the same as a stickier compound will.

The difference being a crest, as I pointed out in my example. Downforce will let you take a cresting corner faster, a stickier compound is no use if it's not touching the ground.

Downforce and sticky rubber are similar in many situations, but they are not identical.

Unless you're suggesting that an AI be given car-specific racing lines, or can "decide" to dodge said crest, which I'd love to see evidence of.

I'm not suggesting anything. I'm telling you that the optimal racing line is not as simplistic a construct as you're making it out to be, and does depend to some extent on the car and what it's capable of.
 
Last edited:
Take a simple oval with arbitrarily long straights and hairpins at both ends. Generally, you'll be faster around a lap with a slow in/fast out approach to the hairpins than you will following a line that is the geometric shortest distance around the track (unless your car is very low on power), because the time you lose following a non-optimal line through the corner is more than made up for by spending more time on the throttle. Your link explained this very concept in part 17 and 18.

Do you disagree? Is this not the optimal line for such a simple course?

Then how can you claim that the optimum line is the one with the maximum radius of curvature, when this simple example demonstrates that there's at least one case for which that is not true?

This concept of balancing speed through the corners and exit speed onto the straights is key to a fast lap time at all tracks. You'll get a decent racing line by simply drawing the shortest line through the track, but it won't be optimal in all cases.



Why is speed irrelevant? If you have a short path that can only be traversed at low speed and a longer path that can be traversed at a higher speed, how does one decide between them?

You know how F1 cars sometimes go around the outside of corners in the rain? Why do they do that?



The difference being a crest, as I pointed out in my example. Downforce will let you take a cresting corner faster, a stickier compound is no use if it's not touching the ground.

Dowwnforce and sticky rubber are similar in many situations, but they are not identical.



I'm not suggesting anything. I'm telling you that the optimal racing line is not as simplistic a construct as you're making it out to be, and does depend to some extent on the car and what it's capable of.
Whoah, back up. Geometric shortest? No. Read the link.

EDIT: the line with the largest radius of curvature is out-in-out. The line with the largest radius of curvature has the highest average speed.
 
Last edited:
Whoah, back up. Geometric shortest? No. Read the link.

EDIT: the line with the largest radius of curvature is out-in-out. The line with the largest radius of curvature has the highest average speed.

OK, geometrically shortest was not what I meant there. Substitute for largest radius of curvature and continue.

The line with the largest radius of curvature may have the highest average speed through any given corner, but a course is made up of corners and straights. Taking the highest average speed through the corners on a course does not make an optimal line if you're losing time on the straights. I will gladly every time sacrifice overall cornering speed in order to get a good exit speed onto a long straight.

Address the questions I raised please, if you can. I remain unconvinced that a largest radius of curvature line through a course is the fastest. If it's not, then you need some other geometric property to be able to maximise or minimise for this to be a geometric problem.
 
OK, geometrically shortest was not what I meant there. Substitute for largest radius of curvature and continue.

The line with the largest radius of curvature may have the highest average speed through any given corner, but a course is made up of corners and straights. Taking the highest average speed through the corners on a course does not make an optimal line if you're losing time on the straights. I will gladly every time sacrifice overall cornering speed in order to get a good exit speed onto a long straight.

Address the questions I raised please, if you can. I remain unconvinced that a largest radius of curvature line through a course is the fastest. If it's not, then you need some other geometric property to be able to maximise or minimise for this to be a geometric problem.
I'm confused as to what you seem to be contending.

It is a simplification for clarity, parts 17 and 18 use a geometric basis and some simple calculus to refine the model to include straights for the 2D case. Non zero lift and z-axis inertia can be accounted for in that calculus, but you lose clarity (and really, any physics undergrad should be capable of the full derivation).

My point was always that radius of curvature implies a speed given a centripetal acceleration. That centripetal acceleration represents the car's cornering ability.

Thus, if you know radius of curvature, you know speed, if you know how much "grip" you have. That latter tends to be stored in look up tables. So it is a matter of geometry.

How do you obtain radius of curvature info for a track? What about a "racing line" trace from a recorded lap?

The issue is how to get an AI to "navigate" a track, remember.
 
I'm confused as to what you seem to be contending.

It is a simplification for clarity, parts 17 and 18 use a geometric basis and some simple calculus to refine the model to include straights for the 2D case. Non zero lift and z-axis inertia can be accounted for in that calculus, but you lose clarity (and really, any physics undergrad should be capable of the full derivation).

My point was always that radius of curvature implies a speed given a centripetal acceleration. That centripetal acceleration represents the car's cornering ability.

Thus, if you know radius of curvature, you know speed, if you know how much "grip" you have. That latter tends to be stored in look up tables. So it is a matter of geometry.

Except that it's not pure geometry, as you stated.

Parts 17 and 18 show that the line with the maximum curvature of radius is not the fastest line.

Lift and inertia are not geometry. That's then referencing information about the car, and is no longer a pure geometry problem.

What about a "racing line" trace from a recorded lap?

That's not geometry.

The issue is how to get an AI to "navigate" a track, remember.

And you claimed that the racing line is a purely geometric problem. I'm saying it's not, not if you want an optimal line.

If you want a line that's just good enough, then sure, maybe. But the AI will probably have issues keeping up with players who know how to drive, and you'll get a bunch of corners where the AI will be on fairly unconventional lines which spoils the racing flow somewhat.
 
Except that it's not pure geometry, as you stated.

Parts 17 and 18 show that the line with the maximum curvature of radius is not the fastest line.

Lift and inertia are not geometry. That's then referencing information about the car, and is no longer a pure geometry problem.



That's not geometry.



And you claimed that the racing line is a purely geometric problem. I'm saying it's not, not if you want an optimal line.

If you want a line that's just good enough, then sure, maybe. But the AI will probably have issues keeping up with players who know how to drive, and you'll get a bunch of corners where the AI will be on fairly unconventional lines which spoils the racing flow somewhat.
Well, by that definition, even the simplified approach isn't "pure geometry", because it relies on geforce values, which are car dependent.

It's obvious, the track is a geometric constraint.

If you want so desperately to be right, fine.
Except the racing line is geometry, as used for AI grooves - that's how it's stored.

Let's get back to the AI.
 
Has anyone simply asked how the game designers program their AI?
 
Last edited:
If you want so desperately to be right, fine.
Except the racing line is geometry, as used for AI grooves - that's how it's stored.

If you don't understand why more than geometry is required to compute an ideal racing line, I don't see how your contributions to AI racing line theory should be taken seriously.

The racing line itself is stored as geometry, but that's not the point. Calculating it is not a simple geometric exercise, it's more involved.

Common current practise is to precalculate an ideal line and then have the AI work from that, although there are other methods as @mr_serious linked to. But presumably the ideal is for the AI to be actively computing it's own ideal line based on it's surroundings, it's goal, existing obstacles and current capabilities of the vehicle, like some sort of hybrid of the Google autonomous vehicles and the BMW driverless racer. For that, the difficulty of calculating a line is relevant.
 
👍 I'll add, even the randomness of AI spinning during practice, makes the experience feel more real.
The AI will do an undercut, will keep accelerating when you're coming out of corners and bump drafting, will try to pick up your draft, will try to outbrake and outbrake itself, will force you to yield, will pull a Plato and T-bone you, will yield at corners and put "pressure" on you, will pull away from you if you don't hit your apexes. I dont know the zeros and ones of how to make better AI, but Codemasters pretty much made it perfect for me.

I agree with this. I also like when I'm right behind an AI car coming up to a corner and they take the inside line to force me outside. Never seen that in other racing games that I've played.

IMO Grid Autosport AI was good enough for me and more than a match for GT. Copy and paste it into GT7, tone down the aggressiveness and 99% of GT fans would be in heaven.

👍
 
Each circuit in GT should have three driving lines; one for the outside when player is on the inside, one for the inside when player is on the outside and the fastest line which AI takes when nobody is in vicinity (the one that is recommended in real-life racing).

Also, it is mandatory for AI to push their cars to the maximum limit possible.

Finally, no circuits should have soft spots for players to take advantage of them over AI. The big hill section on El Capitan (GT4) comes to mind.

These three adjustments would make competitive AI.
 
www.generation5.org/content/2001/hannan.asp

Interesting read about the AI in Colin McRae Rally 2 (not DiRT).

The more pertinent aspects:

"Controlling a rally car on mud and gravel is a lot more complex than controlling a car on a tarmac circuit. On tarmac its mainly a case of pointing the car in the right direction, and maintaining the right speed. On slidy surfaces, the car has to turn into corners early, and slide round. I tried to create a set of rules to control the car, but was unsuccessful.
I thought that neural networks would help me find a quick solution, by modelling the way I drove the car."

"Obviously the biggest challenge was actually getting a car to successfully drive round the track in a quick time. Once that was achieved, I was then able to adjust racing lines almost at will, to add a bit of character to the drivers. The neural net was able to drive the new lines, without any new training.

The neural nets are constructed with the simple aim of keeping the car to the racing line. They are effectively performing that skill. I felt that higher level functions like overtaking or recovering from crashes should be separated from this core activity. In fact, I was able to work out fairly simple rules to perform these tasks."

"However, even my best models were doing laps a few seconds slower than what I can achieve."

"I'm wary about creating a massive neural net that takes dozens of inputs in the hope of capturing all the information about a problem."

"With my experience of using neural nets, I'd say that they are particularly good at skills. When a human performs a skill, it is an automatic movement that doesn't require high-level reasoning."

"One area I'm not convinced about is AI that learns during the game, particularly for improving performance."

"If you want the AI to gradually improve in response to the players improvement, then just replace it with an already prepared better AI opponent, or have some scaled degradation of performance."

The AI was only available in Arcade:
 
Last edited:
Has anyone simply asked how the dame designers program their AI?
If that's not a typo, you're looking for the Lifelike Human Robots thread.

If it is a typo, you're looking for the third word in the title of this thread.
 
Yeah, just describes the high level routines, but not how they're implemented, or trickle down to affect the lower levels. Which is entirely to be expected.
 
Yeah, just describes the high level routines, but not how they're implemented, or trickle down to affect the lower levels. Which is entirely to be expected.

I feel they(PD) are not doing anything at all in regards to posting benchmark lap times. I thought for a long time, GT should have had real world lap times(even real world lap records) at the real circuits. AI would match those lap times and it's up to players to try to beat the AI during races. CM actually do it!
It seems or maybe IT IS this, that PD aren't taking time to do(from the side bar in that link). http://www.pcgamesn.com/how-codemasters-teach-ai-drive
Next they need lap times. Lots of them,

“We have dedicated guys on the team who do nothing but set the benchmark times for the AI,” James says. “If you think about it, we’re pushing 80... 85 cars in this game and we’ve got over 100 routes. That’s a hell of a lot of combinations of car and track that they have to go through to make sure we have benchmark times for the AI to go against.

“When the level design guys build their tracks they lay down the information the AI need to drive, they lay down the lines the cars will actually need to follow, which are quite organic in their nature. They lay down the braking zones for each corner. They tune things like track extents, so the map of the track that the AI could ever possibly use, so, now, if there’s a collision up front the AI can go around that collision, maybe go on the grass for a bit and then rejoin.”

Between the benchmarks, the track data, and the handling model, the AI now has enough raw elements to start learning.

“We have a bespoke tool that we use that we’ve built and modified over many years that actually trains the AI,” explains James. “The AI system then runs with all that raw data, so the AI runs lap after lap after lap at an accelerated super test, normally overnight using many different tracks and cars. It’s driving, it’s making mistakes, it’s correcting them, it’s training them up, it’s improving them gradually.

“That’s how we end up at the trained AI data that you see in the game.”

Still, the work’s not done. They’ve now got cars that will drive round each track pumping out consistent lap times. They’ll know where and when to brake, overtake, and go flat out, but they’ll be doing it pretty mindlessly. They’ll “go round the track fast but it won’t be doing anything especially interesting other than the base AI behaviours.”

To make things a little more interesting “we lay on top of that a set of information from each driver in the game,” says James. “Each driver has their own characteristics. How consistent they are, how aggressive they can be. Details like that mean you’ll see cars make mistakes, either through a lapse in competence or because they’re responding to a nudge they received on the last corner.”

“We also tune behaviours on a discipline basis,” James says, referring to the five different driving disciplines in Grid: Autosport - Touring Cars, Endurance, Open Wheel, Street Racing, and Tuner Competitions. “This is where you start to see unique behaviours such as... well, the extreme examples would be how to drift a car, but also things like in Touring Cars guys will protect the inside line and jostle for position on the track, whereas the opposite would be true in Open Wheel where they’ll try to avoid contact. Then in Street Racing they’ll give you a shove at the right point on the street.”

It means the team don’t need to resort to introducing any sort of rubber banding. If you fall behind during a race then you don’t need to worry about being out of the running: “if there’s a pack of cars they will be bleeding time off each other because they’re fighting for track position. There’s other variables in there like AI making mistakes, either minor ones or proper off-track incidents. There’s always ways to fall back in.

“If we did anything like the AI always slowed to a crawl when you were falling back it would shatter that illusion, we didn’t want to go that way for this game.

“It’s only by doing all that that we can get a very human-like AI. You can get cars to follow splines very easily by comparison but that’s how you get that robotic inhuman AI behaviour. Whereas we’ve taken it to a whole new level in Autosport.
 
Yeah, GT might use hand made racing lines on the fixed circuits, but they certainly don't with the coursemaker tracks. The base AI driving skill needs an overhaul so that they are basically quicker; watch the racing line "aid", e.g. as you brake early, see how the game recalculates the braking point further down the track - that must surely be borrowed from the AI code. Fix that, then they can be procedurally dumbed down to meet a given difficulty level.

That's why BSpec has been an interesting diversion, because it's allowed PD to work on all of that high level tactics stuff. If they can bridge that with a higher level strategy layer, you'll have an AI that decides when to push and when to hold back, rather than being told. Quite interested to see what the GT6 outing brings.

Remembering that GT's AI can already drive on dirt (sort of) and happily hold a drift, I'd say the fundamentals are there for a decent opposition. They just need a better way of reading the "racing line". Add in difficulty options and a strategy of winning (rather than letting you pass) and we're golden.

I'd still rather they didn't cheat, i.e. by being given a racing line to follow. I want an AI that, like us, figures it out as it goes along - that way a lot of the artificial "make mistake now" stuff would be unnecessary. That may just be a dream for now.
 
Back