PDA

View Full Version : Teching the AI How to Race



bastins
04-01-12, 05:47 PM
I recently found out about JNS Tracks, a nice pack of NASCAR tracks. However, one major gripe I have about it is that the AI doesn't always know how to drive the track. Martinsville is a great example - the AI drives all the way through turn two, sticks to the bottom of the track (as opposed to drifting to the outside wall), and doesn't get on the gas until it's basically pointing straight down the back stretch. It's very odd behavior, and kind of ruins the track.

So, what I was wondering is, what about something where the AI learns the track according to how we, the player, drives? It can use a static AIW file or whatever as a base, but after that it starts learning on the fly from what we do. As the more intelligent and experienced driver in the equation, why not adapt to our driving, as opposed to a static groove that an AIW editor calculated from a couple parameters the track maker set at one time?

I know you can already calibrate the AI, but to be honest, I haven't seen it actually do anything meaningful; The AI perhaps speeds up a few fractions of a second on their laps, but still sticks to their one ill-defined racing line. Instead of having to learn the track-making process, and edit the lines and parameters yourself, why not have this all happen behind the scenes while we play the game?

MarcG
04-02-12, 04:39 AM
I dont think the Calibration works properly in RF2 and IIRC someone from ISI said its not needed.

Good idea about Teaching the AI though to follow your driving, I personally think it would be beneficial in the future for Modders to create their own AI styles for their mods, as I have related too in another thread a basic AI is alright but when new mods come out you need different AI styles for them...NASCAR/RallyX/ORR/F1 etc etc. So there you could have a Teaching way as you alude too or let the modders make their own up, or even let the Users create better AI as some Mod teams might not have the time or even want too.

Silent_alarm
04-02-12, 06:54 AM
It could work like this.

You drive about 30-40 laps alone, and those laps and driving lines would be implemented to AI "dream line" library. After that you'd go racing with a pack of AI cars and start as the last one. They've been set to about 1 sec/per 0.5 km slower than your average lap time. You start at the end of the pack and take over the cars in variable different locations with different styles like taking over from the inside or outside, not leaving room for someone trying to pass inside etc. Those lines would go to the "alternate lines" library. After that you'd add the normal AI behaiviour on top of those for basic overtaking on straights etc and that should actually end up being quite decent if there's driving lines and behaviours from 3 or 4 different drivers so we could get few different styles too. Like 1 endurance style, 1 Agrresive style, and so on.


Do we need it? That depends on the player. Some like to practice and make setups first offline before going to online. I prefer doing everything online. You'll learn the correct driving lines faster when you can follow others. You know if you need to do some more adjustments to gain the advantage.

And then there is the point that would you let a guest to drive online with your nickname?

ZMC888
04-02-12, 08:12 AM
Silent alarm, makes sense.

I always play 100% but I notice sometimes that AI are noticeably faster than me in one place, and that I'm faster than them in other places, thus the overall lap times are similar, but this isn't the whole story. Also if I was watching a race on TV I would expect about 5-30% of the cars to crash out or have mechanical issues depending on the race.

My idea would be that the track has a basic AI, then every time you play the track and a random 5th-10th best lap as long as you have done over 30 laps is uploaded into the overall AI mix online which then influences AI behavior. Then the same thing could be downloaded from other players and added into the AI mix of how the AI behave. Crash data of where people crash and how often could be used too, to make the AI more realistic.

Basic programed AI + personal driving style + other drivers personal styles = adaptive AI behavior

UOPshadow
04-02-12, 08:39 AM
Everything that makes the AI-Lines more variable and life like would be welcome. Also: everything that helps to achieve this quicker is even more welcome.

My usuall process for driving Offline (mostly F1 mods): I usually need 2 days making a speicific AI Line just for the mod I want to simulate. Overtaking is a big issue. I'm forced to resort to create special driving lines to make overtaking possible. This is often not the fastest line. Then I have to make a good setup and adjust it to every car so that every car/team has its own setup. Only then you'll get everything rfactor has to offer. After about 4 days I am ready to race and as I said - then it is a great experience, but since these settings work only for one Mod, I have to redo this every time I race a season with a new mod.

Working 4 days to make this happen for about 16 races in a season: This is no fun.

I hope ISI will chime in here and tell us how they see this issue.

edit: It would be great to download the fastest lines from the fastest real rfactor drivers online. Maybe in online races their lines can be tracked and recorded or something.

Silent_alarm
04-02-12, 08:40 AM
That would be pure gold and if it would work like intented, it to would be pretty much a great selling point. I'm tired for the dumb AI that's in every racing game. It either doesn't know how to give way for faster drivers, or it doesn't know when to give up the battle when going in to the corner and pushes you out of the track like a sore loser, or ends up tailgaiting you constantly. The list is endless...

Also what would be great is how the AI would react when you're putting some pressure on it. You know the situation when you're not fast enough to overtake the guy in front of you but s/he ain't getting away from you either. So you end up putting some pressure to the driver in front of you with constantly driving close and you hope that it starts to stress them out or they try to drive a bit faster than it's actually possible so they end up making mistakes. I've seen it online, i've done it online and it actually works pretty well. You can pretty much tell the new guys on track racing by that too.

bastins
04-02-12, 09:10 AM
I really like the idea of community-driven or cloud-based AI data. I was originally thinking strictly about offline, but collecting data online would of course be that much better.

Kind of reminds me of KERS - you've got all of us putting in thousands of good laps... why not recover that driving data, and put it into the AI ;)

Satangoss
04-02-12, 09:30 AM
Everything that makes the AI-Lines more variable and life like would be welcome. Also: everything that helps to achieve this quicker is even more welcome.

My usuall process for driving Offline (mostly F1 mods): I usually need 2 days making a speicific AI Line just for the mod I want to simulate. Overtaking is a big issue. I'm forced to resort to create special driving lines to make overtaking possible. This is often not the fastest line. Then I have to make a good setup and adjust it to every car so that every car/team has its own setup. Only then you'll get everything rfactor has to offer. After about 4 days I am ready to race and as I said - then it is a great experience, but since these settings work only for one Mod, I have to redo this every time I race a season with a new mod.

Working 4 days to make this happen for about 16 races in a season: This is no fun.

I hope ISI will chime in here and tell us how they see this issue.

edit: It would be great to download the fastest lines from the fastest real rfactor drivers online. Maybe in online races their lines can be tracked and recorded or something.

Have you tried Auto Line Smooth="3" instead of 1 in your PLR file yet?

It increased the number of overtakes significantly for me.

oldschool1478
04-02-12, 10:22 AM
In the game Live For Speed, the AI are able to be taught by your driving.
For instance, if you always guard the inside on a turn, the AI will try a pass on the outside after a few laps.
You can also just let them drive laps on their own, and they improve, and retain what they learn on that track.
I don't know how this feature is implemented.

UOPshadow
04-02-12, 11:05 AM
Have you tried Auto Line Smooth="3" instead of 1 in your PLR file yet?

It increased the number of overtakes significantly for me.

Hm, no. Thanks for the tip - will try that. :)


In the game Live For Speed, the AI are able to be taught by your driving.
For instance, if you always guard the inside on a turn, the AI will try a pass on the outside after a few laps.
You can also just let them drive laps on their own, and they improve, and retain what they learn on that track.
I don't know how this feature is implemented.

Sounds nice. A more flexible AI or an AI that is adapting to you would be a dream come true.

bastins
04-02-12, 05:16 PM
To provide another example of where this idea would come in handy, take a look at '60s Monaco. It seems that the AI isn't "set" to be able to race modern cars there, and doesn't navigate the chicane too well, often plowing straight into the guard rail. It takes only a few laps to wipe out a whole field of Meganes.

I think this would be exactly the type of thing that could be fixed by learning from us. A few good laps, and they should start to have a better idea of how to approach the chicane with those particular cars.

CdnRacer
04-02-12, 05:44 PM
Hm, no. Thanks for the tip - will try that. :)



Sounds nice. A more flexible AI or an AI that is adapting to you would be a dream come true.



HAHAHAHA. Believe me you don't want LFS AI. It's beyond horrible. It's unusable. It makes rF1's AI looks amazing. HAHAHAHA