I'm working on a problem for a P2P network for games. The problem is the following: Consider two players on a grid, each stores it's own position. Player 1 wants to know if it sees player 2. In other words, if player 2 should send it's positional data to player 1.
The problem is sort of obvious, in order to know if player 2 should send it's data it needs the position of player 1, thus player 1 has to reveal it's position. I'm wondering if anyone knows about a system which does this visibility check anonymously, without revealing the position of players.
Right now I have an algorithm/policy which only reveals if player 1 is above, below, to the left or to the right of player 2 but does not reveal the exact coordinates of player 1 to player 2. It's based on the homomorphic properties of certain cyphers, but this is still a big limitations in certain games, especially first person shooters where knowing the approximate direction of your enemy can be very helpful? Note, I am NOT looking for fully homomorphic cryptography here, only something which can solve this specific problem of checking whether a point is inside of a "visibility field" or not without revealing positional (or visibility field) information.
This question might be a stretch since there probably isn't such an algorithm out there, but I thought I'd ask anyway :)