Comments (8)
Added a GlobalMetadata
resource on both the client and server which will contain metadata about the connection.
Currently it only contains the client_id
.
from lightyear.
I don't think so, the current way of doing things is more like an experiment, I'm not really satisfied with it.
Also:
- the ControlledEntities component on the Client entity is not updated when an entity controlled by a client gets despawned (i'm waiting for observers for this)
- the ControlledEntities component on the Client entity is not updated when the ControlledBy component is updated at runtime
I think it will be easier when we have relations in bevy
from lightyear.
Maybe this can be integrated with rooms?
from lightyear.
Yes, maybe lightyear could spawn one room per connected player
from lightyear.
I removed the GlobalMetadata resource as it was confusing; I think we should look at what other libraries (unity, unreal) do for this
from lightyear.
There would be a distinction between:
-
Who is simulating the entity and sending replication updates?
(in most cases it is the server, but in some client-to-server replication cases it could be a client. It's not enough to check who has theReplicate
component, because the server will also have theReplicate
component to propagate the updates to other clients)
A client could be sending replication updates even for entities that they are not controlling/moving. -
Who is controlling the entity?
This is basically: which peer is controlling/moving a given entity? Usually it's the client who added theInputLeafwing
component on an entity. However the client adds theInputLeafwing
on thePredicted
entity, it could be useful to know on the server-side (i.e. Confirmed entity) who is the controller for a given entity.
(Then, if the controller disconnects, that entity could also get despawned?) -
Who has authority?
Who is acting as server for the simulation? usually it's the actual server, but if we're running in HostServer mode it's one of the clients acting as server?
This concept is still not clear to me.
I feel like 1) and 2) could be useful if they were handled in lightyear.
- could be useful to handle transfering the 'replication ownership' of an entity
- could be useful for the server to keep track of who is the ClientId controlling an entity
from lightyear.
Other idea: we could create a dynamic component ControlledByClientX
for each client.
On the server-side, we can add that component on each entity that is controlled by a given client, so that we can easily retrieve the entities that are controlled by a client.
from lightyear.
@cBournhonesque can this be closed then?
from lightyear.
Related Issues (20)
- Maybe parallelize component-specific systems with https://github.com/bevyengine/bevy/pull/13123
- Enable bi-directional resource replicaiton
- Confusion over `Netcode` authentication / `client_id` HOT 10
- Unfinished doc comment in simple_box example HOT 1
- Zstd fails to build in wasm (on my mac m1)
- Make client responsible for initiating prediction/interpolation
- Server-spawned client replication HOT 11
- Log spam when a connection is terminated HOT 14
- Panic in encode_packet HOT 5
- Interest management example broken
- Be able to update the `Replicate` component at runtime HOT 3
- Adding visual interpolation on a component seems to trigger a lot of rollbacks
- Let users specify their own comparison function for rollback check
- Allow server to validate packets that need to be reboadcasted to other clients
- Only apply replication updates if the new value is different from the existing value HOT 5
- Fix inputs handling in FixedUpdate
- Maybe we can remove the `BufferInputs` system set HOT 1
- Bullet pre-spawn error since replication refactor
- Publish the example `common` crate. HOT 1
- Provide a more expressive way to replicate only a subset of components of an entity HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightyear.