The gist: Traffic tool of the newer CSP needs the 3 files for car's 3d, lod and collider + edit of the contents of the file ".. \extension\lua\tools\csp-traffic-tool\src\simulation\CarsList.lua" in the game's folder.
To give it that the easiest way for preparing the existing cars from "..\content\cars\" is to save the lodB with the textures and the much hated from some 3DSimED3 is a brilliant tool. So, open it, drop into the window the full 3d original. "Ok" to have the temporary folder with the textures.
The goal is to move those textures to the lodB model. So drop the lodB into 3DSimED3
See, no fuss with "*****.ini" and ksEditor. Now export from 3DSimED3 the kn5 model and point it to the "..\extension\lua\tools\csp-traffic-tool\data\" folder in your game.
Then next to that file copy the lodC and the collider. Rename the collider to the specific car's name
Now all that's left is to edit the list of cars in the file ".. \extension\lua\tools\csp-traffic-tool\src\simulation\CarsList.lua". Duplicate in full the code of the first car that comes with the default - "data/bmw_1m.kn5". In the new first instance replace the values after "=" to fit the new car. Be cautious to keep the proper syntax - even one unnecessary empty row or space will cause the Traffic tool to crash (to refuse loading the traffic). So after each adding of a car test the "CarsList.lua" before moving to the next car edit.
Final remarks: I know lodB + lodC is much heavier to render than lodC+lodD but the difference in graphics quality is worth it since in traffic we all get very close to the dummies. With the lodC+lodD I had to increase the distance of the lod switch in the file "TrafficCar.lua" row 245 to
and that gave me a small fps hit anyway. The edit is also necessary because the main kick of having 500+ traffic on a multi-lane at night is in working headlights and stop lights. Speaking of which, the file "..\extension\lua\tools\csp-traffic-tool\src\simulation\TrafficCarFullLOD.lua" holds the values that control the brightness of the lights and with defaults they come too dim. I edited rows 47-50 on mine to
Also in that file row 210 controls the placement of the light cone that points ahead and it is a bit too high. To move it below the bonnet I edited to
Don't forget that the edits of the files in "..\extension\lua\tools\csp-traffic-tool\src\simulation\" are going to be overwritten each time you change CSP version. So if you reached some progress - pack all edited files into a zip and after CSP change use that saved zip to restore your preferred code.
Share your thoughts and suggestions !
To give it that the easiest way for preparing the existing cars from "..\content\cars\" is to save the lodB with the textures and the much hated from some 3DSimED3 is a brilliant tool. So, open it, drop into the window the full 3d original. "Ok" to have the temporary folder with the textures.
The goal is to move those textures to the lodB model. So drop the lodB into 3DSimED3
See, no fuss with "*****.ini" and ksEditor. Now export from 3DSimED3 the kn5 model and point it to the "..\extension\lua\tools\csp-traffic-tool\data\" folder in your game.
Then next to that file copy the lodC and the collider. Rename the collider to the specific car's name
Now all that's left is to edit the list of cars in the file ".. \extension\lua\tools\csp-traffic-tool\src\simulation\CarsList.lua". Duplicate in full the code of the first car that comes with the default - "data/bmw_1m.kn5". In the new first instance replace the values after "=" to fit the new car. Be cautious to keep the proper syntax - even one unnecessary empty row or space will cause the Traffic tool to crash (to refuse loading the traffic). So after each adding of a car test the "CarsList.lua" before moving to the next car edit.
Final remarks: I know lodB + lodC is much heavier to render than lodC+lodD but the difference in graphics quality is worth it since in traffic we all get very close to the dummies. With the lodC+lodD I had to increase the distance of the lod switch in the file "TrafficCar.lua" row 245 to
Code:
if self._distanceSquared < 180^2 ~= (self._fullLOD ~= nil) then
Code:
headlights = SmoothEmissive(modelMain:findMeshes(car.definition.lights.headlights), rgb(190, 190, 190), rgb(0, 0, 0), 0.6, 0),
rear = SmoothEmissive(modelMain:findMeshes(car.definition.lights.rear), rgb(35, 0, 0), rgb(0, 0, 0), 0.6, 0),
brakes = SmoothEmissive(modelMain:findMeshes(car.definition.lights.brakes), rgb(150, 0, 0), rgb(0, 0, 0), 0.6, 0),
rearCombined = SmoothEmissive(modelMain:findMeshes(car.definition.lights.rearCombined), rgb(150, 0, 0), rgb(0, 0, 0), 0.6, 0),
Code:
self._lightSource.position:set(0, 0.8, 0):add(car:getBodyPos()):addScaled(car._dir, 0.8)
Share your thoughts and suggestions !
Last edited: