Traffic was added to Racer rather unceremoniously, and without any good documentation. Quite a few features exist but it's hard to figure out how to use them. So I've written this page to help explain and keep track of how to interact with it.
The console commands are listed incorrectly on the racer.nl console documentation. The following seem to work:
Quick start: F8 gets you to the traffic editing page. Once there, shift+left click to place the cursor. Use ctrl+n to insert a waypoint sitting on its own. When you have a waypoint selected, use ctrl+a to add a 'forward' waypoint the car will go to after the one you've selected. Alternating placing the cursor with shift+click and placing forward waypoints with ctrl+a is the quickest way to lay out a traffic route. Once you've looped it around, use 'set forward waypoint' to enter the number of the start of the loop.
Personally I've been using version 0.8.38 TrackEd because the text labels work. Quite a few versions followed that had white on white buttons which is a pain.
Buttons available in TrackEd:
Velocity (ctrl+V): set selected waypoint's speed in m/s | Remove selected waypoint (ctrl+R): delete the waypoint. |
Start new line with selection (ctrl+N): add a new waypoint at the cursor, not linked to anything. | Select waypoint (ctrl+S): pop up a dialog to enter the index of a waypoint. |
Add forward waypoint (ctrl+A): add a waypoint at the cursor, linked 'forward' from the currently selected one. | Set forward waypoint: pop up a dialog to set the waypoint that is 'forward' of the selected one. |
Add leftward waypoint: add a waypoint at the cursor, linked 'left' from the currently selected one. | Set leftward waypoint: pop up a dialog to set the waypoint that is 'left' of the selected one. |
Add rightward waypoint: add a waypoint at the cursor, linked 'right' from the currently selected one. | Set rightward waypoint: pop up a dialog to set the waypoint that is 'right' of the selected one. |
Move selected waypoint (ctrl+M): move the selected waypoint to the cursor, retaining links. | Set default velocity: when waypoints are added, change the speed they will be at. |
If the track won't load, check that all the car folders in traffic.ini are correctly named. When it fails to load one it quits back to the menu.
If the traffic vehicles don't all appear, make sure the track has enough starting positions for them. Traffic shares the same starting positions as player vehicles and AI.
If the traffic vehicles don't move, check that the track has splines. The traffic doesn't use them but it does require they exist.
If the traffic is changing direction unexpectedly, look for waypoints that are overlapping the route you expect it to take. By default the traffic vehicles will change their mind about which direction to go if they find a new node.
If the traffic can't stop when you want it to, tell it to slow down earlier. It doesn't predict the speed it'll want at all.
If the traffic are running into each other on corners or intersections, it's because they're only looking straight in front of them for obstacles. Can try increasing turn radiuses.
cars { car0 { car=[car folder] waypoint=[initial waypoint] } car1 { ... } ... } waypoints { count=[number of waypoints] waypoint0 { pos=[x y z] forward=[waypoint index] left=[waypoint index] right=[waypoint index] flags=0 velocity=[target speed] } ... }
Car folder is specified here - if the car doesn't exist then the game will pop back to the menu without any visible error message.
Initial waypoint is the one the car is instructed to drive towards. By default, it will change its mind if it hits another waypoint on the way there.
Position is in world coordinates.
Waypoint index is the waypoint0 zero in this example. There can be 3 specified; by default it will pick from these randomly. Use -1 to specify none in that direction.
flags, I don't know of any uses yet.
Target speed is in m/s, and is the speed the car will attempt to achieve after it passes the waypoint. If it changes too suddenly the car will skid slow down.
Last updated June 17, 2013