Rubberband AI Implemented in AIDriverToolkit

Hello,
I am new to unity, I recently purchased AIDriverToolkit. But found it lacking in terms of that AI is not competitive enough… it is being pretty easy to beat …so I improved it…

I implemented Rubber Band AI into it…

[Rubber Band AI is a hidden feature in racing games that allows computer-controlled players to catch up no matter how far back they are, artificially and unfairly ‘balancing’ gameplay.]

I used this article to implement it…
http://www.gamasutra.com/view/feature/3920/the_pure_advantage_advanced_.php?print=1

I have kept 4 type of AI cars:

  • Easily beatable…
  • Stays near to the player.
  • Gives a tough fight to the player and hard to leave behind.
  • Can only be beaten near the finish line … else stays ahead always.

You can try it out at:
http://dl.dropbox.com/u/52818805/WebPlayer/WebPlayer.html.

Would like to know if you find it good enough now… or would like/suggest some further enhancements too…

Credits: AI Driver Toolkit 3.3 – Seifert Engineering for the original script.

If you are an AIGameDev Premium member, they have a video from the Paris Game AI Conference 2009 that can be interesting for you. It is called: Experience Management beyond Rubber Banding in PURE.

I’m also planning to implement a similar feature in my own Racing AI package, so I’m very interested in your progress… it is always interesting to see if a feature works in a competing product before implementing it in your own product.

I think nobody got what I said previously… so re-posted my work explaining everything in detail.

@davidgutierrezpalma… nopes I am not a premium member of the AIGameDev. It would be great if you can send me that video. (harshmathur.1990@gmail.com). I will try to implement it and that will improve AI driver toolkit further.

P.S : I am thinking of sending this improved AI toolkit back to the original developers so that they can release it in the next version with these additional features.

I hadn’t read the Gamasutra article, but it covers most of the things explained in the AIGameDev video. I think the only thing that wasn’t mentioned in the article (and I don’t remember if it was included in the video or in another article I read a few months ago) is the possibility of forcing driving-errors if the AI gets too far ahead from [the target distance from] the player.

Please keep in mind that there are many experts and gamers that don’t like Rubber Band techniques at all. IMHO, I think whenever possible, the AI should drive fairly. If AI is not competetive as in your case, Rubber Band techniques can be used as a last resort.

I don’t know if that comment was for Harsh or for me, but if you read the Gamasutra article or watch the AIGameDev video, you will see that they aren’t talking about the classic Rubber Band techniques, they aren’t talking about cheating the player using different Vehicle Physics for AI-controlled vehicles or giving the AI super-human speed at certain moments of the race or making the AI super slow when it is waiting for the player…

They are talking about having an AI that is so good that can beat an expert player in every race and they discuss certain techniques that can be used for adjusting at runtime the AI skill-level to provide a challenging (but fair) experience without cheating, using exactly the same Vehicle Physics that are being used by the player. Those techniques are intended to give the player (no matter his skill level) the experience of fighting his way from the last positions to the podium… unless he does something really dumb. They also suggest that, instead of making the AI completely dumb for the novice player, he will have a better experience if we force the AI to commit believable driving-errors: the novice player will find the AI errors and collisions more realistic than an AI which is terribly slow until it’s overtaken by the player (and start racing at a normal pace just after that).

In other words, the techniques described in the article shouldn’t be used for cheating the player or hiding the poor performance of a bad AI, but as a way to provide a more satisfactory experience for the player (once you have developed an unbeatable AI). If the player win, he should think that he has won because he was pushing the car to the limit, not because the AI-vehicles were waiting for him.

Difficulty: Expert = absolutely no Rubberband AI

Difficulty: Hard = little Rubberband AI implemented (10% speed reduction?)

Difficulty: Medium = some Rubberband AI implemented (30% speed reduction?)

Difficulty: Easy = Rubberband AI implemented (40%+ Speed reduction?)

so on and so forth.

Rubberband AI is meant for people who aren’t too good with racing games, like myself. I understand that you said “experts and gamers”, but thats what the “expert” difficulty in a game would be for :slight_smile:

EDIT: Oh and good job on this (of course) :smiley:

@davidgutierrezpalma … exactly…
@xzile40 . u explained it best way… thanks… :slight_smile:

@everybody… Can you guys suggest me what else is used apart from rubber Band AI in modern day racing games…for creating a competitive AI ?
If possible please redirect me to some resources wherein I can read up about those techniques…

My goal in this game, since there were no lap limits, was to flip over the A.I.

How about making it so they try to fight back a little bit? Try to get you to flip upside-down or something :slight_smile:

If you need to use Rubber Banding to make your AI competitive, you aren’t using the technique correctly: modern games don’t need to use Rubber Banding to make their AI competitive, they already have an AI which is so good that can consistently beat an expert player without cheating (in other words: using exactly the same Vehicle Physics than the player) and only use Rubber Banding techniques to let the player win without being too apparent (the player should never realize that he won only because the AI let him win).

If you don’t mind spending some time tweaking parameters for each vehicle-track combination, I would say (based on my experience) that you only need simple Maths to create an AI which can beat consistently the average player. However, if you want to create an AI which can beat an expert player, you will probably need to use some Machine Learning techniques. I have been experimenting with Genetic Algorithms and, while the algorithm was capable of finding the ideal racing line without human interaction, it needed so many iterations that was completely useless for any “real world” use… So I will start experimenting with (Artificial) Neural Networks after releasing the next version of my AI package.

Having wrote AI for lots of AAA racing titles, AI in racing games is a very interesting subject that divides a lot of people. To rubber band or not to rubber band that is a very interesting question ? Our research seems to be that hardcore racers don’t like it or want it, which suggests simulation games, whereas casual gamers don’t care. So it depends upon your game and target audience, and of course your game designer has the last say over the final gameplay :slight_smile:

My goal has always been to create the fastest AI (racing games) in order to beat any player using the SAME car and then it is scaled back by the game designer. You also can’t just use fastest lap, the AI has to have some intelligence. For example, you can create an AI that can lap the fastest on it’s own, but when to overtake requires a lot of intelligence as a bad attempt will lose seconds. We also don’t want to create the perfect AI as this won’t be fun also.As I’ve already stated, the three things to consider are game type, audience and game designer. My last two games :

PGR4 : Intelligent AI overtaking, the best AI will beat any player so it is scaled back for the race. For example, assuming best AI is 1.0, then a typical platinum race will consist of AI (assuming grid back to front) of 0.87, 0.9, 0.93, 0.97, 0.9. No rubber banding, no cheating.

BLUR : Semi Intelligent AI overtaking (more lateral separation). Best AI will beat any player so it is scaled back for the race. The race is actually scripted (rubber banded) similar to articles mentioned but my implementation goes back as far as Wipeout 2097 and F1 2001. The articles aren’t new techniques, in fact quite old , just not openly discussed.

PGR4 is for me the best racing game ever. Tons of fun. If you where involved in that, congrats., love that AI.

@Pulov : Yes, I wrote the AI for PGR 4. I’m glad you liked the game.

awesome man… u rock…

@Harsh : Thanks.

If you are looking at beginning AI I would suggest the articles/videos mentioned above but also the early AI Game Programming Wisdom books. They have numerous articles on AI for racing games.

A little insight into PGR 4 and my core AI system. The racing line is auto generated using the width of the tracks (look up path of min curvature), this gives a 95% optimal racing line. This could then be fine tuned if needed in problem areas using markers that the racing line has to go through. This racing line is stored at 1 metre intervals. From this line, curvature is calculated , car physics, external params, all contribute to the exact speed of a PGR car or bike at any point on the track. Therefore, the track lap time of a vehicle can be calculated without running the actual game, just plug in the vehicle dynamics/AI params. This had an error margin of 5% but was very useful in stack ranking all 200 cars at the different difficulty levels and for the car physics tuners. Being able to calculate the exact speed at any point on the track allowed me to develop quite complicated predictive overtaking routines. i.e. depending upon the time to look ahead, you can work out when and where a potential overtake would or could occur in track space. This was built into the AI driver behaviour.

In general try to read as much as you can about AI in general and a good understanding of physics is a must.