How to create traffic in Racer?

I've noticed there is a tab in TrackEd called "Traffic" where you can create and customize waypoints. But how to actuaaly create traffic and make it follow those waypoints? It is possible to make the traffic cars accelerate/deccelerate at a certain time-step or at least at certain position?
 
Is Boomer's post there using AI though, or the newer traffic waypoint system?

Iirc there isn't a guide on racer.nl as I looked the other day and didn't find anything... Hmmmm.

I think Stereo knows how so maybe he'll be kind enough to give us a few hints :)


Also we could do with some traffic car assets... anyone fancy modelling a bunch of common cars? Hehe

I wonder if there is a way to have any given car use random colours maybe? Maybe have a random offset in uv in shader and have a body colour texture swatch somehow!?

Obviously if you can load in these meshes to gpu memory its better to add colour variety with instances vs whole new unique cars just to have a different colour. Hmmm.


I put some traffic on a track the other day via tracked but no idea how you even make cars appear on it hehe :)

Dave
 
I think you need to open up the traffic.ini and manually add car entries right now.

It goes like this:
Code:
cars
{
  car0
  {
    car=car_folder
    waypoint=1
  }
}
They start in the track's starting grid rather than at waypoints though, so you need a starting grid with enough entries for the number of traffic you want.
Once the game's started, you can warp them to specific waypoints with console command "traffic warp <car> <waypoint>", like "traffic warp 0 38". By default they'll be on random-roam, and picking up any waypoints they run over, so you have to be careful that if two routes overlap there are no waypoints near the intersection.


Each waypoint does include a velocity in m/s that the car will try to reach, every time it hits a waypoint it change the velocity target.
 
I think you need to open up the traffic.ini and manually add car entries right now.

It goes like this:
Code:
cars
{
  car0
  {
    car=car_folder
    waypoint=1
  }
}
They start in the track's starting grid rather than at waypoints though, so you need a starting grid with enough entries for the number of traffic you want.
Once the game's started, you can warp them to specific waypoints with console command "traffic warp <car> <waypoint>", like "traffic warp 0 38". By default they'll be on random-roam, and picking up any waypoints they run over, so you have to be careful that if two routes overlap there are no waypoints near the intersection.


Each waypoint does include a velocity in m/s that the car will try to reach, every time it hits a waypoint it change the velocity target.



How do I know where the waypoints are. And also that warp thing I don't understand And I dont know how to open console commands! I press shift+~ and nothing happens! It is enabled in Racer.ini too!
 
My console just gives me "did not understand console command traffic warp 0 0" which should in theory move the 0 indexed traffic car to waypoint 0.

Doesn't work with 1 0, or 0 1, or 1 1.

Do I need a nice grid of waypoints? I just have 9 so far that just go forward 3, then split into 3 choices each with one extra after those...


I'm sure I'll get it working though eventually hehe.

Do you need splines or something for it to work on top of?!

Dave
 
My console just gives me "did not understand console command traffic warp 0 0" which should in theory move the 0 indexed traffic car to waypoint 0.

Doesn't work with 1 0, or 0 1, or 1 1.

Do I need a nice grid of waypoints? I just have 9 so far that just go forward 3, then split into 3 choices each with one extra after those...


I'm sure I'll get it working though eventually hehe.

Do you need splines or something for it to work on top of?!

Dave


Same for me. I got console working but the above issue happened :(
 
My console just gives me "did not understand console command traffic warp 0 0" which should in theory move the 0 indexed traffic car to waypoint 0.

Huh, that might just be broken then... I copied it from documentation, and thought I remembered using it, but now I can't get it to work either. "Traffic start #" and "traffic stop #" seem to work.
 
It probably did work, but has since been broken but not spotted?

That does happen so well worth adding to the list of bugs on the release thread. Hopefully when Ruud has free time again he can then fix all these things up :D

Dave
 
Did some digging in Racer.exe's strings to figure out what commands did exist...

The track needs a non-zero number of splines for the traffic to work (which is why the Exeter Rd. AI was being lazy and not moving). As far as I can distinguish it doesn't use them for anything so probably should be considered a bug.

The actual console command to move a car is
car warp <car> <waypoint>

There's also a
route goto <car> <waypoint>
Which instructs traffic to drive directly for ... something. I'm not sure what the <waypoint> is indexed on. Sometimes they work for me, sometimes they don't.

Since some of this stuff is a pain to find information on I'm gonna put up a unified document on my website in a bit.
[edit] http://nmurdoch.ca/racer_traffic.html - haven't got pictures yet, but collected my knowledge of making traffic work.
 
Great work Stereo...

Haha, nice exe snooping there. At least we know the command issue isn't a bug, just wrong documentation :D


Yep, that works here now... now for the looonnggg task of authoring the traffic lines hehe.

Dave
 

Latest News

Online or Offline racing?

  • 100% online racing

    Votes: 84 7.3%
  • 75% online 25% offline

    Votes: 122 10.7%
  • 50% online 50% offline

    Votes: 166 14.5%
  • 25% online 75% offline

    Votes: 319 27.9%
  • 100% offline racing

    Votes: 448 39.2%
  • Something else, explain in comment

    Votes: 4 0.3%
Back
Top