Can anyone give me some ideas about how to make the traffic AI like in Traffic Rider Game

1 Answer

1

Behaviour Tree is a generic AI tool to describe how AIs behave and react. Have a look at Panda BT (www.pandabehaviour.com)(I’m the author), it’s a scripting framework based on Behaviour Tree.

Once you’ve learn the basics, it’s rather intuitive to write your AIs. Let’s say the player is riding in the wrong direction and you want the counter-coming AIs to react according to the distance to the player:

  • The player is far, do some beam signals.
  • The player is in mid-range, do some horn signals.
  • The player is close, try to avoid him by turning left or right randomly.

Then, this behaviour would be describe in a BT script as follow:

fallback
	sequence
		PlayerIsFar
			DoBeam
	sequence
		PlayerIsInMidRange
			DoHorn
	sequence
		PlayerIsClose
			random
				TurnLeft
				TurnRight

If you have any question about using this tool or about Behaviour Tree in general, you’re welcome on this forum thread.

any c# reference or general idea ... ?