Hey, hey, I finally got some instruction from Johnathan about how this whole thing works. It does a lot more than what I got instruction for, but if you just want some traffic on a simple road, here's what everything means.
Concerning the cars.lst file that I posted earlier:
MinPathType [number]
The minimum path type which these traffic objects should be spawned on (as specified in the path editor).
MaxPathType [number]
The maximum path type which these traffic objects should be spawned on.
MinDistance [distance]
The minimum distance from the camera at which the object can be spawned.
MaxDistance [distance]
The maximum distance from the camera at which the object can be spawned. Any objects going beyond this distance will be recycled.
AverageSpeed [speed]
The average velocity of the objects after being spawned (meters/second). If the camera is moving faster than this speed, objects moving away from the camera will also be spawned, not only ones moving towards the camera (such as in the case of driving fast down a road, you want to be able to catch up to traffic which is going the same direction but slower).
MaxVisible [number]
This is the absolute maximum number of these objects that can be active at any one time.
OrientTerrain [0 or 1]
If set to 1, the objects when spawned will be oriented to face along the vertical path orientation so that it sits oriented with the ground (ie. placing a post box on a hill will cause it to lean accordingly). If set to 0, the objects will be spawned completely upright, with no regard for the slope of the terrain (ie. a street lamp always stands straight).
LoadObject [probability] [load count] [object file]
There can be multiple of these lines in the file. The probability value specifies how likely it is that this object will be spawned in comparison to all the others (ie. if one object has a probability of 2 and another a probability of 1, then it will show up twice as often compared to the other object). "Load count" specifies the maximum copies of the specified object file to load into memory. Spawned objects are recycled, however each simultaneously visible object must be unique so this in essence specifies the maximum number of this object that can be visible at any one time. Setting this value appropriately is important because if you specify too many then your application can run out of memory, but too few and you may not have enough objects to populate your world as desired.
Then as for how to call the cars.lst file, I did it from the main.gsl script using these commands:
Once you have your traffic list file prepared, it can be loaded in the game by calling:
GetGameManager().GetWorld().LoadTrafficList( "cars.lst");
The traffic manager will automatically start working at that point, however it will not spawn any objects within the minimum radius. So in order to pre-populate an area, after you have the camera positioned call:
GetGameManager().GetWorld().PopulateTraffic();
PopulateTraffic can be called multiple times if the desired density is not reached within a single call.
Works like a charm. Only thing I had to do was decrease the PathTurnSharpness variable in each car's opr file so they'd travel down the road without worming back and forth within their lane.
You do, of course, have to have a path on your road. If anyone needs directions on how to do that just let me know, but it's an extremely easy thing to do within the Edit Road menus.
Hope that helps some of you!
