Resource icon

Misc New Traffic for Shutoko Revival Project 2021-08-28

Login or Register an account to download this content
Is it possible you could explain what each of these settings do?

SPAWN_MIN_DISTANCE_TO_PLAYER=a, b
SPAWN_DISTANCE=c, d
SPAWN_RANGE=e, f
SPAWN_DESPAWN=g, h
I'm not on the team developing that part (and maybe Ilja is the whole team for the AI flood) but here's what I know by now:
"SPAWN_MIN_DISTANCE_TO_PLAYER=a, b" determines minimum distance in meters ahead (a) or behind (b) of the current player's position on the line where the AI should spawn.
"SPAWN_DISTANCE=c, d" determines the max distance in meters ahead (c) or behind (d) of the current player's position on the line.
"SPAWN_RANGE=e, f" is partly substitute for the old "DISTANCE_FROM_AI" and influences the distance in meters between AI. I'm not sure if (e) and (f) are ahead or behind of the current player's position on the line or it's the individual AI's current position relative to other AI's. So leave editing of (e) and (f) for last. It also influences how often the spawn occurs in the opposite direction. Bigger range - more chance the AI will come the other way.
"SPAWN_DESPAWN=g, h" influences the max distance in meters ahead (g) or behind (h) of the current player's position on the line after which the AI gets teleported to another location. That is the first thing to edit when you change the number of AI cars for the session. Shorter "h" if you intend to do a lot of overtaking or shorter "g" if you want to watch the AI fly-by.

All that said, the SRP roads are very difficult to cover with AI flood that will work with 100% immersion and no popping up of cars in the line of sight. On one hand the visibility in clear weather is kilometers ahead on Wangan and on the other you often move at speed upwards of 300 kph. So if you want to eliminate the AI ghosts best option is to select all AI as fast as your weapon and move with the pack.
 
happens both in VR and in Single screen mode too.
I have a 5600x CPU / 6800xt GPU so it is not an underpowered system
It's the game's engine that determines how those parts are used and it feeds the CPU with physics calculations that cannot be distributed on all cores. So that Ryzen 5 has to deal with all of your car's physics, FFB, all of the AI's car's physics and all of the track's physics (defined surfaces and colliders) in a single 3.7 GHz core without hyper-thread leaving all other 5 cores doing other calculations for the 3d scene. That's why if you look at Task Manager you will see less than 50% CPU load while the game is almost non-responsive. There is a standard app in the game - "Render stats" which can show you how the game engine is doing with the "PHY=xx%" and when that goes over 100% you can see the problems immediately.
Using the restricted lines for traffic in Assetto is the way to limit the collisions and thus the chance occurrences of "PHY" overload of the CPU. And if the guys who make SRP keep their promise - the next update will bring back some of the performance lost after 0.8. But as far as physics is concerned they will struggle if the "physical_mesh.kn5" remains encrypted. That decrypting phase adds 100 % overhead compared with 0.8 which runs for me @ "PHY 60%" with the same group of cars and AI flood settings. So despite using 3570k i5 @4 GHz I have to limit the number of AI cars with the newer SRP to avoid CPU overload.
 
Last edited:

Thanks to Alekabul's reply I found a sweet spot for the AI Flood settings for my setup which means I don't get any annoying AI cars popping into view too close to me. Weirdly in the video I made I see an occassional single frame glitch which might be a car trying to pop up or maybe it is just trying to record the video at 4K but didn't see that in my VR headset.

In this video I am using 13 traffic vehicles on the recommended 'Less Restricted' logic and a custom AI Flood Behaviour file which is shown at the end of the video

This absolutely changes SRP with traffic from annoying to a delight. Congratulations Alekabul
 
an occassional single frame glitch which might be a car trying to pop up
I often use iTubeGo to cache YT video and watch it later with better players so - yes, those glimpses that flash before the player are AI cars trying to spawn. That maybe will be corrected in newer CSP as the AI flood evolves further. But even as it is now it offers hugely more fun than before v 0.1.75.

For SRP maybe "PUSH_SPEED=180" or faster will fare better than the default "PUSH_SPEED=80" because newly spawned AI are quick to apply the brakes but not so much on the acceleration. Upon closer inspection of "..\AssettoCorsa\extension\config\new_behaviour.ini" I noticed that it is possible to tailor the settings for tracks individually following the example of "[TRACK_simtraxx_transfagarasan_cl]".
Adding in "C:\Users\*******\Documents\Assetto Corsa\cfg\extension\new_behaviour.ini"

Code:
[TRACK_shuto_revival_project_beta]
AI_FLOOD_PUSH_FORCE=150000
AI_FLOOD_Y_OFFSET=-0.35
AI_FLOOD_MIN_DISTANCE_TO_PLAYER=290, 120
AI_FLOOD_DISTANCE=360, 180
AI_FLOOD_RANGE=250, 130
AI_FLOOD_DESPAWN=400, 190
AI_FLOOD_PUSH_SPEED=180

should produce the desired effect but only on SRP and leave the defaults working on the other tracks. Type of "set it and forget it" editing that some find more convenient.
 
Last edited:
I often use iTubeGo to cache YT video and watch it later with better players so - yes, those glimpses that flash before the player are AI cars trying to spawn. That maybe will be corrected in newer CSP as the AI flood evolves further. But even as it is now it offers hugely more fun than before v 0.1.75.

For SRP maybe "PUSH_SPEED=180" or faster will fare better than the default "PUSH_SPEED=80" because newly spawned AI are quick to apply the brakes but not so much on the acceleration. Upon closer inspection of "..\AssettoCorsa\extension\config\new_behaviour.ini" I noticed that it is possible to tailor the settings for tracks individually following the example of "[TRACK_simtraxx_transfagarasan_cl]". Adding at the end
Code:
[TRACK_shuto_revival_project_beta]
AI_FLOOD_PUSH_FORCE=150000
AI_FLOOD_Y_OFFSET=-0.35
AI_FLOOD_MIN_DISTANCE_TO_PLAYER=290, 120
AI_FLOOD_DISTANCE=360, 180
AI_FLOOD_RANGE=250, 130
AI_FLOOD_DESPAWN=400, 190
AI_FLOOD_PUSH_SPEED=180

should produce the same effect as editing the "..C:\Users\*******\Documents\Assetto Corsa\cfg\extension\new_behaviour.ini" but only on SRP and leave the defaults working on the other tracks.
Great find, I want different behaviour on different tracks. I will use this method
 
Great find, I want different behaviour on different tracks. I will use this method
I edited the post slightly and I'm testing now by pasting that code into the ini that doesn't get replaced on every CSP update - the one in the user's path. Also important - name of the track's folder can vary. I.e. "shuto_revival_project_beta_ptb" like I have it.
 
Last edited:
Yes, confirmed!
Adding in "C:\Users\*******\Documents\Assetto Corsa\cfg\extension\new_behaviour.ini"

Code:
Code:
[TRACK_shuto_revival_project_beta]
AI_FLOOD_PUSH_FORCE=150000
AI_FLOOD_Y_OFFSET=-0.35
AI_FLOOD_MIN_DISTANCE_TO_PLAYER=290, 120
AI_FLOOD_DISTANCE=360, 180
AI_FLOOD_RANGE=250, 130
AI_FLOOD_DESPAWN=400, 190
AI_FLOOD_PUSH_SPEED=180

produces the desired effect only on SRP and leaves the defaults working on the other tracks. So that way any track is possible to get it's exact AI flood settings dialed in and remain despite CSP overwriting the files in game's folder upon update. Just for clarity I'm adding a remark

;13 AI cars

after the first row.
 
Was just wondering do you know if ballast and restrictor work on AI traffic? I tested to see if I could make specific cars slower than others but it appears to not have any effect when I inputted some numbers
k1TtvJB[1].png
 
Last edited:
how do i make the traffic behave like actual traffic atm there all just in one road and only take the first left exit they never go right?
Sorry buddy, Assetto is a long way away from ever matching GTA, TDU and BeamNG for traffic. The way AI works for offline gaming here is by strict following a pre-recorded route. The most someone can do is crisscross the recorded line but still it remains a hard limitation.
 
if ballast and restrictor work on AI traffic?
I think they do. I don't usually dig that deep before traffic session as my main goal is to unwind and focus on other stuff while driving. But I tried these options few times and it seems that "restrictor" is the more effective way to slow down some wild AI on SRP. Generally the difference between the two is - bigger restrictor=less horse power for top speed, bigger ballast=slower speed in corners. Ballast is in kg, restrictor is explained with an equation. Simple Excel calculator attached as .xls table.

Instead of tweaking each group of AI my preferred way of calming the settings for the traffic session is "Strength 90 %" and "Aggression 1 %". Then if you switch to some AI car in replay and have "Pedals" app on screen you can see the AI never exceeds 90 % on the throttle. If you set "Strength 80 %" - no more than 80% throttle, and so on.
 

Attachments

  • restrictor value.xls
    28.5 KB · Views: 128
  • Clipboard02.jpg
    Clipboard02.jpg
    256.4 KB · Views: 198
  • Clipboard03.jpg
    Clipboard03.jpg
    477.4 KB · Views: 209
  • Clipboard04.jpg
    Clipboard04.jpg
    253.1 KB · Views: 157
  • Clipboard05.jpg
    Clipboard05.jpg
    358.9 KB · Views: 228
Last edited:
I think they do. I don't usually dig that deep before traffic session as my main goal is to unwind and focus on other stuff while driving. But I tried these options few times and it seems that "restrictor" is the more effective way to slow down some wild AI on SRP. Generally the difference between the two is - bigger restrictor=less horse power for top speed, bigger ballast=slower speed in corners. Ballast is in kg, restrictor is explained with an equation. Simple Excel calculator attached as .xls table.

Instead of tweaking each group of AI my preferred way of calming the settings for the traffic session is "Strength 90 %" and "Aggression 1 %".
Quite insightful, cheers mate. Yeah I've just been tinkering around a bit with other settings at the moment as I'm just seeing if I can push things a bit further by trying to simulate some AI cars going extremely fast(300+km/h) that are weaving through other AI traffic cars that are travelling at much slower speeds(like around 100km/h), but like you said in a previous post it's quite difficult with the limitations in Assetto Corsa.
 
weaving through other AI traffic cars
Only place on SRP where that can be achieved is Wangan fast lanes, Mirai, Shibuya and Yoyogi where the lanes are free for overtaking but luck plays a big part in it. When the group has a very big difference in power/weight then the fast cars show some interesting moves. Almost like in the movies. And the Assetto AI is clever enough to avoid ramming some slow moving traffic so there is a good foundation for a 300 kph slalom. So to designate which would be the slow cars you may enter some big restrictors that will leave them with ~ peak 100 hp for commuting. Also important - some crappy mod data can have ~0 aero drag and that "car" has high top speed even with 100 bhp. So when you test settings use official cars first and when confident - add the rest.
Attached below are some values for the Kunos cars.
 

Attachments

  • 100 bhp - Copy.txt
    2.6 KB · Views: 117
Last edited:
bongady said:
I tried this today and it works great until all the cars stop dead including mine but smoke is pouring off the tyres.
Anyone any ideas?
Using CSP 0.1.76-preview92

Not depending on CSP version that happens when the CPU is overloaded with physics calculations. Those are running in a single thread so if you look at Task Manager you will see CPU load less than maximum but the game is lagging severely. To solve this if waiting for the AI to calm down is not an option you need either to press "Esc" - wait for the menu and restart the session or use "Alt+F4" to end the session and load again. The glitch happens when AI tries to use a car that is less prepared - problems with physics and/or the ai.ini script in particular. Such cars tend to cause collisions and when that happens even without pile-up it affects all cars and the smoking tires with CSP are early sign of such problem. If you are comfortable with editing the cars physics you can solve the problem after pinpointing the culprit and correcting the errors in the scripts.
Recently I dug deeper into the game's "scripts of old" and found some remarks from Kunos that made me consider a specific edit.
In "..\sdk\editor\system\cfg\assetto_corsa.ini" there's this
Code:
[THREADING]
USE_TIMER_PROCESS=-1    ; -1=Automatic, no timer process for CPU with more than 2 cores, timer process for dual cores. 0=Always off. 1=Always on.
SET_THREAD_AFFINITY_MASK=0 ; 0=Windows scheduler will decide where to run the threads. 1=Main thread assigned to Core0, physics thread assigned to Core1


[PHYSICS_THREADING]
THREADS=-1                ; -1 = automatic , 0 = disabled , 1...N number of threads dedicated to physics
While that is a script that affects only the "..\sdk\editor\ksEditor.exe" application there is an equivalent for the "acs.exe" and it is
"..\system\cfg\assetto_corsa.ini". So to make the game serve more than one thread for the physics obviously it needs to change from "THREADS=-1" to something better. And taking into account that "SET_THREAD_AFFINITY_MASK=0 ; 0=Windows scheduler will decide where to run the threads. 1=Main thread assigned to Core0, physics thread assigned to Core1" I deduced that for my 4 core CPU I can use "THREADS=3" to make the physics distributed more evenly and without additional queuing. I'm happy to report that such editing gives me a considerable boost that i use for adding more cars in the traffic. With the edited "..\system\cfg\assetto_corsa.ini" the dips in performance are not only rarer but last shorter - a sign that multi-core operation is in effect.
 
Last edited:
Recently I dug deeper into the game's "scripts of old" and found some remarks from Kunos that made me consider a specific edit. In "..\sdk\editor\system\cfg\assetto_corsa.ini" there's this
Code:
[THREADING]
USE_TIMER_PROCESS=-1    ; -1=Automatic, no timer process for CPU with more than 2 cores, timer process for dual cores. 0=Always off. 1=Always on.
SET_THREAD_AFFINITY_MASK=0 ; 0=Windows scheduler will decide where to run the threads. 1=Main thread assigned to Core0, physics thread assigned to Core1


[PHYSICS_THREADING]
THREADS=-1                ; -1 = automatic , 0 = disabled , 1...N number of threads dedicated to physics
While that is a script that affects only the "..\sdk\editor\ksEditor.exe" application there is an equivalent for the "acs.exe" and it is
"..\system\cfg\assetto_corsa.ini". So to make the game serve more than one thread for the physics obviously it needs to change from "THREADS=-1" to something better. And taking into account that "SET_THREAD_AFFINITY_MASK=0 ; 0=Windows scheduler will decide where to run the threads. 1=Main thread assigned to Core0, physics thread assigned to Core1" I deduced that for my 4 core CPU I can use "THREADS=3" to make the physics distributed more evenly and without additional queuing. I'm happy to report that such editing gives me a considerable boost that i use for adding more cars in the traffic. With the edited "..\system\cfg\assetto_corsa.ini" the dips in performance are not only rarer but last shorter - a sign that multi-core operation is in effect.
So do I only have to add
Code:
[PHYSICS_THREADING]
THREADS=3
to ..\system\cfg\assetto_corsa.ini

I tend to be GPU limited but there are some occasions when I have 40+ cars I can be CPU limited so I might give this a go.
 
So do I only have to add
Code:
[PHYSICS_THREADING]
THREADS=3
to ..\system\cfg\assetto_corsa.ini

I tend to be GPU limited but there are some occasions when I have 40+ cars I can be CPU limited so I might give this a go.
No adding because you will see it already is there. Just change "THREADS=-1" to "THREADS=X" and for your 5600x Ryzen the "X" threads could be 11 or 5 depending if the Hyperthread is on or off. I can't vouch for the benefit of running physics threads on logical cores versus only on physical cores. It's up to you to find if "THREADS=11" is better than "THREADS=5" in your case. It will become apparent as soon as you add more cars on SRP. The "CPU bottleneck" is not in a classical sense in this context but anything that spreads the physics load is better than the default.
 
Last edited:
No adding because you will see it already is there. Just change "THREADS=-1" to "THREADS=X" and for your 5600x Ryzen the "X" threads could be 11 or 5 depending if the Hyperthread is on or off. I can't vouch for the benefit of running physics threads on logical cores versus only on physical cores. It's up to you to find if "THREADS=11" is better than "THREADS=5" in your case. It will become apparent as soon as you add more cars on SRP. The "CPU bottleneck" is not in a classical sense in this context but anything that spreads the physics load is better than the default.
I tried editting this file :-
C:\Program Files (x86)\Steam\steamapps\common\assettocorsa\system\cfg\asseto_corsa.ini

and it has these settings

[THREADING]
USE_TIMER_PROCESS=-1
SET_THREAD_AFFINITY_MASK=0

[PHYSICS_THREADING]
THREADS=-1 (or 5 or 11)

I've just tried this out and with my CPU it doesn't give me any improvement. Infact with THREADS=-1 I seem to get 1ms advantage over THREADS=5 or 11.

In my VR headset I reduced resolution to 76% which is 2752x2688 per eye so the GPU didn't limit frame time.

First up I tried THREADS=11 and set cars to the max of 52. I got only 30fps so dropped down in steps until I could maintain 60fps for my headset, where CPU time has to be 16ms max. I found that with 18 cars I could maintain that so did the test at that level. Changing threads from 11 to 5 to -1 saw little difference, indeed set to -1 was the best outcome.
th-1tr18.jpg
th5tr18.jpg
th11tr18.jpg

When I had 52 cars I did get CPU utilisation up to 60% but the frame time was too slow.

I also tried in flat screen rather than VR. Set to 1080p, I set the traffic to 40 and checked THREADS=-1 versus 5
th-1tr40.jpg

above image should read - THREADS:-1 Traffic: 40
th5tr40.jpg


Again basically no change between them

Then I just tried 52 cars and it managed that too although when I had more than say 30 visible cars on the screen it lagged a bit.
th-1tr52.jpg


So for my setup changing the thread setting has no improvement.

CPU 5600X - GPU 6800XT - Reverb G2 VR Headset
 
Last edited:
tried 52 cars and it managed that too although when I had more than say 30 visible cars on the screen it lagged a bit.
What layout of SRP is that? Tatsumi is 40 single (can spawn 80 with edit of "pitboxes" in "..\content\tracks\shuto_revival_project_beta\ui\tatsumi_pa\ui_track.json"), Shibaura is 32 (or 64 with edit). The most problematic is loading in Tatsumi and going all the way on Bayshore. There my top effort yields 18 cars in the flood before game starts lagging. On all other parts of the course the PHY load is way less. I assume that has something to do with large number of track objects with physics and unnecessary complexity of the mesh in that part of SRP. Can't edit and try out fixes on the encrypted mesh so I 'll wait for the devs to do the same Ben O'Bro did for Union Island after the first release.
Below are some screens of testing with loading max AI cars in Shibaura. All 31 cars are official and I confirmed in game they don't have issues like not engaging lower gears or veering to scrape the walls. Tests were done without me changing position on track to minimize randomness.
Another thing comes to mind - Windows version can have an impact. I prefer Win7 over Win10 and my testing of "[THREADING] USE_TIMER_PROCESS=1" is one more reason to do so. In Win7 the OS scheduler takes note of the change and I can see steady thread usage of ~100%. In Win10 the OS scheduler ignores the change and keeps the thread usage ~84% which ultimately reflects on the game's performance.
 

Attachments

  • Clipboard02.jpg
    Clipboard02.jpg
    449.9 KB · Views: 120
  • Clipboard03.jpg
    Clipboard03.jpg
    477.4 KB · Views: 86
  • Clipboard04.jpg
    Clipboard04.jpg
    451.4 KB · Views: 122
  • Clipboard05.jpg
    Clipboard05.jpg
    451.1 KB · Views: 72
Last edited:
I was starting at Daishi. It was an interesting investigation but as I'm GPU limited because of VR's super high resolution I will stick with 13 traffic (all Kunos cars). With 52 cars it was like real life, stuck in my lane with no room for overtaking. It got a little better after a few minutes with the traffic opening up a bit but the fps was down at 30 so not enjoyable.
 
I'm GPU limited because of VR's super high resolution
On your screens there's a thing that suggests the performance is wasted on something that is costing ~4 ms extra in both VR and 1080p screen. That may sound small but on a powerful GPU it is a lot. Have a look by expanding "Preparation" and try some different CSP settings to bring it down. Also try to rule out the possibility of some crypto-miner malware running in background. "HitmanPro" is what I can recommend.
 
Last edited:

Latest News

Online or Offline racing?

  • 100% online racing

    Votes: 74 7.4%
  • 75% online 25% offline

    Votes: 103 10.2%
  • 50% online 50% offline

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

    Votes: 277 27.5%
  • 100% offline racing

    Votes: 402 40.0%
  • Something else, explain in comment

    Votes: 4 0.4%
Back
Top