Post-Play'em - Observations on Game AI

Mario Kart: Double Dash

Over the past 4 years, my family has spent way too much time playing Mario Kart: Double Dash. Given that my kids are teenagers, we billed it as “driving lessons.” Only one of them has taken the wheel rather than the controller pad since that point and we have yet to see any ramifications (if you will pardon an obvious homonymic pun). However, there were times when my wife and I would feel an overwhelming need to swerve to avoid a non-existent red shell or banana peel. At that point, you begin to realize that you have played a game too much. Which had about the same effect as me realizing that I need to lose 20 pounds – it’s nice to acknowledge it, but changing the behavior is something else entirely. Which is why we continue to have family fests and beat the snot out of each other to the ultimate climatic moment of Rainbow Road.

Anyway, many years of playing the game have taken another toll on me – I have not been able to stop myself from making mental notes about the AI and the game design decisions that went into making it tantalizingly addictive. I even mentioned as much to Steve Rabin, Senior Software Engineer at Nintendo of America, while we were having a beer at one of the ubiquitous evening fests during GDC in 2003. If you have ever met Steve, you know that he would make for a fantastic poker player in his ability to not show a reaction. Therefore, I have little idea if the observations and conjecture I made about the DD AI at the time were even remotely close. I would like to think, however, that there was a twinkle and a smirk. Of course, I have no reason to believe that Steve was even involved in the development – perhaps he was just amused at my enthusiasm.

Anyway, here are some of the observations that I made over the past few years. (Has it been that long?) Forgive me if I get either too simplistic or too esoteric…

The State of Racing…

One of the obvious characteristics of the AI is its use of FSMs. This is something that is in use in most games today on some level or another. However, there were some distinct points where it was very noticeable that the AI was switching. For example, once you crossed the finish line, your team either went into “celebrate” mode or “whiny pout” mode. These were simply repeating animations that continued throughout the duration of the post-race promenade (for example, while you are waiting for your wife to finish because you left an ocean of banana peels for her to wade through causing her to look strikingly like Kristi Yamaguchi doing non-stop toe loops down the final stretch). However, if you are to get whacked in the behind by an errant shell, you will immediately transition into the crash state, then the “stunned recovery” state for a few cycles of the animation (about 2 seconds). Then, magically, you will begin to celebrate once again. It makes it very easy to see that there are very defined edges to the states (and likewise the animations).

The major states, then, seem to be as follows:

  • Pre-race
  • Driving (with occasional sub-animations)
  • Toting and throwing items
  • Crashing (various types)
  • Recovering (such as dragging along behind the car)
  • Post-race victory or bitching

There are some sub-states mixed in there for the more subtle animations, but they are usually very short-lived. The driving mode, especially, has extra states for turning, sliding, punching, taunting or even just looking around because there’s nothing going on.

One side effect of this is that the animation will get slightly muddled, for example, when you have multiple collisions in a row (especially in a tunnel). The way they get out of this is to give up trying to transition properly and simply reset the car on its wheels. It makes for an awkward flip

To Drive… the Invisible Path…

The AI racers don’t necessarily navigate freely along the track. They follow the technique of using invisible paths laid over (under?) the course. There are multiple lines on any given track and the AI will choose which one to follow at any one time.

The reason that this became apparent to me was the first time that I saw two opponents in front of me fighting for the exact same stretch of road. There was more than enough room for them to maneuver, but they insisted on being in the same spot for some reason. What’s more, that “spot” was meandering back and forth along the course… as one car drifted left, the other went right along with him. As they drifted back, they did so together like Ben Hur’s chariot trying to dice up his competitor’s wheels. Not only was the path dumb and the colliding dumb, they were being dumb in sync with each other. Solution? Put a repulsion vector on each other so that following the path is not as high a priority as keeping from scraping paint.

I’m not entirely sure what causes the AI to switch paths. Obviously an event like a spin or crash would cause the AI to pick up a new line. However, it is difficult to tell of the AI changes lines when nothing else is happening – like a cross-country skier stepping into a new pair of tracks. This does, happen, however. I’m just curious as to when and why. Certainly not when they are bumping and grinding down the straightaway, however.

There is another factor, it seems, behind why the paths are the way they are. Not all paths are created for all cars. If the AI is in one of the big heavy cars, for example, they will tend to pick a path that wanders back and forth across the track. This is very noticeable with Wario’s purple beast. He drives like he has imbibed heavily. This is an interesting balancing mechanism – Wario’s car, like other larger cars, is fast once it gets up to speed. If that were left unchecked, once he passed you, he would be a bitch to catch up with. However, if that speed were spent meandering all over non-optimum lines, it slows down his progress and makes for a neat stylistic appearance as to what we get out of ol’ Wario’s character. It is difficult to know what exactly is happening behind you in the race except on such short tracks as Baby Park. Does Wario drive like a drunk moron when he’s 3 places back or only when he’s in front of you?

That brings me to another point… rubber banding.

The Search For Equality…

Rubber banding is one of the most misunderstood aspects of Double Dash – and probably many other games that utilize this technique. Really, it is also a point that blurs the lines between AI, simulation modeling and the basic game design decisions. There is a staggering amount of this going on in DD.

First there is the speed of the cars. In general, when you start a new “Cup” (group of races) and the game “picks teams”, the AI will also assign a general skill level for each car. Throughout that cup, the running order will generally be the same give or take a couple of places. The same 2 cars will generally be in the top 3 and the same two cars will generally be in the back of the pack. This is obvious after having finished a 16-race cup and having one car have a single-digit score – which is only possible if you are continually finishing either last or 7th. Also, if you are a trained professional like I am (I have to look into some form of Mario Kart accreditation or certificate), you will realize by about the 2nd lap of Luigi circuit which of the cars you will have to put up with for all 16 races. [misc. editorial rant: Damn big, fat Peety-head!]

There seems to be three ways they go about stringing out the pack like this:

1) By simply using the published speed of the cars. The fast cars will tend to be toward the front, whereas the putt-putt-mobiles will be in the rear. That means that those first two cars you have to contend with as a good driver will be the big, fast cars.
2) By varying the published speed of the cars. Just because two cars are 3-star speed, doesn’t mean they will always go 3-star speed. This is good in that there are more speeds in practice than the 5 possible stars that the cars are rated at.
3) By varying the time they have their “foot on the gas and brake”. Again, this is visible on Baby Park when you lap someone. If you watch, you will see them move forward in fits and starts as if they are only “hitting the button” intermittently. It’s a nice effect that makes them seem unsure of themselves.

However, the above isn’t rubber banding – it’s just spreading out the pack. As you improve in your skills throughout the game, you will notice that you will usually have a fair amount of company… within reason. If you stop dead in the middle of the track for a minute, don’t expect the AI racers to be sitting around having coffee waiting for you to catch up. However, there will be some noticeable slow-down of the entire pack. Likewise, if you are good, the whole pack will be slightly better than normal. One way of noticing this is if you have two human players of differing ability. You will see such things as the pack stringing out more than usual to accommodate the different players, the lead player running away with the race as the pack holds back or the poor player getting completely skunked as the lead player pulls the pack along with him. I’ve spent too much time racing and not enough time testing this phenomenon, however.

Another method of rubber banding is one that people refer to as “cheating.” (This is likely because it is frustrating… imagine that.) If you are in the back of the pack, you can plan on getting better “stuff” from the boxes. If you are in last, you will be fed a steady diet of mushrooms, stars, lightning bolts and blue shells. If you are in front, however, expect to get green shells, fake blocks and the occasional potassium fix from bananas. It should come as no surprise, therefore, that the AI racers in the back of the pack are the ones getting the lightning bolts and the blue shells. (One note, it IS possible to have a blue shell by accident when you are in front… which means you get to hit yourself with your own blue shell!) If you watch on Baby Park, or keep your eyes on who is the one not getting zapped by the lightning bolt, you will see that the AI is getting much the same load of goodies that you are. I concede that it is possible that they are getting more aggressive stuff, but it is not outright “cheating” in the AI sense.

Now, there does seem to be a change in that algorithm as the race progresses. If you are in last on the first lap, there isn’t as much of a sense of urgency. If you are in first on the first lap, you won’t be getting assaulted non-stop. However, in both of those positions, things seem to change as the race wears on. If it has been smooth sailing for the first two laps, you can expect to have attracted a bit of attention on the third one. Perhaps it is this phenomenon (and the resultant indignation that ensues) that causes people to cry foul. However, once you have been in the position of playing catch-up on the final lap, you will realize that the game is more than happy to dispense one killer weapon after another in order to help facilitate retribution upon the AI. This is even in play on a multi-player race without the AI even being present. So again, this is a game design decision in order to further exciting races.

In the Pursuit of High Drama…

A couple of notes on artificially generated excitement… I can’t tell you how many times (probably because it is now into 4 digits) I have been on the final lap, in 2nd place and within striking distance of the 1st place car, but seemingly without hope… and it has driven straight into the only banana on the entire planet. It is almost as if the AI has gone out of its way to encounter the treacherous fruit leavings! Sometimes that is enough for me to make that last pass to win. Other times it is only enough to make the ending that much more exciting. Is the AI hitting that banana on purpose? Is it simply that the object was dropped onto one of the invisible paths? Does the AI drop objects onto the paths on purpose? This I can’t tell you.

Another observation I have made in this vein is that things that green shells don’t seem to have studied for their Physics 101 final. I swear that green shells, upon hitting walls or other obstacles, will uncannily bounce so as to cross in front of you. It happens too often to be coincidental. Similarly, I have seen green shells bounce off of objects at unlikely angles to strike the AI car in front of me a la the “lone banana” phenomenon above. I know that this is not a hard computation to make… just a little quick vector math based on the path of your car. Therefore, it is my estimation that this is a subtle trick to make the game environment a little busier in the right way. Make it look like things were really dangerous – especially when my back-seat sister forgets what she’s doing and throws green shells forwards instead of backwards.

Things That Work…

In general, Double Dash is a very well done game from the point of AI. I remember way back when we started, I never felt hopeless (until I hit Rainbow Road for the first time and fell off so many times I started laughing until I cried). On the other hand, now that I can’t even beat my own best times any more and have therefore maxed out my own (rather capable) abilities, I still run the risk of not finishing first on some of the races. I prefer winning games only about half the time, and, even after all these years, Double Dash hasn’t slumped back into the role of being a pillow for me to beat on mercilessly. While I tend to finish first on most of the races (80%?), getting a perfect 160 is still a goal rather than a given. I attribute this to the excellent rubber banding in the AI and design decisions.

The characters use their weapons well and intelligently for the most part. The driving makes sense, even when it wanders around the track. The character animations are engaging and amusing at times. (Being a Yoshi player, I am always tickled when he stands on the back of the kart looking “vigilant” glancing left and right to see what’s up.)

Things That Could Improve…

Sometimes, I wish that the AI states were just a little more obscure. It isn’t distracting or annoying, but I want there to be a little more subtlety to them. This is not that big of a deal, however, especially since we aren’t dealing with life-like, human characters. The effect goes quite well with the cartoony feel that is a trademark of the Mario games.

All in all, for the style of game that Double Dash is, the AI worked very well. Otherwise it wouldn’t be one of the top Game Cube games in the history of ever… still. And I wouldn’t still be playing it!

So… is there anything that you have experienced that I may have missed? Is there anything I said in here that is completely out of whack? Drop in a comment! One thing I would be very amused to find out is that I have chalked some effect up to the AI when it wasn’t really there in the first place. Now THAT is the sign of a good design (or an AI programmer who wants to believe in things waaayyy too badly!).

Tags: , , , , ,

13 Responses to “Mario Kart: Double Dash”

  1. Dave Mark says:

    Remember that this game came out in late 2003. That’s a whole 4 years ago. Plus, the GameCube hardware isn’t necessarily ripe for massive AI. On the other hand, what other sorts of additions do you think a kart-style racer could do?

    Sure, they could have divided up the paths a bit better so that there wasn’t the Ben Hur syndrome, and a few more states in the machine would have smoothed things out and perhaps made it a bit deeper… but it was very functional the way they did it.

  2. Andrew says:

    Interesting thoughts on the AI.

    I have played some of the game – mainly multiplayer – rubber banding is very apparent.

    You’re probably right for the most part. It’s pretty simple AI – I suspect it also cheats by going over its maximum speed at times too, or having artificial speed limiters applied.

    Playing Mario Cart DS, which I think is more polished then Double Dash, I can give some oversight of that:

    1. Unlike double dash, you can, when not playing cup games, choose the AI’s level independent of speed. This is awesome – 50CC or 100CC hard games are much more fun to me, since 150CC is a tad too fast.

    Also allows you to see the effects that happen from changing the AI’s difficulty independent of game speed.

    2. The items are so much better balanced, and the AI can’t cheat to get items it can’t normally – I suspect items are in fact not cheated for the AI in it due to this. They do know how to use the Boo item though, oh damn them stealing my 3 red shells :(

    3. I suspect the AI cheats less when racing with speed too, since on hard, even 150CC, it’s easy to get ahead of the pack with good driving and never be caught up.

    4. Due to better handling, the AI cars can keep to their invisible tracks so much better. Makes placing items very easy (or difficult if you know the fastest way around tracks!). They don’t use speed boost turning too much even on hard however, and miss out some shortcuts entirely (ala Mario Cart 64) on some maps regardless of difficulty.

    I haven’t noticed banding around multiple competitors, I think the AI simply goes at whatever speed it can around the track – if you go slow in 150CC, you lose by a lot of places!

    For a handheld it’s not a bad transition of the gameplay, and the AI is pretty good considering, although even on hard, I can very easily beat it due to it not going around the track the best way or picking up items all the time.

  3. Anonymous says:

    Dad, I thought I was your back-seat driver!!!

  4. Ronny says:

    Very amusing article, especially when you have experienced a lot of the described examples yourself! Thanks for these analyses.

  5. [...] about rubber-banding before over on Post-Play’em where I talked about my observations of how it is used in Mario Kart: Double Dash. Rubber-banding is hardly new. It is often a subtle mechanism designed to keep games interesting [...]

  6. i used to play Mario Kart a lot last year but suddenly lost interest coz i got busy*;`

  7. A further issue is that video games are typically serious in nature with the main focus on knowing things rather than amusement. Although, there is an entertainment part to keep your kids engaged, each and every game is normally designed to work on a specific group of skills or curriculum, such as mathematics or technology. Thanks for your publication.

  8. Many people stay their day-to-day lives not really thinking about the outcomes of the actions. When it comes to your own personal health, this is simply not a productive or desirable perspective to possess. Learning about nourishment will allow you to learn to feel and respond to the very best of your functionality. Do not forget that portions are extremely essential. To ensure that you are consuming the proper serving sizes, fill your plate with the ideal foods very first and then the the very least wholesome. It also helps to enjoy the meals on the plate within the exact same purchase. Vit A is a crucial part of balanced and healthy diet. You may get it from such foods as dairy products, ovum, beef liver organ, darkish vegetables, and orange fruit and vegetables. Vitamin A is important for for sight, particularly night time vision. In addition, it aids in the maintenance of bone tissue and tissues. Try to eat the majority of your dishes in the home. When you are out and about, you tend to eat great calories food products along with a better volume of them. In your own home, you can control what elements you use and make sure they are new and healthful. This cuts energy and boosts family time. When attemping to consume a wholesome diet program, take advantage of the microwave less. Microwave oven dishes tend to be high in excess fat, sodium, sweets and additives. It is usually best to purchase your meals clean as well as to prepare food it on your own for it to get the finest nutrients and vitamins. Ensure that the meals which you put into the body is helping you to obtain your ultimate goal of having a more joyful, healthier existence. In this post, we have presented you some suggestions to jump-commence your current nutrients. Now it is up to you, begin using these ways to help you!

  9. Micah Toudle says:

    You ought to be a part of a contest for one of the finest blogs on the net. I am going to recommend this site!

  10. What You Must Understand About Nutritional Vitamins Folks are far more health-conscious these days, however, many are missing an essential aspect: vitamins and minerals.Understanding nutritional supplements is essential to great overall health. Read on to understand more about high quality vitamins and minerals can improve your life. Vitamins must be synthesized just to be utilized by your body for that reason, so you have to know about any possible side effects. As an example, metal can be hard to soak up as a result of calcium mineral. sun and Milk are great techniques to get supplement D. You want a supplement D supplement when you aren’t a sunshine individual or milk products drinker. Vitamin supplement D shields your bone fragments and yes it helps to keep them robust. If you are missing out on, Dietary supplements can be used as a final option. Any supplement consisting of essential oil has to be consumed with excess fat has to be adopted an entire stomach. Vitamin supplements A, E, and K are some natural vitamins that will not absorb appropriately without getting undertaken with meals. They can be very best when you’ve consumed unhealthy fats. You can get nutritional B2, also known as riboflavin,dairy food and bananas, and dairy food. Riboflavin is important in the prevention of cataracts, anemia, cataracts and anemia. A Vitamin is important since it’s an antioxidising that boost immune operate and red-colored locations. Nevertheless, huge amounts can be harmful, so stick with about 2300 IU.squash, darker and Green beans, and darkish leafy vegetables consist of ample supplies of vitamin A. Supplements are definitely more vital now than they were in today’s community. An incredible multivitamin pill can perform a lot to enhance your nutrition. Issue info sources about nutritional supplements. Usually query the motives right behind details you get. Request your personal doctor if you fail to have the information you need. Many girls that aren’t expectant get prenatal vitamins to help expand out their locks and nails. This is simply not carry it in iron. There is a lot to find out when it comes to vitamins and minerals, as you have seen. You have to know which substances are most essential forever health, and ways to pick the best nutritional supplements. Make use of the assistance and ideas you’ve go through on this page to assist you to determine what matches your preferences.

  11. In line with my research, after a the foreclosure home is sold at a bidding, it is common with the borrower in order to still have a remaining balance on the personal loan. There are many lenders who attempt to have all fees and liens paid off by the next buyer. However, depending on selected programs, restrictions, and state legislation there may be quite a few loans which aren’t easily fixed through the transfer of financial products. Therefore, the duty still falls on the borrower that has received his or her property in foreclosure. Many thanks sharing your opinions on this web site.

  12. Mr.tester says:

    I believe that avoiding prepared foods could be the first step so that you can lose weight. They will taste great, but prepared foods have got very little nutritional value, making you consume more in order to have enough strength to get over the day. If you are constantly ingesting these foods, changing to cereals and other complex carbohydrates will help you to have more strength while ingesting less. Good blog post.

Leave a Reply