AI - Artificial intelligence - But why isn't it?

  • Thread starter Thread starter Flagmo-T
  • 73 comments
  • 9,515 views
The best "Artificial Intelligence" I've come across in a game so far has to be the one I experienced sometimes playing Prologue online.
They do seem to be "aware" you're on the track and often even try to make "contact" but still have their own "unique" way of driving.
There are some aspects which make it a bit unrealistic and not how a real human being would actually race, like suddenly driving the opposite direction for no apparant reason or retire into the pitlane ( or even in the middle of the track ) after only 2 laps which somehow suggests being damaged when this element isn't even present in Prologue.
Strangely enough they even are capable of writing messages, although the language often being used proves the technology used still has a long way to go.
 
After all, you would only have to do this on every track/variation with every individual car for this to work properly. 1000*70=70,000 ghost laps that you would have to do (And they all have to be clean).

Fun.


Of course the best thing would be an AUTO MODE that monitors your average times in the background and adapts the AI to your average. Within this Hard mode goes slightly faster, medium about the same and easy mode below your average laptimes. To me thats what AI should do in a racing game rather than run to a scripted set speed but actually monitor the players average.

Going back to downloading other peoples times....

It would be great if it could be done in a way to have a feature that detects your best or average time over (eg 5 laps) This way you only have to complete a 5 lap test session for each track to get an average but the game also memorises your best time.

Then what if the game compares your time and highlights the closest 15 real peoples own TT times to yours for whatever track your currently are doing a TT on. At this point give players "download the 15 cars closest to mine" with a single click feature. Ideally a person could override the auto selection and manually choose cars that are faster or much slower still.

Even if this feature wasnt available to convert ghost cars into AI it still would be nice to have such a feature and in TT mode which allowed several online timed ghost cars to be raced with at once. What if we could do a TT with 15 other ghost cars, they may not have AI and just be ghosts but such a feature could be interesting to play particulary with different cars and tunes and cars being slower/faster on various parts of the track.

Mind you some people find ghost cars annoying to race against, so Sony while your at it give us the option to change their colour or transparancy. FM3 kinda allowed multiple ghost cars, was it a max of 4 ghosts and that wasnt too annoying. For me I had more challenge racing peoples ghosts than the games AI.
 
Recreating realistic AI is probably one of the hardest and most resource demanding processes. Me and a friend made a top down racer as a final project in college (2 years ago), with the emphasis on AI.

An AI-controlled car started the race with only some definitions: accelerating would move him forward, braking would decrease speed, turning would make him change direction and he would have to pass some checkpoints in a certain order.
Basically he had to learn what amount of throttle gave him what speed, how hard he needed to brake, ....
We combined this with an adapted version of A* (a pathfinding algorithm), dynamicly assigning the 'cost' of going somewhere. Pretty soon he learns asphalt is easier to drive on than grass or gravel, and we can see how the line he tries to follow is adjusting to a raceline-resembling shape.
First few (20 or so) laps the AI car is mainly overspeeding, turning in wrong directions, trying to drive on gravell and so on, but slowly he gets on speed and after a lap or fifty he turns laptimes that are only 6 seconds slower (on a ~1:20 lap) than i was able to do.

Then you need to add other AI controlled cars (or a player controlled car, it doesn't really matter). AI now learns that it is 'bad' to crash into other cars. So we make algorithms to predict where cars will be to avoid going to the same place and crashing. But trying to find out whether it would be profitable to try and pass a racing car, while going offline and not losing too much time when it would fail... very hard thing to do. In the end the cars did a reasonable job at avoiding each other, while still going for fast laps.

Some nice things that you can do then is making it rain, so the grip and such are affected. If the rain makes the track 'wet' gradually, you could really see drivers noticing grip going down, and addressing their speeds in order not to slide of the track.

We had a very lightweight physics and graphics layer, but still we needed to optimize the hell out of it - causing the overall awareness and learning speed to take a big dip - to get it done in realtime.


Sooooo.... long story short
: I believe it will take some time before we will see AI drivers on a level that they will behave like 'real' humans :)
But it will happen, someday...
 
I don't remember Shift's AI being anything special. Maybe that's the point - and the Wii version is fresher in my mind than the PC version (I know, I know). I could try the PC demo again (I HATE the way it nannies you though - and shut that faux-Scot up, too; it's not TOCA Race Driver...)

Well, I can say now that Shift's AI isn't anything special to race against. Sure, they do a lot of wobbling about like they're some sort of racing n00bz but they're just path followers - no better than those in GPL. You can park on the line (accidentally, of course) and they'll just form a train of conjoined idiots. And he wasn't a faux-Soct, he was a faux-Englishman. Still uncanny to the hilt (as I take my own life to save myself from the pain of cringing so hard.)

Incidentally, it's a terrible game to play on the keyboard - tried eight or nine different sensitivity ideas, nothing worked because the steering is frustratingly inconsistent. Needless to say, I bounced off the AI cars (and the barriers) a lot, just because I couldn't adjust my line properly. I'm sure it's fun with a pad, though. Oh and I hate the sound. I kept feeling I needed to adjust a gain setting somewhere, all that clipping :yuck: and disembodied collision sounds :dunce:


Bah. It's not looking good for AI in general, is it?

I'd like the option to set the AI difficulty either relatively (so, adaptively to my own skill on a race-by race basis - i.e. no dumbing down / steroiding up during the race.), or absolutely according to a predefined difficulty (much like licence tests are).

What I mean is, the early championships and cups (e.g. Sunday cup) should be populated with mainly pussy-footing weekend warriors, whilst the GT World Championship would be full of bad-ass pros. Just so I can challenge myself, and then end up switching back to adaptive... Of course, even the adaptive opponents should get gradually better throughout the game. Just their raw speed should be graded relative to yours.

@ Qronicle I don't know a lot about these kinds of learning algorithms, but presumably there's some sort of parallelism involved? Data parallelism (i.e. multiple AI opponents), I think, lends itself well to all this newfangled "using-a-graphics-card-to-solve-****" practice I'm seeing (extends to the Cell's SPUs, of course.) I'm curious as to what hardware you were using, number of AI etc. and could a big chunk of pre-computation help real-time costs? (i.e. most opponents will have already learned, prior to the race, the majority of their racecraft, and awareness: "when rain, road get wet, wet make slip")
By which I mean, cheat. Fudge the adaptive part (esp. with respect to the player) in realtime, but give them true "learned" traits via a proper learning / adaptive method beforehand, and update this "database" after every race with the fudged experience (i.e. with the player, course, weather, car / car type etc. to bring some sort of expectation / confidence aspect?) Does the AI (characters) take part in races other than with the player? Should they get experience from these, too? Complicated stuff...


@ analog :lol:
 
Speaking of AI... I want an AI system that when you abjust the AI difficulty the AI steps up its game and drives better and faster not what we had in Prologue where you set the Difficulty too high (say 7 to 10 clicks more). It puts you into a whole new car class where you cant even be competetive.

I hope they did not stick with that standard of AI difficulty for GT5.
If I remember correctly they had the same thing in GT4.
 
I don't know a lot about these kinds of learning algorithms, but presumably there's some sort of parallelism involved? Data parallelism (i.e. multiple AI opponents), I think, lends itself well to all this newfangled "using-a-graphics-card-to-solve-****" practice I'm seeing (extends to the Cell's SPUs, of course.) I'm curious as to what hardware you were using, number of AI etc. and could a big chunk of pre-computation help real-time costs? (i.e. most opponents will have already learned, prior to the race, the majority of their racecraft, and awareness: "when rain, road get wet, wet make slip")
By which I mean, cheat. Fudge the adaptive part (esp. with respect to the player) in realtime, but give them true "learned" traits via a proper learning / adaptive method beforehand, and update this "database" after every race with the fudged experience (i.e. with the player, course, weather, car / car type etc. to bring some sort of expectation / confidence aspect?) Does the AI (characters) take part in races other than with the player? Should they get experience from these, too? Complicated stuff...

We would have eventually done the beforehand training of AI, but time ran out and we didn't really get back to it after it was graded :)

Still, you cannot pre-calculate every situation possible. But like in an F1 game you could indeed clearly create a basic 'knowledge' for every track in dry/wet conditions, and then make realtime adjustments as grip is improved throughout the weekend, wind directions change, extremely heavy rain, ....

Ideally every driver would then 'save' it's knowledge after the race, trackspecific and general racing abilities, and remember what drivers gave him a hard time etc.

We tested the application on different pc's, but the best one had a CPU (which had the hardest time obviously) of 3GHz, so nothing special :p. Theoretically we could run as many AI controlled cars as we wanted, but they each took time out of eachothers learning cycle, so not much point in that. We mostly tested with 4-8 cars.

Aaah, talking about this always makes me want to pick the project up again :indiff:
 
Last edited:
Of course the best thing would be an AUTO MODE that monitors your average times in the background and adapts the AI to your average. Within this Hard mode goes slightly faster, medium about the same and easy mode below your average laptimes. To me thats what AI should do in a racing game rather than run to a scripted set speed but actually monitor the players average.

You are aware that you are describing the rubberband effect? Which is EXACTLY what we (or at least I) do NOT want...
 
You are aware that you are describing the rubberband effect? Which is EXACTLY what we (or at least I) do NOT want...

I don't think thats what he means. Parameters would be set to the AI before the race reflecting your averaged ghost times, not during it. Rubber banding would be if the AI were to gain an advantage during the course of a race, which you are right about, nobody wants that.
 
You are aware that you are describing the rubberband effect? Which is EXACTLY what we (or at least I) do NOT want...

Edit: Just saw the above post now, sorry
Not necessarily.. Faster times that they have to do means that the AI would have to take alot more risks, and try a lot harder for the time. That way they just want 1st place as much as you do, but more importantly, they would want to execute their time perfectly (Whether thats slower or faster than you)- Without cheating of course, or enhancing specs (Rubber banding), because as far as I know, Prologue didn't really have rubber banding at all (Or atleast such little of it that I couldn't even notice.. harmless). I believed quite the opposite, when I was first place by 10 seconds, I was gone.. There would be no way they could get up to me. MY major complaint was how the cars went slower than they were capable. I can remember passing many cars on straights (When I had less power), It seems like they have fixed speeds (Not to mention staying on the line), and drive too conservatively through the corners. One way you can really test this is getting well into first, and at the end seeing how only a few (1-3) cars switched positions with each other (Due to the speed they're at, and their driving style, the cars can't overtake at all)

However, one major flaw to having fixed times for the AI could be that if it were a 2 lap race, one could go slow during the first lap, and when that lap is finished, the AI will adapt to that time, meaning you could go faster on the next lap without any challenge. Not to mention how awkward it will look with the cars going 30 miles an hour :D

Plus, After seeing the le mans demo (A month ago) with AI being very aggresive, and some not sticking to the line, and the Top gear test track videos (Where the guy got spun out 2/3 times because of the AI) I Wouldn't be worried about AI being the same as GT4 or GT5.Prologue..
 
Well, I can say now that Shift's AI isn't anything special to race against. Sure, they do a lot of wobbling about like they're some sort of racing n00bz but they're just path followers - no better than those in GPL. You can park on the line (accidentally, of course) and they'll just form a train of conjoined idiots. And he wasn't a faux-Soct, he was a faux-Englishman. Still uncanny to the hilt (as I take my own life to save myself from the pain of cringing so hard.)

At heart it's the same AIW track navigation system and AI personality definition as seen in GTR2, but with fewer waypoints defined on the AIW, much more emphasis on situational and personality driven behaviours than line-riding, and a higher definition "brain" including a few things to do with interacting with the player directly ("grudge"/"rival" and "antagonist" ratings that are feed from collisions with that driver specifically and the player's general profile).

I don't know if you could read much into the state of AI generally from your test than you could deplore the state of army Kill-bots by loading up Street Fighter 4 on PC, plugging in your trackball, hiding in the left corner of the screen and timing how long it took for it to take your health bar :)
 
The best "Artificial Intelligence" I've come across in a game so far has to be the one I experienced sometimes playing Prologue online.
They do seem to be "aware" you're on the track and often even try to make "contact" but still have their own "unique" way of driving.
There are some aspects which make it a bit unrealistic and not how a real human being would actually race, like suddenly driving the opposite direction for no apparant reason or retire into the pitlane ( or even in the middle of the track ) after only 2 laps which somehow suggests being damaged when this element isn't even present in Prologue.
Strangely enough they even are capable of writing messages, although the language often being used proves the technology used still has a long way to go.

Yes, I agree. Some "AI" have actually developed the technique of abandoning the race completely when some hardship arises. And "Some" have even determined that the race should be cancelled entirely whenever they find themselves out classed.

Smart fellas.....
 
At heart it's the same AIW track navigation system and AI personality definition as seen in GTR2, but with fewer waypoints defined on the AIW, much more emphasis on situational and personality driven behaviours than line-riding, and a higher definition "brain" including a few things to do with interacting with the player directly ("grudge"/"rival" and "antagonist" ratings that are feed from collisions with that driver specifically and the player's general profile).

I don't know if you could read much into the state of AI generally from your test than you could deplore the state of army Kill-bots by loading up Street Fighter 4 on PC, plugging in your trackball, hiding in the left corner of the screen and timing how long it took for it to take your health bar :)

Ah, well GTR2's AI isn't great either! :sly:
I don't suppose what kinds of "higher behaviour" one applies to these "characters" really changes the fundamental, underlying mechanic - i.e. how the AI interprets the world around it, and how it conveys itself around said world (contrast AIW-type with LFS, for example). Technically, we're all just line-riders when we hotlap, etc. The only difference in a race is that the line is subject to change, for a wide variety of reasons - awareness counts more than character, in my view - "false" character can come about from different awareness, caused by a different environment.
I've seen an LFS AI adjust his line from lap to lap, trying to keep up with me. It's then fun to bring in an AI who's never driven the circuit before and see him duke it out with those who have experience racing against me, and are a bit "bolshy". They're still idiots, though. :dopey:

(actually, the Grunts in Half-life were my first taste of seemingly reactive and adaptive AI, clunky and primitive though the "brain" actually was, the effects were convincing - that's what counts.)

When I said "in general", I really meant for this "generation" of games, since GT5 is coming on current hardware, with its current limitations (actually, GT5 is probably mostly time limited..?) So I won't be expecting leaps and bounds, to the effect of the kinds of system Qronicle has explained - i.e. true real-time learning AI.

I'm aware the gaming industry is not a great place for actual cutting-edge technology - there's too much money to be made re-applying a known-good formula (much like the chemical-commodities / petroleum industry, I suppose).
 
When has it ever been intelligent? It'll probably be the same line following computerized fools we have seen already.
GT - Computed to follow the line
NFS - Computed to cheat
MotorStorm - Computed to be complete @$$holes (hehe he's riding a bike, I have the truck)
MC - See NFS
GRID - Computed to - wait did all the AIs just kill themselves in the derby? (that happened to me twice)
DiRT - See MotorStorm
 
I actually think the AI in DiRT2 is pretty good. They are fast and aggressive enough without trying to kill you the whole time. Thats been my experience anyway. :)
 
1 thing I don't like about all these game AI is the throttle/brake pumping in corners. I see this in GTR Evo, and I think in Prologue as well.
instead of smoothly applying the right amount of thottle needed, it's like they pump the accelerator on/off!

You can hear that throttle pumping here with the Art Morrison Corvette at 0:30. Other than that you can see the AI is way better than GT4, and Gt5 will be improved over this as well. I just just hope they can drive fast enough to beat me with the same car and same tune.


I do like how in GTR Evo the AI will sometimes flash their lights at you :)
 
Last edited:
Ah, well GTR2's AI isn't great either! :sly:
I don't suppose what kinds of "higher behaviour" one applies to these "characters" really changes the fundamental, underlying mechanic - i.e. how the AI interprets the world around it, and how it conveys itself around said world (contrast AIW-type with LFS, for example). Technically, we're all just line-riders when we hotlap, etc. The only difference in a race is that the line is subject to change, for a wide variety of reasons - awareness counts more than character, in my view - "false" character can come about from different awareness, caused by a different environment.
I've seen an LFS AI adjust his line from lap to lap, trying to keep up with me. It's then fun to bring in an AI who's never driven the circuit before and see him duke it out with those who have experience racing against me, and are a bit "bolshy". They're still idiots, though. :dopey:

I was under the impression LFS dropped the 'learning AI' part a few versions ago? Certainly the last time I played with them (z25?) they seemed pretty unremarkable, still. I don't know if even the biggest LFS fanatics would suggest it's a great offline game due to the AI, or at least, I've never seen anyone do it :)

I think it's important to keep track of what a lot of these AIs are designed to do. When people say something has "poor AI" I can't help but think they are kind of assessing things ass-backwards, in terms of writing it as part of an actual commercial or releasable product, I think a lot of racing games do pretty well. So an end user's checklist might look something like the one a couple of pages back:

1) Detect when a player brakes entering a corner and by how much
2) Detect when a player accelerates out of a corner and by how much
3) Determine the point of entry and exit
4) Utilise speed traps over sector points to give average speeds per sector and per lap
5) Create in realtime AI that monitors the above and improves as a player improves

Whereas a developer's checklist looks like this:

1) use no more than 5-10% of cycles maximum and never hit I/O for anything, ever
2) tweakable during playtesting feedback, and provide multiple difficulty levels and behaviours
3) absolutely must work with all game content shipped,
4) must work both locally and online, with server setup TBD
5) must be testable during development against constantly modified and changeable assets with no downtime/recompile time
6) must be at least minimally convincing at all times

The development of AI for racing games has a couple of unique challenges too - everything is in a fixed frame of reference, and the speeds are immense. In other cases, say, flightsims and space games, you have some 'outs' to get around the speed issues. Flightsims (at least IME from modding the Il-2/CFS series) get around this by using relative frames of reference for plane-to-plane combat and manuvering, and intense scripting for anything using fixed reference points on the ground, (again IME from Freelancer/X3) space games typically have very loose frames of reference and again can get around any close interaction with them through scripting.

Racing games though - not only do you have to make the AI fast enough to drive sensibly, it has to react to things at 300+ KMH, react extremely quickly to them, deal with minute obstacles, on a totally fixed frame of reference, times 15 cars, and cope with networked reactions to human input. And it has to look convincing, and do nothing much that isn't acheivable by a human player.

I know it's tempting to knock things like AIW because "it's just a line", but it's pretty robust, and it works, with very few drawbacks.

(actually, the Grunts in Half-life were my first taste of seemingly reactive and adaptive AI, clunky and primitive though the "brain" actually was, the effects were convincing - that's what counts.)

The thing is, those are absolutely, purely scripted, with just about every possible action the player can take pre-calculated with a fallback script ready to take it into account. They spent ages working on it. It looks and plays awesome when you use it, but it's not reacting on any "real" level, any more than a choose-your-own-adventure novel.

When I said "in general", I really meant for this "generation" of games, since GT5 is coming on current hardware, with its current limitations (actually, GT5 is probably mostly time limited..?) So I won't be expecting leaps and bounds, to the effect of the kinds of system Qronicle has explained - i.e. true real-time learning AI.

I'm aware the gaming industry is not a great place for actual cutting-edge technology - there's too much money to be made re-applying a known-good formula (much like the chemical-commodities / petroleum industry, I suppose).

Yep, absolutely. Again it's just a matter of looking at from maybe a slightly different perspective than "this doesn't do everything I want". If it does most things right and doesn't fail egregiously then that's really good AI :)
 
Sorry for the mahuusive post! :guilty:

I was under the impression LFS dropped the 'learning AI' part a few versions ago? Certainly the last time I played with them (z25?) they seemed pretty unremarkable, still. I don't know if even the biggest LFS fanatics would suggest it's a great offline game due to the AI, or at least, I've never seen anyone do it :)

I did say they were idiots! :sly:
Anyway, I'd forgotten about them dropping the adaptive part (I have a several versions insatalled, for various reasons). It was quite annoying, because they were too impressionable, really, and couldn't unlearn very easily. They're not very fast, either, and a bit blind to the player - hence the observed reticence to praise them. However, the devs should be praised for trying a different approach!

I think it's important to keep track of what a lot of these AIs are designed to do. When people say something has "poor AI" I can't help but think they are kind of assessing things ass-backwards, in terms of writing it as part of an actual commercial or releasable product, I think a lot of racing games do pretty well.

Regarding your checklists, the whole point of a good game is that the technology and innovative development that goes into it should be transparent, and not interfere with the experience (argh, horrible word, but you understand) - so, actually, the end-user checklist is, in a way, more important than the developer checklist - and should feature on said checklist. Without such an attitude, it's difficult to make a truly great game - simply because, it's judged by the way it plays, not by how cleverly the devs have managed to control asset usage to remove loading screens. Of course, the knock on effect of this particular "tech" is quite strong (positively) on the game experience, so it's not a pointless exercise to do such things, but it has to work for the game - think about how Kaz has alluded to having avoided true weather and damage effects until recently, simply because he couldn't guarantee they would work in a game-environment, irrespective of the fact that it works well in prototypes!

Of course, credit should always be given where credit is due.

The development of AI for racing games has a couple of unique challenges too - everything is in a fixed frame of reference, and the speeds are immense. In other cases, say, flightsims and space games, you have some 'outs' to get around the speed issues. Flightsims (at least IME from modding the Il-2/CFS series) get around this by using relative frames of reference for plane-to-plane combat and manuvering, and intense scripting for anything using fixed reference points on the ground, (again IME from Freelancer/X3) space games typically have very loose frames of reference and again can get around any close interaction with them through scripting.

Correct me if I'm wrong, but a relative frame of reference is surely the only way to "do" human AI? We all see the world from our own frame of reference, which is always relative. Maybe I'm mis-understanding the terminology, and there's an issue with a particular method of implementing "frames of reference" in this manner, for AI, but if a relative frame of reference is used for dogfighting aircraft, why not for jostling racing cars?
Presumably the fixed referencing is for the circuit (which hopefully doesn't move), but it does move relative to the cars...? Could a hybrid approach be used for racing games, as it is for flight-sims?

Racing games though - not only do you have to make the AI fast enough to drive sensibly, it has to react to things at 300+ KMH, react extremely quickly to them, deal with minute obstacles, on a totally fixed frame of reference, times 15 cars, and cope with networked reactions to human input. And it has to look convincing, and do nothing much that isn't acheivable by a human player.

But all of this is applicable to dogfighting, too - and they travel much faster than 300 km/h (closing speeds of two aircraft can be well in excess of 2000 km/h)

I know it's tempting to knock things like AIW because "it's just a line", but it's pretty robust, and it works, with very few drawbacks.

I wouldn't knock it for "just being a line" (which it isn't, in any case - it's more of a "corridor") unless that's how it played. It does "work" (depending on your checklist) but is that enough? It has drawbacks (in every application of this particular "format") - namely breaking of the suspension of disbelief. Not game breaking, I suppose, but hey - most people play those games online, too.

The thing is, [half-life's grunts] are absolutely, purely scripted, with just about every possible action the player can take pre-calculated with a fallback script ready to take it into account. They spent ages working on it. It looks and plays awesome when you use it, but it's not reacting on any "real" level, any more than a choose-your-own-adventure novel.

This is what I mean about the implementation vs. the end result. I was utterly convinced when playing this game for the first time, that I was fighting something that was trying to "out-wit" me. I even rummaged around the SDK trying to find the bit that controlled their grenade throwing abilities, because I was gob-smacked at how deft they were with it, even when I was in a doorway beyond a balcony, and they were down below, I'd often see the grenade land behind me, flushing me out onto the balcony. Harrowing stuff when the adrenaline is flowing! Of course, they were far from perfect. Pausing for cover in the open, for example, or the grenade missing and landing well out of harms way - but these moments just made you think you now had the upper hand, and were actually, oddly enough, great for gameplay, even though they're obviously errors in the implementation!

Yep, absolutely. Again it's just a matter of looking at from maybe a slightly different perspective than "this doesn't do everything I want". If it does most things right and doesn't fail egregiously then that's really good AI :)

Of course, you're right - but I'd rather not have to convince myself to consider the development of such a feature unless it's because I'm gob-smacked (see above) at how effective (as part of a game mechanic) it is.
 
1 thing I don't like about all these game AI is the throttle/brake pumping in corners. I see this in GTR Evo, and I think in Prologue as well.
instead of smoothly applying the right amount of thottle needed, it's like they pump the accelerator on/off!

You can hear that throttle pumping here with the Art Morrison Corvette at 0:30. Other than that you can see the AI is way better than GT4, and Gt5 will be improved over this as well. I just just hope they can drive fast enough to beat me with the same car and same tune.
 
In GT4 we saw AI cars brake twice for certain corners. Once in the braking zone and then again at the apex. Then, they get impossibly quick acceleration out of the corner.

Judging by the default setups of any car in GT4, the AI uses ASM and TCS (which is bull because anyone worth a damn turns those off)

Maybe that explains their "un-natural" driving style.

Did anyone notice the GT4 AI is a LITTLE less retarded when in Track Day, seems to me like the make cleaner passes as opposed to the pelvic-thrust like overtake maneuvers in races.
 
Sorry for the mahuusive post! :guilty:

Hee hee :)

Regarding your checklists, the whole point of a good game is that the technology and innovative development that goes into it should be transparent, and not interfere with the experience (argh, horrible word, but you understand) - so, actually, the end-user checklist is, in a way, more important than the developer checklist - and should feature on said checklist.

I agree, but, again, from the developers perspective, what tends to happen is that user feedback is great at telling them what people like in a game, without necessarily being very good at telling them what people want a game to do. Ultimately anything from a user's list of priorities is going to be broken down into a series of steps the program is going to have to perform, and need to be coded/filled out with suitable data. Saying that people want 'smarter' or 'more human' or 'more reactive' AI isn't really telling them all that much.

So from the perspective of the LFS devs, they tried something new (ding), they made the AI learn the tracks from experience (ding), and react to driving with the player (ding), but in the end result that doesn't actually produce something that people want to drive against (bzzz). It's not actually providing anything useful about implementation of those concepts.

From the end user's perspective, you could have a cheating AI that is constrained in certain ways, vs a non cheating AI that isn't, and this would make very little difference to them as far as which one they thought was 'better', or even which one they would be more likely to perceive as cheating in the first place.

Correct me if I'm wrong, but a relative frame of reference is surely the only way to "do" human AI? We all see the world from our own frame of reference, which is always relative. Maybe I'm mis-understanding the terminology, and there's an issue with a particular method of implementing "frames of reference" in this manner, for AI, but if a relative frame of reference is used for dogfighting aircraft, why not for jostling racing cars?

In terms of what's in the AI's own frame of reference, pretty much every game forgets all about trying to strap it down to only what it can "see" - it's much much easier to give it the entire world's information, and remove information from that as necessary, rather than develop "senses" that work in terms of what it "sees" from the perspective of the individual AI controlled car or whatever.

The frame of reference is in terms of how the AI needs to navigate the environment it's placed in. High object densities make pathfinding a lot harder. So say in a flightsim we really don't need to worry about much other than an AI plane's interaction with the ground (avoid it, generally), landing and bombing/strafing a target, the first of which can be deal with by giving it a priority of avoiding uncontrolled contact with the ground, the other two can be dealt with by more intense scripted behaviours. The movement outside of that can, generally, be about as sloppy as it likes, because it's not going to run into anything, the only things it really needs in its frame of reference is itself, its target, and some bounds to keep it from pointing on a course that'll crash into the ground in the next few seconds.

Again, space game - not a lot that is going to get bad fast if it's sloppy. If it needs to navigate something with high object density it's generally not going to be at a particularly high speed or anything that can't ultimately be dealt with by explicitly telling it how to navigate via a script.

Racing game - you absolutely can't have the AI deviate all that much from a sensible course, because it's surrounded by other objects, and the ground, all the time. Not only does it have to 'not hit things', it also has to navigate on the ground at high speed via throttle/steer inputs that don't look 'wrong' to the player. If you want it to 'look' ahead to navigate, rather than use waypoints, you need it to look a pretty long way ahead through a fairly densely packed environment, and do it at a very high tickrate. So the amount of memory and cycles that takes, as compared to doing it in a case where we won't hit anything/anyone and nobody will notice so much if it looks dumb doing it for a fraction of a second, is comparatively pretty large.

Or you can just use waypoints/some other kind of navigation node and something like an FSM setup on top of it (do this, if you're not doing this do that, if you've just done that check this, if you've got nothing left to do, do the first thing again) to deal with anything happening outside of those waypoints. Which is what most games do. Even Shift which has probably the most complicated and deep set of FSM weights I've seen in a racing game can look pretty dumb sometimes :)
 
I agree, but, again, from the developers perspective, what tends to happen is that user feedback is great at telling them what people like in a game, without necessarily being very good at telling them what people want a game to do. Ultimately anything from a user's list of priorities is going to be broken down into a series of steps the program is going to have to perform, and need to be coded/filled out with suitable data. Saying that people want 'smarter' or 'more human' or 'more reactive' AI isn't really telling them all that much.

So from the perspective of the LFS devs, they tried something new (ding), they made the AI learn the tracks from experience (ding), and react to driving with the player (ding), but in the end result that doesn't actually produce something that people want to drive against (bzzz). It's not actually providing anything useful about implementation of those concepts.

From the end user's perspective, you could have a cheating AI that is constrained in certain ways, vs a non cheating AI that isn't, and this would make very little difference to them as far as which one they thought was 'better', or even which one they would be more likely to perceive as cheating in the first place.

I see, so it's the age-old problem of "translation" - translating the gamers' "needs" (as perceived / imagined by research or some other method...) into a set of ideas and goals to aim at in order to meet those needs, coupled with the actual, practical application and testing and review; all the while adhering to the stipulations of other departments viz. time, money etc. - or, "stifled creativity" for short :lol:


Frames of reference: thanks for the enlightenment! It seems your knowledge has come from some experience in the area. 👍

Now, what you've explained makes me think that the way the AI perceives its surroundings, in this age of content explosion, has become flawed, from an effectiveness / efficiency point of view.
Why would you chuck the whole scene at it to process, when only the pertinent objects / info really matters?

Obviously, this requires some method of efficiently controlling the information the AI has available to it for processing, according to the context - i.e. controlling its focus. "Scripting" certain built-in behaviours is always useful to avoid unnecessary complications at times, even if it's not ideal from a creative standpoint.


I may be over-simplifying, but this discussion certainly makes me want to have a crack myself... I've done a tiny bit of work with grouping behaviour, based on "attractors" and movement constraints (in the context of contra-flow "corridors" with people), but this is certainly a bit different, and much more complex.
Perhaps it would be wise to start with the "adaptive" avoidance / exploitative part first, and then "hack" in some sort of path-following behaviour...
 
Some cool thoughts in this thread :)

I almost forgot that the most difficult thing of creating human-like AI, is the debugging. When you've got a fixed set of rules, it is pretty easy to see where something could've gone wrong. But if you have massive amounts of values of different skill nodes... you get my point :p

Some fine hear-tearing examples (yes you recognize Luigi Circuit):

racing-lines-0.jpg


A figure of eight where one really wouldn't expect it:

racing-lines-1.jpg


A very good sweeping line, only to become a nice pattern of randomness :)

racing-lines-2.jpg


And this is only for line-finding algorithms :D (We ironed most of the quirks out eventually ;))

If some people speak Dutch and want to read some more about the techniques we used, you can always download our 'paper' here
 
I see, so it's the age-old problem of "translation" - translating the gamers' "needs" (as perceived / imagined by research or some other method...) into a set of ideas and goals to aim at in order to meet those needs, coupled with the actual, practical application and testing and review; all the while adhering to the stipulations of other departments viz. time, money etc. - or, "stifled creativity" for short :lol:

Yep, exactly. AI is not a feature that shows up on a magazine spread or a screenshot. It's something people notice after they play/buy/rent the game. So it tends to get a commensurate amount of attention and budget during development. Any time any value changes anywhere, in a particular car or a track or the physics engine, has the potential to invalidate something in the way the AI system works. Another thing racing games have to deal with is that a screenshotable/marketable point that people will notice is the accuracy of real world locations and real dimensions for the cars and tracks. Nothing allows you to fit the content to the AI, you have to fit the AI to the content. The guys writing Call of Duty or STALKER can make Pripyat sort-of look like Pripyat to give the AI spawn waves a break and make a mission more exciting. But if you make Brands Hatch only sort-of look like Brands Hatch to give AIs in a tier 1 event on easy difficulty using a front wheel drive car a break, that's not a tradeoff people will appreciate.


Frames of reference: thanks for the enlightenment! It seems your knowledge has come from some experience in the area. 👍

I'm not a coder, I've just messed around a lot with data in a few moddable games with exposed AIs. But you can get a fairly decent feel for how and (some of the) whys of things by doing that.

Now, what you've explained makes me think that the way the AI perceives its surroundings, in this age of content explosion, has become flawed, from an effectiveness / efficiency point of view.
Why would you chuck the whole scene at it to process, when only the pertinent objects / info really matters?

It's not every AI and every game system that works like that, but most do. The thing is, in order to function at all, you're already calculating a world-state for the player to be in. There's no point doing 15 iterations of the most expensive part of the game, and feeding the AI data from those, when you can just start off with the data you already have and selectively feed things to the AI's own bubble of awareness.

To be clear most games don't throw the whole world state at an AI, they constrain it to a certain level of function, similar to the way a graphics engine will LOD textures/geometry. Most games will give them a bubble of awareness (eg square area/cube) and vary how much weight/urgency to assign a node for their navigation/reaction/whatever when something takes place inside of that zone, to give a convincing illusion of them hearing or seeing something when something takes place inside of it. At the edge of detection you might have a very low rate of reaction and a very low tickrate to update their reactions to it, at the centre you might switch to a much higher resolution version of the same behaviours. A lot of "big" world games like the old Falcon 4 flightsim rely on this a lot and do it for the player's perspective too. So actions far from the player don't need the AI to resolve every last polygon of the landscape, good enough is good enough, you can resolve a squadron/squad of troops down to one single unit and let it fly through the ground as long as it resolves back to higher definition when it's inside the player's "bubble".

Obviously, this requires some method of efficiently controlling the information the AI has available to it for processing, according to the context - i.e. controlling its focus. "Scripting" certain built-in behaviours is always useful to avoid unnecessary complications at times, even if it's not ideal from a creative standpoint.

Yep. Efficiency of action and use of resources is basically the biggest pressure on this. Things the player doesn't see don't matter as much. Things that are right in front of the player matter a lot. Faking things is fine as long as it doesn't look fake.


I may be over-simplifying, but this discussion certainly makes me want to have a crack myself... I've done a tiny bit of work with grouping behaviour, based on "attractors" and movement constraints (in the context of contra-flow "corridors" with people), but this is certainly a bit different, and much more complex.
Perhaps it would be wise to start with the "adaptive" avoidance / exploitative part first, and then "hack" in some sort of path-following behaviour...

The best toy going for this at the moment is Arma2, I think. People have made some amazing AIs for it, just going on what's exposed through the engine itself, intensely scriptable at both high and low levels and with UIs, uses intra-engine exposed data and a few 'modern' things like configurable FSMs, big support community, well documented functions, etc. It's pretty cool. You can make pretty much anything with it and people have.

And this is only for line-finding algorithms :D (We ironed most of the quirks out eventually ;))

That's very cool, thanks for sharing.
 
Last edited:
Cool stuff, Qronicle.

Proper AI is harder to produce than most people would think. Getting the pathfinding algorithm is one thing, then you have to consider a dozen other AI cars on the track and a moderately unpredictable player-controled car. It's not exactly a cakewalk.
 
After thinking for a while and imagining myself in Kaz's situation, it is really difficult to program AI as detailed as some of the above posters want it.
There are limitations on what computers can do.
 
If some people speak Dutch and want to read some more about the techniques we used, you can always download our 'paper' here

Thanks for sharing that! I had a stab, but my theory that Nederlands is halfway between German and English (well, geographically, it sort of is!) was deeply flawed... The pictures are pretty, though :dopey: and the references useful :sly:

I'm not a coder, I've just messed around a lot with data in a few moddable games with exposed AIs. But you can get a fairly decent feel for how and (some of the) whys of things by doing that.
It's a viable method; Valve quite like this sort of hands-on, practical approach, I think ;)

AI Bubble: so I did mis-understand! :ouch: This makes sense, why generate more data when you can adapt what you "have" already?

The best toy going for this at the moment is Arma2, I think. People have made some amazing AIs for it, just going on what's exposed through the engine itself, intensely scriptable at both high and low levels and with UIs, uses intra-engine exposed data and a few 'modern' things like configurable FSMs, big support community, well documented functions, etc. It's pretty cool. You can make pretty much anything with it and people have.

I've always loved the BIS games, and the AI has been a source of fun (sometimes for the "wrong" reasons, admittedly) but I always liked the way, when you tried to take out the enemy from an occupied town, they'd disappear into the undergrowth, or behind buildings, and try to flank your position, out of sight.

Here's a cool demo. (note the AI "FAILS" in the related videos bar) :trouble:
That being said, the AI in ARMA destroys my computer. A lot of the reported "faults" with the vanilla AI are down to not enough CPU cycles to handle them all con-currently, so they can sometimes just run past you, or seem to not notice you, when in fact they're just waiting for their "turn" again on the CPU...

After thinking for a while and imagining myself in Kaz's situation, it is really difficult to program AI as detailed as some of the above posters want it.
There are limitations on what computers can do.

In summary, yes, I think we need to re-evaluate our expectations (as usual!) from a different perspective - pretty much what boxox was recommending in the first place!
 
1 thing I don't like about all these game AI is the throttle/brake pumping in corners. I see this in GTR Evo, and I think in Prologue as well.
instead of smoothly applying the right amount of thottle needed, it's like they pump the accelerator on/off!

I do like how in GTR Evo the AI will sometimes flash their lights at you :)

I do this most of the time it's much easier than trying to find the correct pressure on a controller, it's the same with steering when going round long gradual corner like the corner before Spoon at Suzuka it's almost impossible to apply the right pressure so you have to keep stabbing the analog stick.
 
Did anyone notice the Volvo race video?
I think it shows a significant improved AI. It's not that the player in that video is such a driving genious but if you look at the straights he's driving on together with the AI he barely drives away from them. If at all. Pretty nice if you ask me.

In GT4 and even in GT5P it was possible to get 3 or 4 miles more out of the same car that the AI was driving in front of you. Without slip-streaming.
It's finally gone. And it looks a lot more challenging in general as well.

Overall the GT5 previews are looking very good.
 
Some good basic AI on display here at the start

[YOUTUBEHD]R-vKgytwMoc[/YOUTUBEHD]

http://au.ps3.ign.com/articles/111/1114445p2.html

B-Spec should form the foundation of GT5's general AI. As you know in GT4 B-Spec didn't work well, and so it showed in GT4's general AI. Tending to bump the car infront instead of overtaking cleanly

A live demo shows it in action as a Ferrari 458 Italia is put through its paces around the Nurburgring's Grand Prix circuit. It looks gorgeous, as you'd expect, but there's another revelation in the action. At the player's command, the Ferrari attacking outside the first corner and then holding its line for the inside of the next as it pulls an aggressive – and impressive – overtake on a Citroen GT car.

The next opponent is a Gallardo, which the Ferrari hangs on the tail of looking for gaps at each turn. As the first corner approaches again, it dives for the inside but the Gallardo blocks him off. At this the driver's mental status takes a dip – as indicated by an onscreen bar – and as it continues to push it makes more and more mistakes, overshooting apexes and letting the rear-end slip out a little too far as it falls into the clutches of the Citroen behind it. It's dynamic behaviour that suggests that Gran Turismo's A.I could, at long last, have been brought up to scratch.

Seeing more variance in the AI - That Black/red Motul seems rather aggressive in personality, nudges the player and then wobbles down the track and nudges another AI car :)

 
Last edited:
Straight from IGN regarding the "new overhauled AI"

A live demo shows it in action as a Ferrari 458 Italia is put through its paces around the Nurburgring's Grand Prix circuit. It looks gorgeous, as you'd expect, but there's another revelation in the action. At the player's command, the Ferrari attacking outside the first corner and then holding its line for the inside of the next as it pulls an aggressive – and impressive – overtake on a Citroen GT car.

The next opponent is a Gallardo, which the Ferrari hangs on the tail of looking for gaps at each turn. As the first corner approaches again, it dives for the inside but the Gallardo blocks him off. At this the driver's mental status takes a dip – as indicated by an onscreen bar – and as it continues to push it makes more and more mistakes, overshooting apexes and letting the rear-end slip out a little too far as it falls into the clutches of the Citroen behind it. It's dynamic behaviour that suggests that Gran Turismo's A.I could, at long last, have been brought up to scratch.
👍
 
Back