I have everything working great, almost done the alpha build of my game, but this network jitter is preventing me from releasing anything. I’ve scouered the boards, but haven’t found the resolution and I know its gotta work. I’m using NetworkRigidBody and Unity4, I have Observed set to NetworkRigidBody, with it enabled on both the sending and receiving sides. I’ve taken time to diagnose the code and I understand it and I’m pretty confident the code looks valid. If my client isn’t moving and the remote avatar is moving I notice the jitter, but if we’re both traveling in the same direction at the same speed, and I’m very close to the other player, I see the other player jitter very bad. The faster I go the worse I see it. Is there another version of NetworkRigidBody that works better? Might it be an issue with prediction? I’m traveling perfectly straight, no turning, so even prediction should be pretty simple. I even commented out the prediction code thinking it was moving too far forward, then it had to back up and reset, but I still had the jitter. This is a show stopper and I’m not ready to give up. Anyone have any magic for me… PLEASE!!!
I’m waiting on a new network capture card, should be here any day. Then I’ll upload a video if its not resolved by then.
Thanks PrimeDerektive, looks interesting, but I’m not sure. It sounds like Duhprey is suggesting sending all the keyboard inputs constantly which I’d think could create a LOT of extra networking and if you plan on having a LOT of players (60 in my case) it might not scale appropriately. I’m hoping maybe I misunderstand something but I’m not sure. I also see he’s still referencing lhs and rhs which is from the NetworkRigidBody code, so I’m confused if he’s sending input updates, why is he also sending networkrigidbody updates? I private messaged him for help. Hopefully he’ll respond.
Just FYI, sending the keyboard inputs is a lot less then sending the position/rotations/velocity… maybe 10% of pos-rot-vel. Thinking that you can use NetworkRigidBody with 60 players is just ridiculous … building a 60 player game is not simple task.
I’m agree it’s not a simple task, but it is doable given the right optimizations. I’m not sure NetworkRigidBody would have anything to do with that optimization, assuming the code itself is optimized too, to properly send only what’s needed and utilize correct compression when doing so. The trick is to not have to send to all 60 players all the time, but only the ones within a distance where they care about the update. That’s the magic I’m putting in
In general you’re right that input is less than position and rotation (or it should be) but networkrigidbody is only sent a few times a second not every frame. If you’re sending inputs with a joustick or mouse or controller constantly moving a little, you could be talking about updates every frame, so I’d argue I think sending input would create more inefficiencies then getting networkrigidbody to work correctly. IMHO.
right now everything is in my studio. I’m running Photon Networking Engine, but I’ve reproduced the same with Unity. I’ve experienced the same from the local server and photon cloud. At the moment I have access to 8 client computers, PC/Windows and MAC, but for my testing now I’m just using 2 clients on the same local lan as the server. Both are Intel i7 processors.
Your test environment certainly doesn’t appear to be the problem.
The package that I submitted to the asset store is suppose to help troubleshoot issues like this. It captures position, rotation, and time on each Update call and then you can play that back to see what might be causing your issues. When people talk jitter, it’s really about where the object was, is, and will be - and how that movement appears to the viewer. I’d just give it to you to see how it can help you, but since you’re essentially bolting it on quite a ways into your development, it’s takes some practical knowledge to get it up and running properly without a lot of frustration on your end.
Take a look at this web player demo and see if it’s something that might be able to help you. Demos | Object Motion Studio Record something, use the slider, go frame-by-frame. If anything, it may give you some ideas on how you can troubleshoot your situation. I learned a lot just by developing it.
I would bolt it on for you,but that would mean that you would have to trust me with your client code - and that’s something I wouldn’t expect from anyone.
I’m anxious to see what your jitter looks like on video. I’ll be watching this thread.
The Jitter issue was resolved using a modified version of NetworkRigidBody developed by Duhprey as referenced in PrimeDerective’s post above. Here is a link to an early preview video showing the results: http://youtu.be/5tYYCcBSpMs
This is what he suggested in the link you gave, but I’m not sure how to apply it exactly. I have a jitter problem in a networked flight simulator. I am using Unity Network code not Photon. I have tried disabling all physics related code on my planes, and setting the rigidbody.constraints = RigidbodyConstrants.FreezeAll on any machine that’s not controlling the plane, so that the position and rotation transform should control the plane directly.
My network FPS is about 60-80 as is my framerate. but I do still see jitter.
I tried making a lerp for movement but failed. How exactly did you implement your fix?