Do I need to include GameObjects whose physics is deterministic in worldUpdate?

In order to reduce the data transfer size and computational time for serializing world objects for each worldUpdate, I was wondering if it is possible to omit synchronization for objects whose physics can be fully modeled exactly on the client-side of the gameEngine (they are not playerObjects, so playerInput has no effect on them directly, and their physics is completely deterministic). Interactions with these GameObjects will be fully handled by GameEvents, which will be significantly less frequent. I feel like this should be possible if the client is running the same physics as the server and has access to the same initial conditions.

When I try to omit GameObjects from subsequent worldUpdates, I see that their movement becomes more choppy and they move faster than if they had not been omitted; however, when I stop the game server when the client is open, their movement is more like what I would expect if I hadn't omitted them. It's all on my local machine with extrapolation sync.

+3


source to share


1 answer


The short answer is that the latest version of Lance (1.0.8 at the time of this writing) does not support skipping game object users from world updates, but it implements a mechanism that skips objects from updating if their properties have netScheme

not changed, saving on bandwidth ...

This means that if you have static objects such as walls, they will only be passed once per player. Not transmitting this at all is an interesting feature.

If the objects you are talking about are not static, then there is no real way to determine their position deterministically. You may have thought you were using worldstep count, but different clients process different worldsteps at different times due to web lag. The client cannot know which true step is being processed by the server at a given time, so it cannot deterministically decide that object position. This is why Lance uses the "Server Authority Model" - to allow one source of truth and make sure clients are in sync.



If you still want to manually not send updates for an object, you can edit it netScheme

so that it returns nothing other than its ID, for example:

static get netScheme() {
    return {       
        id: { type: Serializer.TYPES.INT32 }
    };
}

      

Although this is not a typical use due to the above reasons, so if you are facing certain timing issues and this is still a feature you are interested in, it is best if you submit a feature request to the Lance issue tracker . Remember to include details of your use case to facilitate healthy discussion.

+3


source







All Articles