is there any way to measure the physics "load" so I can adjust the timestep duration according to that?
Using the Stopwatch to grab a timestamp immediately before and after the Space.Update will give a pretty accurate measure of time passed.
Also, can you give a rough estimate as to how many / how large the timestep duration changes should be at a maximum before noticable stability issues can occur? Is there anything else I could do to minimize that effect? Other than a minimum value of maybe 1/30 (well, perhaps a max of 1/300 or something) I don't really want to limit it too much, since performance is not an issue.
If the time step is changing every frame from 1/30 to 1/300 and everywhere in between, it will have a very hard time. Jumping from 1/60 to 1/120 and then a minute later going from 1/120 to 1/240 probably won't cause any noticeable problems. I can't really predict for a specific simulation just how bad it would be, but testing it is relatively easy
Finally, just to clarify: using a global variable timestep with the parameterless Space.Update() should cause the physics and graphics to be decoupled, am I correct? So, if there's a decrease in graphics framerate due to many collisions at once, it's probably because the GPU is affected by the high load on the CPU in terms of "hardware", not because the draw() method is still in some way affected by how long an update() takes? (I'm not an expert on computer stuff so that probably sounded a bit stupid, sorry for that )
Using a variable time step in XNA, if I recall correctly, will make the game perform one Update followed by one Draw followed by one Update followed by one Draw and so on. In that sense, a variable timestep combined with a parameterless Space.Update couples the physics update rate to the graphics rate. Generally, 'decoupled' means the physics is framerate independent or free running asynchronously. Framerate independence is accomplished by the Space.Update(dt) method, but if the simulation can't run in real time, it's not really useful.
If the framerate drops during significant collisions and no changes have been made to the graphics system (no particle effects, no new geometry, etc.), it is very likely the CPU bottlenecking the system. The Update and Draw method do not run in parallel, so unless there is some code which explicitly changes the Draw behavior based on the Update behavior, there will be no difference.
Here's a few other things:
-Using internal multithreading (giving the space.ThreadManager threads to work with), if not already used, will significantly improve the simulation performance on a platform with multiple hardware threads.
-Using asynchronous updates (which is distinct from, and can be used with, internal multithreading) can be used to ensure that the graphics can run at full blast while the physics chugs along in the background. Going asynchronous does not magically make the simulation smooth, though. If it cannot compute enough timesteps to look smooth graphically, a type of interpolation will be needed to fake it. Unfortunately, the type of interpolation built into the BEPUphysics interpolation buffers won't work for this- basically, predict the finishing time of the next time step and use it to pick an intermediate state between the current state and previous state of each object to draw. The rate of advancement won't always be equal and depends a lot on the algorithm chosen, but it could work.
-There may simply not exist a time step duration at which the simulation can execute one time step per real time game update. Before implementing any complicated logic to dynamically change it, try some really tiny durations to see if they actually do what is needed. If it doesn't work, focus on some other type of trick (like the interpolation above).
Incidentally, I'm working on some changes which may improve the performance and multithreaded scalability of lots of objects in chaotic collisions with a single large kinematic entity. I can't yet predict how much of an effect this will have, but keep on eye on the
development branch over the next few days
