Can you add distance based messaging?

Options
Hi
I'm pretty sure after searching on the forum that it's not possible to send messages only to certain players based on distance. You only have the option of all, others and specific variable.

This is bs, because if you have 100 players on a terrain and you only want to get messages from the ones that are 100 meters near you, you can't. You can try to work around it using grids, but that's bs too. Why? Because you could be 1 meter away from each other but on a different tile and you won't see each other until it steps into yours. Then you have to do all kind of fancy stuff to be able to trick the system and simulate a distance based messaging.

This on the server literally takes 1 second to implement. If x-player < distance from location, send message to this player.

So please, unless i'm mistaken and this is already possible on photon cloud, could you add it as an option when we send events?

Comments

  • Hi @creat326,

    in recent PUN versions we added scripts for client-side network culling, which is basically what you are looking for. Our solution makes use of the built-in groups and a grid based system. The grid however is not limited to just one cell, instead it is also taking care of neighbour cells if the client is close enough. You can check on the doc page and read about how to use it.
  • creat326
    Options
    That's exactly what I meant by "Then you have to do all kind of fancy stuff to be able to trick the system and simulate a distance based messaging."

    It's not the best way to do this at all. If you just added that into the server, something like store transform position and then api call to send only to certain distant objects... it would be awesome. I think it's pretty basic stuff for anyone writing a big world networked game.