The online racing simulator
Physics engine rates of racing sims
(54 posts, started )
whats all this for?
alright.....
Quote :it probably doesnt however i dont really see how it might help with framerates when the pc still has to cope with a much higher rate and 3 more cars during the corners where a high framerate is most important

Ah but after T1 field spread ensures that at any given time most cars are on a straight. Watch a big race on LFS Remote, you'll see that after the start at any given time most cars are settled.

The start down to T1 will always be the point of any race game that has the lowest frame rate. There are lots of ways to compensate here by cutting back on eye candy when frame rates are dropping, and in my previous project I chose to make the physics cut back when the framerate dropped below 25, it didnt detriment gameplay - my engine gave me this flexibility, and making the game more responsive more than made up for the lower fidelity physics on the first turn - so it was win-win really.

And like I saw, once the race was settled down I had way more CPU cycles to play with.

To me it makes no sense to do things that are not needed. Games are all about saving CPU cycles and getting the very most out of the performance of the computer, why waste 290 cycles of the physics engine when it doesnt need doing?
Quote from Becky Rose :Ah but after T1 field spread ensures that at any given time most cars are on a straight.

but once youve got a decent spread physics culling shoud ensure that theres very few cars to calculate anyway

Quote :To me it makes no sense to do things that are not needed. Games are all about saving CPU cycles and getting the very most out of the performance of the computer, why waste 290 cycles of the physics engine when it doesnt need doing?

i see where youre comming from but i can also understand the advantage of simply using a fixed rate and forget all the worries that a variable one will come back to bite you in the arse at any one point
Quote :but once youve got a decent spread physics culling shoud ensure that theres very few cars to calculate anyway

That depends on how versatile your replays are, and what your approach to single player is, though it's a fair point. Where my approach wins hands down is the transition between those two states.
#32 - Juls
Quote from Becky Rose :why waste 290 cycles of the physics engine when it doesnt need doing?

Even with fixed timestep you can use a similar cpu-saving strategy. Every timestep the engine decides if a physics update is necessary or if it should keep vectors previously calculated (like acceleration). This way you get advantage of fixed timestep and variable timestep.

The main problem when you slow down physics update frequency is that it is difficult to predict when you will have to increase it. Because you have to increase it BEFORE things occur to avoid low-frequency problems (collision bugs for example).

Am I wrong?

Anyway I am very surprised. I always believed physics engines were running at 100 hz or lower for previous sims, and 300 hz only for new generation sims like iRacing because it has to cope with small bumps at high speed.
You're not wrong Juls, you want to pre-empt physics issues before they occur for best results, although in practice having the fall-back of the physics saying "hang on, I need to react to this" is not as bad you might think.

But if you think about it you actually have all the event triggers you need anyway, you know when the car is near a bump or kerb or gravel trap because you know where the car is. You know when forces are about to effect the physics because you know the controller inputs, so pre-empting when the physics need to be running at a higher frequency is actually extremely easy.

I hadnt got as far as car collisions (which created some interesting scenarios in our multiplayer testing!), I think it was the thing I was working on implementing when the project was abandoned, certainly I was getting nagged for it by the test team, but I wonder if any practical issues would have arrisen from that. Although I can't see anything that would cause major concern. It's not like the physics are not running, they're just optimised is all.

I too was suprised by the physics rate of some of those games, and wonder just what they encompass within the word "physics".
Quote from Becky Rose :Ah but after T1 field spread ensures that at any given time most cars are on a straight. Watch a big race on LFS Remote, you'll see that after the start at any given time most cars are settled.

Am slightly worried that I've missed the point here, but...
Surely it's irrelevant how many cars are in the race, as the physics calculations for a car (e.g. see Becky's earlier post) are done locally on the player's own PC on a one-on-one basis? So the extra cars in the race don't add physics loading to the master server or the clients (though they clearly add graphics loading to the clients). A few milliseconds worth of kerb interaction would never be a sensible candidate to be sent down the wire...

[Oooh OK, just spotted something - the local game engine probably has to do physics updates on each remote car in between packets from the remote host... But still I feel that giving very many cycles to those calcs would be a waste of time because of the high probability of changing control inputs from the user in the meantime... I now remember seeing (laggy) cars hit barriers and spiral through the air at high speed for half a second before magically reappearing on track when the next packet arrived ]

As for reasons to run at a constant rate, it's certainly cleaner/nicer to be adaptive here, but I guess people writing for consoles might not care about wasting cycles (if it makes the program performance more deterministic) given that they probably don't have to care about any other demanding bits of code sharing the CPU(s).
#35 - Byku
Sry for "offtopic", but what is the frequency of physics in Rigs of Rods? Anybody knows? It seems to be VERY cpu dependent.
Quote from Byku :It seems to be VERY cpu dependent.

IIRC RoR does not assume infinitely rigid bodies like LFS and most other sims (all?), that's going to cost a bit in terms of CPU usage I'd say.
If I understand correctly the high the rate is the most CPU it will demand right? Does the rate also affect something with physics too? Like will a high rate make the driving more accurate or something?
Quote from Riders Motion :Does the rate also affect something with physics too? Like will a high rate make the driving more accurate or something?

Basically, yes. The higher the rate, the smaller the integration error.
so could a high rate slow lfs down/ fix the barriers?
There is a lot more to collision handling than the physics rate. As has been proved by a popular modder, the red barriers are fixable, presumably without any changes to the physics engine itself.
#41 - senn
interesting. What are the advantages/disadvantages to raising or lowering these numbers, or is it also totally dependant on the programming of the game itself?
Quote from senn :interesting. What are the advantages/disadvantages to raising or lowering these numbers, or is it also totally dependant on the programming of the game itself?

The advantage is of course the slower interval between calculations, so the higher the interval, the smoother it should be... The problem is that obviously it puts load on the CPU, and there is a higher probability of spiking (if high enough, it will pick up every little flaw in the driving surface for example)...
Quote from Bob Smith :As has been proved by a popular modder, the red barriers are fixable, presumably without any changes to the physics engine itself.

huh? did i miss anything important?
Quote from Byku :Sry for "offtopic", but what is the frequency of physics in Rigs of Rods? Anybody knows? It seems to be VERY cpu dependent.

Added this one to the list now, along with rFactor Pro and a couple of other corrections.
Quote from Bob Smith :
'02-'09 Live For Speed - 100 Hz (collision detection) / 2000 Hz (vehicle dynamics) [posted by Scawen on lfsforum]

i'm sorry, but what are the "vehicle dynamics" ?
Thanks lukelfs, added.

majod - this covers the movement and rotation of the car bodies and wheels
BUMP! Wave

Only been a decade since I compiled this list (see first post) and a few sims have come out since. If anybody knows or cares to find out about some more recent sims not in this list, please post up here. Ideally with a reference.


Thanks
Quote from Bob Smith :BUMP! Wave

Only been a decade since I compiled this list (see first post) and a few sims have come out since. If anybody knows or cares to find out about some more recent sims not in this list, please post up here. Ideally with a reference.


Thanks

Wow, long-lived thread Big grin
You've managed to do all of the ones I was thinking about already.
I guess maybe it's too late to start now but having the reference links in the OP would be cool.
(NB: in case it wasn't a pun that sailed over my head, it's Assetto Corsa & assettocorsa.net, not Corsica Thumbs up)

Physics engine rates of racing sims
(54 posts, started )
FGED GREDG RDFGDR GSFDG