If a game had an enemy compete with you lets say like a racing game, would you need A* for the enemy or can you program it just like normal???
Something like mario kart or an olympic race or even some thing even abstact?
thanks
If a game had an enemy compete with you lets say like a racing game, would you need A* for the enemy or can you program it just like normal???
Something like mario kart or an olympic race or even some thing even abstact?
thanks
you probably dont need path finding for a racing game, you could use clues to help the enemies move in the right direction. invisible direction markers on the track, distance from walls, positions of other cars, waypoints, etc.
okay.
what about if it was like 2 racing towards a goal and had objects on the way and had to get items to help in the race.
a 2.5d track race with obstacles and power ups. no cars maybe bikes.
would the same concept apply?
thanks
Check out this video: https://www.youtube.com/watch?v=XbPciCHPdTw (You can skip the first 10 minutes or so)
It talks about making a racing game in unity, but there are some good concepts in there that would apply to your question.
They basically divide the AI into 3 sub-systems: Track Navigation, Local Awareness, and Obstacle Avoidance.
Track Navigation: This subsystem basically controls the general car movement around a track. A good method to use is called Chasing the Rabbit. You basically have a line-follower a set distance in front of the car. This car tries to follow this “rabbit” but can never catch up. The advantage to this is the car is only loosely following the track, which allows the other subsystems to do their jobs. They also talk about having interfaces (basically sections) along the track, which would direct the car in the right direction, and give position information to the game.
Local Awareness: This subsystem is used for things like lane changing. It detects the cars around it to see if it can find a faster route than it is currently on. It also gives the car time to change lanes if it is coming up on a very slow car.
Obstacle Avoidance: This subsystem is used for, you guessed it, avoiding obstacles. There are short range sensors, that can change the car very rapidly for extreme avoidance. There is also a long range sensor that can detect obstacles in the track far ahead so that the car can avoid them.
I would really advise watching the video, as it’s a great resource. These concepts also apply to your ideas, especially the track navigation and obstacle avoidance. You could also reverse the obstacle avoidance and try to make the cars go towards the power ups or shortcuts.
do you mean like an old-school pseudo-3d track? you would just keep a map of the track, and the computer could look around the cars area for obstacles, changing corse depending on how far obstacles are away.