AmbientRun / Ambient

The multiplayer game engine
https://ambient.run
Apache License 2.0
3.79k stars 122 forks source link

Hiding entities from specific clients #492

Open marceline-cramer opened 1 year ago

marceline-cramer commented 1 year ago

In games with very large worlds such as MMOs or in games that require minimal bandwidth such as fast-paced FPSes, it becomes very important for the server to be able to disable synchronization of unneeded parts of the world to different clients based on line of sight, distance, or other heuristics. To support these common multiplayer constraints, Ambient should have a mechanism for server-side guests to signal to the runtime that certain entities should not be synchronized with specific clients.

philpax commented 1 year ago

Hm, is #543 a dupe of this, or should this be a separate exclusion mechanism?

i.e. #543 implements a general-purpose streamer, but this offers an API for excluding an entity from sync for a specific player

droqen commented 1 year ago

I think there are two separate categories of exclusion - one where things are excluded in a more, hmm, static way? Like, the cards in my hand are always going to be hidden from my opponent. I can never see any assets in a different zone/instance.

Static not the right word, because there will be instances where my visibility zone changes, but it seems different than a dynamic/streaming culling, where visibility is highly volatile and we can't make any solid statements about whole groups that change all at once.

I would say that the API should not be exclusively for excluding specific players, though, but more players who don't match some given pattern (e.g. "player does not have component x of matching value y" (e.g. "player does not own this hand of cards" or "player is not inside this zone/instance"))