Jump to content

How are the physics so accurate? Implemented on server?


Recommended Posts

I'm quite amazed at how smooth Multi Theft Auto is. Especially the physics. They seem to be inline with other players when for instance colliding to each other by car.

I'm wondering how this is exactly done, I can't imagine that the physics of GTA SA are being run on the server. But how do these physics match across all these different clients?

The server can't be authorative if the physics aren't being run on the server. So does the client simply send input commands to the server which the server then broadcasts to all clients (running the physics locally)?

Link to comment

That's correct. There were (years ago, now) some discussions about implementing server-side physics, but it was never going to be an easy task (and would probably require rewriting the client-side physics too, to make them match.

It's been a while since I've contributed, but from what I remember, each object has a concept of an owner, and they're responsible for synchronising the physics. Vehicles have dead-reckoning, which makes them have quite good looking physics (though collisions can be an issue sometimes, depending on latency). There's a difference between physics being accurate versus being smooth - and MTA tends towards the latter, which is mostly what you'd want!

Link to comment

Thank you for your comment! I have tons of respect for you developers. It's very interesting to understand all this.

I was browsing through the Github source code, but couldn't find anything regarding input. Does anybody know where exactly this is being handled in the code of MTA?

  • Like 1
Link to comment
  • 3 months later...

I've seen a MTA's Team Member (Qaisjp) writting some pages about the project structure like here: https://wiki.multitheftauto.com/wiki/CLuaManager.

I don't know if he compiled everything in a single wiki page to help locating them but I found the idea really interesting. If you adress important key-points in your reaseach, don't forget to try writting something about it. I believe it would help people that (maybe) will come later.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...