Replies: 1 comment
-
Some more progress here, now the server is correcting the player's position. In this video I am simulating (using Clumsy) 40ms of ping time, 10% packet loss, and 1% of the time throttling it with an extra 30ms. Currently it feels pretty good at low ping but there's little micro stuttering going on that I'm in the middle of battling with. Capsule is floating because it's just piggy backing off the current RenderPlayer logic. Client is on the right. 2024-01-03.10-58-52.mov |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I'm currently working on building a server-authoritative version of this plugin. I'm curious if this is within scope of what you're trying to maintain here.
If you're curious about who I am, I'm a web developer in Canada but I'm also the lead developer for Brutal Grounds and I love tinkering with all things multiplayer. I also maintain the Bevy project Qevy where you can use Trenchbroom to build maps for Bevy (although most of the heavy lifting is already done in another lib).
It's still very early in development, right now I've got inputs streaming from clients to server, then processed on the server. I'm also trying to take into account clients who may be ticking slower than the server, lagging out, or cheating, by always ready to process the last known input if there's no new inputs available. That way they can't freeze mid-air (for ex) whether on purpose or not.
Some concerns I have is mostly on the client side, something I'm just starting on now. I'm concerned about how Rapier might be updating internally. When the client receives an update from the server, it will need to replay a series of it's previous inputs in a single tick, processing the physics each time. Hopefully that is possible.
I haven't pushed up most of my work yet, but I have a fork with a branch called
bh-mp
which contains the changes I've made so far to the plugin, and I have another project which hasn't been pushed up that contains most of the netcode itself. The most notable change I made was I used an EventReader/Writer for inputs so the server can just write to it while it receives inputs from the clients. I also split out configuration with state, so now you haveFpsControllerConfig
(resource) andFpsControllerState
(component) instead ofFpsController
. As I code, I'm trying my best to implement it as a user without having to touch the plugin, and then only making changes to it when I feel I'm limited as a user. And for the multiplayer communication itself, I'm using Renet and theirbevy_renet
plugin.Anyway, I'm hoping within the next couple of weeks I can have a demo that can be tried out.
Here's an article I'm following loosely.
And another
2024-01-03.08-33-44.mov
Beta Was this translation helpful? Give feedback.
All reactions