But are those cars smart enough to actually know where other objects are or are they so focused on ramming you that they just keep accelerating into walls and stuff? If it'd work as you guys (and I) want it to work it would kick infinite amount of *rse! (Woho, first post xD)
Sadly they're not aware of any obstacles; they'll just crash into walls. They are smart enough to know when they're stuck and to back up, though.
If I have a vast open map, and I swerved or turned around can the AI car also swerve or U-turn? - - - Updated - - - Also, could you set a force field zone around the corners of buildings or objects that causes the car to know to avoid said objects? You know, what you are giving us is already sooo much, and even though there are very many features I would add. I will be more than ecstatic with whatever you bring me.
Ain't that the truth! Can't wait to see an AI pit gabe To Garebear: I'm guessing they probably can. I wonder if they can do hand-brake spins
Yep, they know when you're directly behind them (and too far away to back into) and stop and turn around. Theoretically possible. Though it'd be more like driving by feel rather than preemptively avoiding obstacles.
It would be a much better idea to have something like this. Roads should use splines like most games and collision models could define the AI obstacles.
If your car were to be driving off road in the middle of the woods where there are no woods, couldn't you code a negitive to negitive magnetic force to keep those cars from hitting the trees?
Will there be an event in the career where you have to get away from a car with this so called murderous AI implented or something? For people wondering, it's been mentioned a career mode is planned in this thread.
There's a way to code AI that I happen to love but I've only seen it in a 2D racing game a friend coded and ever since I've been trying to replicate it. The AI used a flow field to navigate, and everything with collision caused the flow field to direct away from it. The way he did it was that anything with collision such as a vehicle or cone or wall, and the edges of a defined road channeled the flow field into one direction, or if the object was small enough the flow field was allowed to diverge around the object then merge again on the other side. Think of it like how water would flow around an obstacle while being directed through a channel. My friend made the assumption that the AI behaved like a human and drove towards where it was 'looking'. From that assumption things got interesting. So there's this object in-front of the car, an entity that keeps a distance in-front of the car based on the car's speed. The faster the car, the further away the entity kept in a kind of logarithmic scale so there would be a kind of maximum distance that the AI could 'see' and plan for. This object acted like the eyesight of the driver and hunted out a path through the flow field vectors. So the entity was busy path finding and the car was chasing it. Together we had a system where the two things worked in tandem to allow the car to effectively see and navigate through an obstacle course. I don't know what you plan to use, probably something much more efficient but my friend's little experiment there is one of the reasons I aught to learn to code more complex things.
Recursive contour plotting? Sounds like what you're saying. I know one path finding method is A*, and you can have weighted paths there, so a path near a cone could be medium weighted, grass heavy and road lightest. Other one I know is using a "sensor" or ray-tracing and taking the distance to a object, and a cone could have a smaller effect, using more sensors is obviously more accurate. I'm not too knowledgeable with AI, but the last described method makes for something cool with some walking AI: http://www.youtube.com/watch?feature=player_embedded&v=9Etv7-3tFXM
I think recursive contour plotting is something else entirely. What I'm on about usually ends up being visualized with a lot of little arrows. (imported from here)
That's actually what it does, the car wants to stay in the hottest/highest path. The base of it is contour plotting, recursive is for generating it realtime. like this: It would give the same effect, both methods are pretty costy though.
I just had an idea. How about pursuit mode? You start with a vehicle, and there's one police cruiser chasing you, after a while it calls for backup. When you least expect, you look behind yourself and there are 15 - 20 police cars, a helicopter, police vans, all after you with sirens and lights on. When you go back to normal vision, there are spike strips covering the whole road, and you try to dodge them, so you go off road sliding sideways through the dirt with no control over the car, brake and roll over 8 to 10 times coming to a terrible stop. Your car is totaled, the engine is smoking, the tires are shredded into pieces, and you're busted.
I hope there is a separate gamemode for it, not in the career though. Something like NFS Most wanted.
Maybe even not having the cars know where they are supposed to go, but having them know where NOT to go.