Physics Grids for large maps

As a Roblox developer, it is currently too hard to make very large maps, the issue is that the physics engine becomes more and more unstable the further out you go.

This is obviously because of floating point errors, which get more pronounced the further it is from 0,0,0. We already had a hackweek project for this so, I wonder why it was never properly refined, and implemented.well i do know why, no need to reply the obvious

If Roblox is able to address this issue, it would improve my development experience because I could make larger maps (for example, train games)

20 Likes

I just read a reply of a user on a different post that they’ve been trying to figure out the floating point error since 1936… Take this with a grain of salt, but I assume it’s hard to get around it, as much as I hate to say it.

However I do agree, it is hard to make a big map, and something should be done to at least improve it.

2 Likes

Bump, please give us better tools to create very large and detailed maps

1 Like

not to downplay anything you said, just out of curiosity; how far out are you going where this starts to be an issue? i always thought this was just a rendering quirk and physics remained fine

1 Like

Im planning on making a flight simulator which obviously requires a realistically sized map since the aerodynamics rely on realistic physics properties. I want to make a map that is atleast 120km x 120km large which in studs is 429k studs x 429k studs

2 Likes

You could solve this issue by moving the map around the player on the client side instead of moving the player itself away from the origin. It sounds ridiculous to move the entire map, but I think this is what games like Kerbal Space Program do to tackle floating point issues; after all, it all comes down to the concept of relativity. (You should not be able to tell the difference.)

As far as I know, there is no easy way to solve the floating point errors here unless the grid system is implemented, but I don’t think there is any need for it since there are other viable alternatives. (You could also make your player smaller to fit a regular map.)

1 Like

This works for single player games and is a viable option considering KSP is what, 10ish floating spheres in space?

The issue is that Roblox is a multiplayer engine, so this approach serves little practicality as it would be strange for multiple clients to be pulled closer and further apart.

3 Likes

Yes ive thought about something like that but i cant have the player in a static position on the client since the aerodynamics have to be still be simulated. Im already thinking about something that would solve that issue but its a little complicated to explain.

1 Like

Not necessarily. Clients can update their position and rotation to the server, and that can be sent to the client rendering the other players to update their position and rotation in their respective space.

As for the 10ish floating spheres point, moving terrain would not be too performance intensive as long as you limit rendering distance. Generate the chunks, and unload them when they get too far. The same goes for other players.

1 Like

Using the new aerodynamics is a bit more difficult, but then again, the video that showed the physics grid could exactly be the way to tackle this if you don’t want to simulate your own physics.

I am not completely familiar with the new aerodynamics system, but I assume you could still have positions be relative to the client with respect to the grid they are within. Then, the player can move within that grid with aerodynamics, but when the player traverses grid boundaries, the player’s position in world space is snapped back to relative space of the next grid, preserving its velocity. This would need some testing, but it may work.

2 Likes

So that means i have to create an entire custom replication system just because roblox didnt manage or didnt want to implement whatever they did there into the engine… I guess it is what it is, all I can do is hope that roblox will make it native

1 Like

Pretty sure just teleporting something won’t mess up aerodynamics as they should be using the velocity which isn’t effected by setting an objects position constantly. Keeping everything centred on the player at all times shouldn’t effect gameplay at all because the engine doesn’t actually use the delta position for physics and instead has a velocity vector that represents it. Changing positions won’t effect anything.