Line of Sight Capability

So I’ve been working on testing an LOS (Line of Sight) capability, wherein, you can only see players and projectiles that are firstly, within a certain distance (making the highest resolution not unfair to lower resolutions), as well as those that are on the other side of defined LOS-Blocking areas. These LOS-Blocking areas could be put around blocks, so that you cannot see players or projectiles on the other side.

This is not something that could be implemented for wide-use on the main server, because there is a lot of calculations to be done by the server in checking your distance to other players and other projectiles. However, where this could be used is in Gamemodes, where there are players of ~10 or under, and checks are only done on players and projectiles who are playing in that specific gamemode. This also means that LOS can be properly setup on certain arenas, so that blocks affect LOS and areas can also affect LOS, such as invisible LOS-blocking walls.

The only thing left to do so far is server-side collision detection for projectiles on players that the owner of the projectile cannot see. Damaging a player requires that your client knows that the person is there, that they are alive, and that your projectile is at their location. With LOS, the server tells clients that players are at the top-left position on the map when not within your LOS, as to hide them. This means that all collisions detection by your client doesn’t work on those players, so the server has to do it.

The only problems for LOS is for players with high latency. If a player is too laggy, they will either not see any players often, or they will see players for longer than they should be, because they’ve yet to receive the ‘hidden’ position of the player. However, if you are playing with people who have lower latency, then LOS can add tactical play to PvP and maybe even adventure stuff. With LOS, it is possible to outrun and confuse a player, as once you turn around that corner and have two routes, you can take either one, and the following player will need to decide where to go to find you. It also allows players to take alternative routes to get around a battle without being seen, meaning spamming of things like blizzard staff or hydra become much less effective, because you do not see where the players are.

Of course, I am not going to put this capability in if it will not be used, so I would like to know players thoughts on it in regards to the Gamemodes plugin.

2 Likes

This all sounds very interesting, I’m really looking forward to it.

1 Like

Well you have also tested some of it. I fixed issues with the Rainbow Rod; the only thing left is server-side collision detection.

I can probably implement Team-LOS has well, as an option at least, so that you can see what teammates see. It can make long-ranged players play support for melee or close-range teammates, as they will be able to see enemies near their teammate.

2 Likes