What stops AI karts from lagging in a racing game? - algorithm
Algorithm
When you play Mario Kart with AI, have you ever felt that AI seldom lag far behind and hold the position near the player? If you have, you have experienced ‘negative feedback effect’ of Mario Kart indirectly.
In many games, positive feedback and negative feedback are important factor in maintaining the balance of the game. Without these kinds of feedback, the game loses its interest and fun. Imagine that no matter how much you achieve there is no reward or profit in role-playing game, or that there is no way to close the gap between leading and trailing groups in a racing game. You will lose interest in the game and soon lose the motivation to play it.
In the racing game, the easiest way to fill the gap is giving trailing groups more speed or giving some handicap to the leading group. Because the adjustment must not interfere the phase of playing, appropriate adjustment is required. Then how can we determine the appropriate level of adjustment? If you are game creator and to determine this level, you will probably first consider how far apart the groups are. When the distance between the leading and trailing groups exceeds a certain length, the level of adjustment increases according to some formula, as the distance increases. Otherwise, no adjustment is made.
As seen above, decision making in a machine is made in a standardized way, called an algorithm. An algorithm gets problem situation and information of variables called parameter, processes variables according to a procedure set, and gets result. It must not be abstract, and must end within finite times. As long as a procedure set meets these conditions, is can be an algorithm.
Now we explored one easy algorithm! Its problem situation is to find an appropriate adjustment level for groups, and the parameter is a distance between the leading and trailing groups. Given this information, the algorithm calculates an appropriate adjustment level using pre-defined formula and the parameter, and gets result. In this way, we can define many other algorithms. It is simple and not hard! How about find a resource and define an algorithm?
Article by Ben Shin
Comments
Post a Comment