Vehicle Network Physic

Options
Hi,

i am trying vehicle physics with client side prediction for days now and readed nearly every topic on the internet i found. Slowly i think i am stupid. But i found a blog entry from the hurtworld developers:
http://hurtworld.com/networked-vehicles-in-unity-5/

I asked me how did they do that?

Greetings
FleMo

Comments

  • stanchion
    Options
    One of the samples in the Bolt sample pack has an example just like this. Server owns rigidbody, player sends command to move. The main thing they added is reaction on the client side to input, like spinning wheels before the server actually tells the client its moving. It also sends some rigidbody values for sounds etc.
  • mattm
    Options
    This is the typical way to simulate physics. You tell the server your input, don't do any client side prediction, then simulate the object on the server. The object you see on your client is simply a replicated state of the object.

    The downside, as they mention, is that you have to wait a round trip for you input to be represented on the client. For a character this would be unacceptable, as they are quick moving and without immediate feedback (client side prediction) they feel wrong. With slower items though, like vehicles, you can get away with it as a vehicle has a sluggish feel anyway, and this hides the round trip.
  • FleMo
    Options
    Okay. This was clear to me. Lets get a little more specific. I want to make a tank top down shooter arcade game.
    It seems like client side prediction and rigidbodys will work in no way with acceptable results and a good feeling when you play. So i have to use a character controller. But the basic character controller uses a capsule collider but for tanks it would be the best to use box colliders.
    This is the point where i have to write my own character controller. I already tried this, but with collision detection i have my problems. It seems like i have to learn a little more about collision detection.
    Am i right or did i forgot something?
  • stanchion
    Options
    I've never experienced issues with collision like that. If you send your project to support@boltengine.com we will take a look.
  • mattm
    Options
    There is an open source alternative character controller available here: https://github.com/IronWarrior/SuperCharacterController

    Not used it myself but may shed some light on collision behavior etc even if it cant be used directly.