Skip to content
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

Dynamic objects #826

Open
kayhhh opened this issue Nov 17, 2023 · 2 comments
Open

Dynamic objects #826

kayhhh opened this issue Nov 17, 2023 · 2 comments

Comments

@kayhhh
Copy link
Member

kayhhh commented Nov 17, 2023

Networked dynamic physics objects.
I see two approaches.

1. P2P Object Ownership

This is the approach that I believe VRChat uses. When someone grabs an object they become the owner of the object, acting as a source of truth for it's location. Can be easily spoofed - letting them put the object anywhere - but should work fine enough.

2. Central Authority

We could have the host server act as the source of truth for object locations. This is more expensive for the server. How much the server validates player input could vary - from a hands-off full trust approach, to running a physics instance of the world, checking the movement of objects, player movements, and more to determine whether they are "cheating".

Thoughts

I like that the first approach imposes no cost on the server. I was interested in the central authority approach, but upon further reflection I'm not sure of any immediate use cases that would require it. Main thing I think of is some competitive game involving physics, whether objects or player movement, but it would take such an advanced setup to work effectively that I don't think its worth planning for now. Other competitive games, for example battleship, could still potentially run logic on the server (not sure yet, still need to figure out scripting), without the overhead of a full physics simulation.

@kayhhh
Copy link
Member Author

kayhhh commented Nov 19, 2023

Hm a central authority could be good for enforcing "restricted areas", like preventing players from flying through walls or entering a certain room. I do like the idea of being able to enforce more privacy / access control levels, having rooms you can't enter or load the models for unless given access. This isn't just dynamic objects thing but a broader multiplayer architecture.

@Misterblue
Copy link

Misterblue commented Nov 20, 2023

This topic can be a complex as you want to make it!
Systems like Eve Online and Open Cobalt use a synchronization protocol to allow "distributed computation" of object position. These solutions are somewhere between your two given possibilities with either client or server computing the position and there be later synchronization. (See info on the TeaTime protocol in Open Cobalt Wikipedia entry ) .
If you're not going to do some sort of state synchronization implementation, I'd think that central authority is your only option (given how good griefers are these days).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📦 Backlog
Development

No branches or pull requests

2 participants