Cities Skylines rendering

Hi,

Read this Gamasutra article news on Cities Skylines traffic system. In the article they mention how they manage to simulate so many cars.

“In terms of performances, it is impossible to simulate the above by applying it to every car’s every frame. The secret to a decent performance result is to distribute the calculations as much as possible. In our case, the car movement is simulated about 4 times per second while the rendering will use two simulation frames to derive a smooth position out the position, rotation and velocity data. More complicated decisions may be calculated even less frequently, but using the same smoothing approach, it will appear like it is constantly being updated.”

Any idea how to handle the interpolated rendering? My only thought was take the two simulation frames and use Graphics.DrawMesh and move the render position across the distance over 0.25 seconds.

Anyone tried something similar or have a thought how they might have solved it?

Soon* we have these features, to handle massive amounts of units etc.

*UnitySoon

He he yes that looks like it will solve it for me. Currently I start to go below 60 fps at 500 agents currently and that is none animated ones.

is this for mobile or desktop? what takes most of the time in Profiler when it starts slowing down?

It’s the Steering Behaviors that is the problem. They use flow field following which isn’t a problem but then it uses queuing, separation and non intersection constraints. To avoid iterating over all agents to find neighbors the world is divided into cells that keeps track of which agents are currently in that cell.