Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase the randomness of traffic flow? #263

Open
yuyuyu223 opened this issue Apr 12, 2024 · 1 comment
Open

How to increase the randomness of traffic flow? #263

yuyuyu223 opened this issue Apr 12, 2024 · 1 comment

Comments

@yuyuyu223
Copy link

I used the following code to generate traffic flow:

beamng.traffic.spawn(max_amount=5)

But the position of each traffic vehicle is almost fixed. I want to know how to generate a richer traffic flow state.

image

image

Is there an interface for inputting random seeds?

In addition, how to define the conditions for generating traffic flow, such as within a certain vicinity of an ego vehicle?

@aivora-beamng
Copy link
Contributor

Hi,
to teleport the traffic away from the player, you can use the beamng.traffic.reset() function.

AFAIK, the parameters for generating traffic flow are not exposed, but you can check the implementation of BeamNG.tech\lua\ge\extensions\gameplay\traffic.lua and (possibly) edit it according to your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants