Sign in to follow this  

Client loading entities

This topic is 1283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Suppose you have a large, seamless transition world that's not all kept loaded in memory at the same time. When a player enters a previously unloaded region, the server loads it up and then can easily send out the data to any players nearby upon completion. But how do you deal with players that move into that area after it's already loaded up. They need to have the data sent to them saying what to load and where. And you don't want to waste network bandwidth by constantly sending everyone "create X entity" messages when they already have those entities loaded. So what's the solution to this?

Share this post


Link to post
Share on other sites
Each player keeps a list of entities it is "subscribed" to. When a player moves to a new area/zone/whatever, add/remove entities to its list of subscribed entities as appropriate and send the corresponding network message. Other players are not affected by this movement, other than that the player may be entering/exiting the areas of interest of other players (and hence may be added to or removed from the other players' subscribed entities list).

Share this post


Link to post
Share on other sites

you don't want to waste network bandwidth by constantly sending everyone "create X entity" messages when they already have those entities loaded


The google term you want is "interest management."

In general, this is a server-side mechanism that in some cases take almost as much work as the server-side simulation itself (because it, too, is n-squared in complexity.)

Share this post


Link to post
Share on other sites
I kind of figured that would be the answer but wanted to check anyway.  I found this article that seems to go over the topic nicely, thanks to that search term, though I'm not sure why it claims to be an O(1) algorithm.

Share this post


Link to post
Share on other sites

I kind of figured that would be the answer but wanted to check anyway.  I found this article that seems to go over the topic nicely, thanks to that search term, though I'm not sure why it claims to be an O(1) algorithm.

I wouldn't use that archived one. Here's a recent one. Basic idea is there for interest management.

Share this post


Link to post
Share on other sites

This topic is 1283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this