Limit of scaled velocity?

I'm working on a game where the scale seems quite difficult for Box2D to handle. I have bodies with a minimum size of 1 meter across travelling with velocities of up to 5000 m/s. My experiments result in a maximum velocity in Box2D of ~80 "box units"/second, so I introduced scaling to deal with it. But at 1 meter = 0.01 "box units", I suffer from a lack of precision (collisions occur several meters away from objects).

It would be acceptable if only high-speed collisions occurred with this lack of precision, but it happens even when two objects with very low velocity collide. It seems Box2D simply doesn't behave well with objects that are about 0.01 "box units" in size.

So, in summary: I want objects to travel a few thousand times their own length per second without sacrificing precision (at least in low velocity collisions).

Is there a way to get both the velocity and the precision I want?
As stated in the Box2D manual, the sweet spot for the sizes of shapes in dynamic bodies is between 0.1 "box units" and 10.0 "box units". This is not a strict range or limitation, but in general, relatively big stuff doesn't really collide well with very small stuff (an example of an undesirable effect is a small body squished between a static body and a big body). Also, it's safer to be on the bigger side of things. 0.01 "box units" is very small, a number that's very close to Box2D's thresholds (which is what you sort of see in your simulation with 0.01 "box unit" sized stuff).

Also, if the scaling to the sweet spot doesn't work, there is a constant in b2Settings that you can change (named maxTranslation), which is essentially the maximum linear velocity. The default is 2 "box units" per timestep (not seconds), so yeah, you can increase that.
I see. I guess I'll have to try increasing maxTranslation about 10 times which would allow me to use 0.1 box units/meter instead. I'll try it. Thanks.

EDIT: I see that the comments in the header warns against doing this. Apparently the current value of 2.0 is considered to be very large; but I guess I need a value of 20.0, at least. What sort of issues can I expect to appear and test for when I edit this? Objects going through each other?
Yes, the usual risk of having a higher maxTranslation is stuff going through each other (which can be solved by using bullets). The 2.0 value is usually enough for most games, since that usually means about a top speed of 60-120 m/s (box units per second) for a frame rate of 30-60 fps, respectively, and scaling usually solves other issues.

There may be some other issues that I don't know because I don't know Box2D that deep, but as far as I know (according to my game with a maxTranslation of 200.0), the only issue is going through stuff.
Hnefi wrote:
So, in summary: I want objects to travel a few thousand times their own length per second without sacrificing precision...
Sounds like a good case to use a raycast for. Btw, can a human even see what's going on in this kind of situation 🙂
irresistible force wrote:
Hnefi wrote:
So, in summary: I want objects to travel a few thousand times their own length per second without sacrificing precision...
Sounds like a good case to use a raycast for. Btw, can a human even see what's going on in this kind of situation 🙂

Actually, that's a good point. I could use a raycast to see if there's an object within a close enough distance, and if not, just move the object forward. I'm not interested in fast objects colliding with each other so that could work.

Humans will be able to see what's going on since I intend to use a Supreme Commander-like zoom feature. I just want bullets that travel fast enough to be sensible.

Original thread: https://box2d.org/forum/viewtopic.php?t=8410