Forums Gallery Downloads LOGIN |REGISTER

Vehicle avoidance...traffic sim

Gameplay Setup, SP/MP Logic, Audio Setup, AI Logic, Entity Usage, etc.


 

GreyMerkin
Just getting started
Just getting started
 
Posts: 7
Member since: 16.03.2012, 20:01
Likes: 0

Vehicle avoidance...traffic sim

Postby GreyMerkin » 11.05.2012, 23:13

I have a series of paths that I have created with vehicles following them, but at intersections where the vehicles switch to different paths the vehicles just end up wrecking into eachother. Is there a method for vehicle to vehicle avoidance?

Thanks
User avatar
Tracer
News Posters
News Posters
 
Posts: 3077
Member since: 20.01.2009, 02:39
Location: Glorious Texas
Likes: 280

Re: Vehicle avoidance...traffic sim

Postby Tracer » 23.05.2012, 15:24

There are 2 fairly easy ways to do this.
1) you can use |Time:Delay| nodes to offset the crossings so they will miss each other. However this becomes more complex with each successive vehicle.
2) Use a Proximity node (targeted at a tagpoint) that forces a check each time the vehicle arrives at an intersection.
Put the tagpoint in the center, and set it so it will detect when a vehicle is close enough that it is inside the intersection. If the proximity node returns positive (vehicle in intersection) The vehicle will halt and wait for a false response to continue.
I prefer using the second method, as it hardly ever fails.
Need a chuckle? Click here for CryDev Humor
Image
No support via PM
cwright
Producer
Producer
 
Posts: 2314
Member since: 11.08.2004, 12:38
Likes: 76

Re: Vehicle avoidance...traffic sim

Postby cwright » 25.05.2012, 11:53

Traffic avoidance is a big problem for me, too. If several vehicles are following the same path they simply bang into each other. They seem to have no knowledge of other nearby vehicles. I think in this respect Cry Engine 1 (Far Cry) was actually superior.
So, is it possible to modify the actual AI behaviour of vehicles so that they don't crash into each other?
Chris
User avatar
Tracer
News Posters
News Posters
 
Posts: 3077
Member since: 20.01.2009, 02:39
Location: Glorious Texas
Likes: 280

Re: Vehicle avoidance...traffic sim

Postby Tracer » 26.05.2012, 02:09

Editor-side, No.
With Flowgraphs it is possible as i described above, but realtime vehicle avoidance detection would require LUA coding, which is not my specialty.
Need a chuckle? Click here for CryDev Humor
Image
No support via PM
cwright
Producer
Producer
 
Posts: 2314
Member since: 11.08.2004, 12:38
Likes: 76

Re: Vehicle avoidance...traffic sim

Postby cwright » 26.05.2012, 12:26

"With Flowgraphs it is possible as i described above, but realtime vehicle avoidance detection would require LUA coding, which is not my specialty."

Funnily enough, that's precisely what I'll be doing probably later this year. I've created a complete flight simulator programmed with Lua. When taxiing, the aircraft can detect other aircraft in front or to the side and they will stop and wait in order to avoid collisions. I intend to use similar techniques for wheeled vehicles and they will have proper traffic avoidance etc.
But I'm amazed that the standard AI don't seem to have any traffic avoidance at all....
Best regards,
Chris
User avatar
Tracer
News Posters
News Posters
 
Posts: 3077
Member since: 20.01.2009, 02:39
Location: Glorious Texas
Likes: 280

Re: Vehicle avoidance...traffic sim

Postby Tracer » 28.05.2012, 23:09

Realtime collision detection would have been nice, but I'm guessing it was more efficient to leave it out, since the feature was never required in-game- similar to the lack of working headlights in C2, and the elimination of the Frozen material layer.
Need a chuckle? Click here for CryDev Humor
Image
No support via PM


 
Connect and collaborate with CRYENGINE developers in the official Forums.
Visit the Gallery to share what you have created and be inspired by what others are creating with CRYENGINE.
Community