Car Traffic AI.

Discuss game development design and post your game ideas

Post » Thu Mar 05, 2015 4:31 am

Hi........I am making a car race game so in my game there will be a traffic in which cars and other vehicles will be there and they act as AI in the game. All the vehicles has to follow the path and if one stops rest in the back has to stop and after stopping if one vehicle takes reverse the rest in the back also has to take reverse with equal distance between them. I tried behaviors like Path finding and Line of sight to achieve this and also the functions but couldn't achieve it. Can anyone PLEASE HELP me with this PLEASE?
B
6
Posts: 15
Reputation: 292

Post » Thu Mar 05, 2015 8:51 am

There should be some kind of RTS example in Construct itself, a top downer with tanks.

There are things like this (not overlapping) inside already, that should be a start!
Image
Check out our start-up and configure your own helmet in true 3D.
B
42
S
11
G
11
Posts: 1,154
Reputation: 9,893

Post » Thu Mar 05, 2015 1:14 pm

Yea but I am using free version of construct 2. the event sheet is limited I couldn't access the event sheet of that example.
B
6
Posts: 15
Reputation: 292

Post » Thu Mar 05, 2015 1:34 pm

Can You please help me with some other thing please?
B
6
Posts: 15
Reputation: 292

Post » Thu Mar 05, 2015 3:32 pm

Honestly I´d recommend to buy the full version soon if you want to go on with this, cause you will hit the 100 event limit very very fast.
I´m not one of the cracks here regarding to programmin, but I´m pretty sure that even what you want (realistic traffic) + player movement will hit the limit.If not, then feel free to correct me anybody :)
Image
Check out our start-up and configure your own helmet in true 3D.
B
42
S
11
G
11
Posts: 1,154
Reputation: 9,893

Post » Thu Mar 05, 2015 4:38 pm

Is there any other way ?
B
6
Posts: 15
Reputation: 292

Post » Thu Mar 05, 2015 5:16 pm

I might suggest some kind of sensor sprite out in front of each car to help you pick out the car in front. Once you have the location of the nearest car in front, you can check the distance, and speed up if it gets too far away, slow down or reverse if it gets too close. You can compare the angle to the car in front to see if you need to turn left or right. You can get a number of interesting swarm behaviors with variations on this algorithm.

Edit: http://en.wikipedia.org/wiki/Boids. I think there may be an implementation somewhere around here....
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Thu Mar 05, 2015 5:20 pm

That's quite interesting but can You please give me a clear cut by an example. Please.?
B
6
Posts: 15
Reputation: 292


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests