#Closest players visibility

29 messages · Page 1 of 1 (latest)

left mirage
#

Hi! I want to implement a mechanism which shows you the closest players to you but also limit the amount. what is the best approach for this?

#

@latent vessel

shell glen
#

You could loop through the player objects on a client and check their distances. Or you could do it on the server and tell the relevant clients.

latent vessel
#

what max said but Id do it client side unless the server needs to know some reason too

left mirage
shell glen
#

Well, the client wouldn't ever have that many users observed by it at any one given point in time, so it would be checking far fewer than that

latent vessel
#

and do you want the client to explode or the server 😄

left mirage
#

server for sure since the performance is predictable.

latent vessel
#

Id encourage you to use client. Like max said you're never going to have that many ppl visible on client.

#

And if you do a few distance calculations is the least of your worries.

left mirage
latent vessel
#

the client can already see the other players

left mirage
#

thats what I want to limit. imagine 30k users.

latent vessel
#

Okay I think I get what you're saying now.

#

It seemed like you wanted to show a special fx or something on whichever player was closest to the client but you really just want to limit how much they see.

#

grid condition is the fastest

shell glen
left mirage
#

my desired use case is as follow:

  1. 30k people are staring to play
  2. on 20 will be visible to each player and it determined by proximiy (so they come and go)
  3. this also limits the amount of data, bandwidth and processing required from both client and serve
  4. client just see what it needs to see.
shell glen
#

Ah, yep, you will want to use the observer system for that then

latent vessel
#

You're never going to hit 30K ppl on a single server but either way your best perf option is the grid condition, which will do that.

left mirage
#

whats the max you saw? we just pass position data

latent vessel
#

300-400 no issues. 3d mmo

#

gotta find a game that actually has that many players first lol

#

go with the grid condition. it does what you want and its very performant. it even auto adjusts based on ccu.

left mirage
#

ok, 300-400 whats the server spec?

latent vessel
#

no idea sorry. I know a $5 server can handle 300 ccu though

left mirage