notgoodusename / tcp-udp-networking-basic

This a is a basic multiplayer setup based off Tom Weiland multiplayer tutorials. It contains client-side prediction, reconciliation, interpolation and lag compensation.
11 stars 0 forks source link

Lag between 2 client's movement #1

Open michaelnorman-au opened 3 years ago

michaelnorman-au commented 3 years ago

Hey when I was running 2 versions of the client on the server the other client's movement would update every 3-4 seconds. I haven't changed anything from the original code, but was there a component or something I needed to add for it to function smoothly? Relatively new to networking so there's a good chance I'm missing something. Cheers!

notgoodusename commented 3 years ago

Hi! Try lowering the interp value and if you could please send a video of the issue

michaelnorman-au commented 3 years ago

I lowered the Time To Reach Target value on the interpolation script to 0.05 but it didn't seem to do much.

https://user-images.githubusercontent.com/87402857/142748963-a67e5043-e6af-4223-9615-6cf92563696e.mp4

notgoodusename commented 3 years ago

Are you running two instances of the program on the same pc?

michaelnorman-au commented 3 years ago

That's correct yeah, I'm using ParrelSync but I also tried building it, same result. Also forgot to mention I'm using Unity 2021.1.24f1.

notgoodusename commented 3 years ago

I have the same issue and I think its something related to Unity optimization stuff Try playing in 2 pcs

michaelnorman-au commented 3 years ago

Just gonna grab lunch and then I'll do this and get back to you. Appreciate you getting back to me so fast btw!

notgoodusename commented 3 years ago

Im about to go to sleep so I wont be able to answer, but I will be able to answer later

notgoodusename commented 3 years ago

Just found a thread on the unity forum, that mighy be able to help you

michaelnorman-au commented 3 years ago

Hey I had a look at that thread but I dont think the issue is my FPS, everything's running smoothly and I've had 4 editors open most of the time. Currently having difficulties getting the other computer to connect to the server. I've tried both building it for the lan IPv4 as well as the online ip address, and have forwarded the ports on my router but it's still not connecting. I know it's got nothing to do with your code but if you have any sort of advise on this it'd be beyond helpful.

notgoodusename commented 3 years ago

I dont know why you cant connect, you should probably ask that on the Tom Weilands discord Im sorry I cant be of any more help since I did have this problem but just ignored it, since It would work fine on other pcs

michaelnorman-au commented 3 years ago

No worries at all dude i might give the discord a shot if i can't figure this out. Thanks anyway!

michaelnorman-au commented 3 years ago

Hey so I managed to get it working between the two computers but I still had the same issue. Good chance there's something up with the Unity version I'm using or some other unknown factor since it works fine on yours. Reckon I'll just continue on with my original networking solution but I appreciate your time dude.

notgoodusename commented 3 years ago

Ok!