-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What exactly is bending? #141
Comments
Hi @tomknappramos ! I gave a talk about this once in a conference, their audio is not great but it does cover a lot of the points here: I'll try to address your questions. 1 & 2 - The client is ALWAYS adjusting itself to the server's authority. That's what authoritative server means. A lot of this stuff is visual trickery to make it appear as if everything is running in "realtime". 3 & 4. Interpolate indeed performs bending. Take a look at the interpolate strategy
I also cover which should be used when in the video linked above around the 19:00 mark
|
@OpherV thanks for getting back! I appreciate it! I got the vibe that Lance was "no longer actively being developed", but it works and the development experience is great. So, for me, it's worth a try! Plus, look at C. It's the leading language used in the game dev industry, and I don't think anyone is actively maintaining very many C libraries these days (I could be wrong on that haha). 1&2, Clients store 2 types of states,
To appear "live", clients go ahead and simulate user actions on the local game engine right away. But! Clients don't do the actions completely. Instead of fully commiting to the simulated next state and rendering that next state, the client can approach the simulated new state, and bending is the percent at which clients approach that next state. That is localObjBending. Then, when a remote state comes in from the server, to avoid choppiness, clients can gradually approach that "actual remote state". Where, again, bending is the percent at which clients approach that most recently known "actual remote state". That is remoteObjBending. So, clients are bending towards 2 things - bending towards the "simulated next state" as well as bending towards the "most recently known remote state". Personally, my instinct tells me to set both to 1. That just seems logical to me. 3&4, 5, 6, PS PPS |
Also, is bendingIncrements a multiplier on the bending properties? Ie, would Thanks again! |
I feel that I've read everything on lance-gg.github.io that I can about bending, ie localObjBending and remoteObjBending, and I don't think I quite understand it. So, I'm hoping to get some clarification on it.
I'm a pretty decent front-end developer (I created my own front-end framework, https://duckjs.org, not trying to self-advertise, just trying to show where I'm coming from and my level of understanding), but I hardly know anything about "netcode" as they call it. From what I've researched, it's generally good to have an "authoritative server". And, according to https://forum.unity.com/threads/authoritative-server-definition.209320, I think an authoritative server system means that the server owns all data and has the "final say" in all actions, meanwhile, clients focus on rendering the server state in the best possible way and transmitting user input data to the server.
My questions regarding bending:
Does remoteObjBending mean that clients have some authority over server state? Ie, is the server adjusting itself slightly to the state of clients?
Does localObjBending mean that the client is bending its local state back to a previous version of its own state? If so, what is the purpose of that?
Does bending only happen when using syncMode=extrapolate?
Does syncMode=interpolate perform bending?
Is extrapolation better than interpolation? In what contexts would you use one vs the other? It seems like you have to choose one or the other in Lance, ie you can't use both. So, I'd just like to inform myself.
Also, I know this is obviously unrelated to Lance, but I found another framework called Colyseus that seems to have become popular. Is there a reason why people might choose Colyseus over Lance other than the fact that Colyseus looks like it's more client-ignostic (ie works with Unity, Cocos, Construct, etc)? I'm personally trying to make a simple browser-based multiplayer physics game similar to https://github.com/lance-gg/sprocketleague, so the built-in integrations with Cannon/P2 in Lance just make so much sense to me. I went through the Lance pong example, and I'm very impressed with how everything in Lance is architected. So, I'm really just asking this because Lance seems ideal to me, and I see no reason to use Colyseus assuming that Colyseus would perform the same stuff (ie "netcode") as Lance and with the same level of performance, right? Also, I didn't find anything on Colyseus about bending.
PS
Sorry this is a lot of questions, but I'm hoping to get some answers so that I can start building my game in Lance!
PPS
I also wanted to say thanks to all the developers for this awesome project!
The text was updated successfully, but these errors were encountered: