Tracking players behind walls

Here we see two teams of circles preparing for a bloodshed, the blunt blues and radical reds. But at this point, only two of them see each other. Hence, the ones painted with white are invisible to the enemy but can see the opposing spotted circles.
I’m about to make a system for my isometric shooter that tracks which players are hidden behind bricks and their characters turn invisible to the opposing team. I’m not too sure of the approach I’m about to take, so I’ll ask the local geniuses here first.

What I had in mind was binding raycast check to a renderstep, checking a ray between every opposing teams players heads per player (per renderstep).
Would this be a bit too heavy performance?
I’d also like to have it so they turn visible only if you face towards them. Any ideas on that?

can you tell me why?
your methode seems good.
but if this is somekind of anti cheat
it wont work, as the player might be invisible, the cheat`s dont care about it being invisible

I want enemies behind walls to be hidden.

I’m just concerned that in 10v10 its 10 magnitude checks per player on every render step, that might be bit heavy for the engine?
And speaking of anticheats, it should be ran on server end instead of client, right? Don’t know much about exploiting and what’s possible and what’s not.

Could you explain why you need a system like this? It should be done locally and is not a solution against cheats.

Not to be a solution against cheats. But I simply need to get enemies behind walls invisible for the team. But checking a raycast via serverscript and using remote events to make enemies invisible locally per player is what I’m suggesting. Bad idea?

1 Like

First things first, you could definitely just do it on the client because it doesn’t really matter if a hacker is able to see other player’s circle. They could always insert their own script to be able to track other players anyways. Also I’m guessing you have a billboard gui over each player’s head, so couldn’t you just set the “AlwaysOnTop” proper of the Gui to false?

There is no billboardgui’s around yet, planning to add those for allied players but I’m not sure how that would help to hide players? It’s an isometric camera game after all. The circle thing on the opening of the post was merely an example, actual image of the game is on post #3. But since adding own trackers via exploits is quite simple, I should probably just leave everybody visible and rely on having roofs above buildings to give element of surprise a chance.

But if the character is behind a wall then you wouldn’t be able to see them any way right? I don’t really understand what you are trying to hide, is there a map or something?

Okay, I see.
As a general rule of thumb all things related to (not) rendering something should be done on the client. Doing this through the server would cause a noticeable delay and put strain on the server, without providing any real benefit. A hacker can still know every player’s position.
Calculate the raycasts on each client. 10 raycasts should still be fine.

Alright, this answers my question. I think I’ll just settle for leaving everyone visible. But thank you!

1 Like