Okay, it’s more like taking a step back from it for a while, although the few things I learned in the past several weeks have been interesting.

It turns out that Sync Transform (as opposed to Sync Rigidbody) is way more up-to-date, but the trade-off is in the choppiness. I’ve read that a reasonable send rate of 10-15 per second is standard, and other players’ paddle movement simply looks like a slideshow. Check out the footage below:

I’m aware that there are some other approaches to networking, like ditching Network Transform (or Network Rigidbody), instead issuing all client movement as commands to the server. The server would then RPC all four paddle positions to all clients at all times. Of course, the client’s paddle would have to appear to move in real time while it waits for the RPC information.

With the choppy-but-accurate method you see above, I actually was initially happy to see that I could indeed move around paddles with code (client-side) in case I wanted to smooth other players’ paddles out. For example, suppose I see your paddle moving to the right during frames 1-12. On frame 13, you start holding Left, but I only get that information on frame 18. As far as I’m concerned, from frames 13-17, I have to just guess that you’re still moving right, because historically you were moving right. Even if we Lerp moderately, your position on frame 18 is probably very different than that far-right position that I figured you’d be in, and it’ll look goofy. And that’s not even the worst part: the way I had it in my experiments, the (authoritative) server would actually declare ball collisions based on the predicted/estimated positions of other players’ paddles.

Maybe it’s a cop-out, but I really do think that if I’m using Unity, I should be able to use UNet as intended, and I see no reason why I shouldn’t be able to use Transform Rigidbody on paddles with a high send rate. I’m not scared of rolling my own, but is that the best use of my time? In the end product, I would simply ignore complaints from people with ~60 ping or more, because the game is designed to be played locally anyway, and the action is super time-sensitive.

Throw in the random Unity Services bugs I’ve been running into (it suddenly doesn’t recognize my game or company name, so I have to re-register the service, etc.) and ultimately, I don’t think I can use UNet for this. That means Pong 4 Pals will never see online multiplayer, unless I switch to another engine that has a viable plug-and-play networking solution.

Anyway, back to this Udemy course on Blender I’ve been taking in the mornings. I want to start cranking out some decent-looking low poly assets for my projects so I can stop using the “need an artist” crutch!

Leave a Reply

Your email address will not be published. Required fields are marked *