Car AI for Traffic

Hello!

Do anyone here know how to make an efficient traffic for racing game in BGE, just as how it’s in Need for Speed?

The way it won’t take much performance. I have been trying many option, but all seem to use a lot of frame drop especially using radar, near or even by making a sensor to run the python script in true pulse.

Anyone could help me with a simple and efficient way to achieve good car ai?

Thank you.

In Need For Speed there are 2 different AI types : police cars and civilians who get in the way but stay calmly at same speed. Which one are you trying to emulate ?

The car traffic AI. Since it’s like spawning a lot of cars at least where the player car is in the scene.

Or do you know how to make an AI police type chase car? It’ll be incredible to make such AI behaviour.

I think it’s just somehow complex, though I’m not very good at AI stuff.

I suggest you first set down the basic concepts that will make the core of your game.

Here’s an interesting article to start with :

Break down your ideas into smaller concepts, then try to break them into simpler components again, until the point where you feel confident to try to make some draft of that component. I can not help you much more than this, but I’m sure many folks on this forum will help you with more specific issues.

In upbge I’m constantly hitting walls, things not working as described (if described haha) in the documentation, or deprecated / not yet implemented, etc, and I have to find workarounds all the time.

1 Like

It’s still quite not as I wanted or meant.

Alright. I made an example using steering and navmesh. Not so efficient by the way, but could pretty much deliver some sort of traffic simulation.

Perhaps someone could improve it. BGE,

traffic_ai.blend (752.3 KB)