How do they make entities like Eyes from Doors with respect to the client-server system?

(Hopefully a similar thing hasn’t already been asked since I couldn’t find any)

So I’m making a horror game, and I want to make an entity that has similar mechanics with Eyes from the game Doors. I already have some ways to make it in my mind, but I’m unsure about the server-client issues.

I mainly concern about how should I make the mechanic with respect to the client-server system. Such as following:

Make it server-based:

  • Secure.
  • Unlikely able to be exploited.
  • Can lead to unwanted outcomes due to network latency.

Make it client-based:

  • Devoid of network issues.
  • CAN be exploited.

Should I make it in another way?

You can use the dot product to see if you are looking at the entity and maybe cast a raycast to see if there’s anything in the way. These methods aren’t that resource demanding so there shouldn’t be a lot of problems.
If you were to do it on the client side then it really wouldn’t matter if exploiters exploited this entity as it wouldn’t be ruining other player’s experience imo.

2 Likes

The problem isn’t about how I make it as I said earlier, its about how do I prevent exploitation if I’m to make it client-based. Though, it’s true that it doesn’t affect other players. Thanks for the suggestion!

If you’re going to make it purely client-based you are sacrificing security and potentially inviting malicious activity.

If you’re this concerned about latency issues, why not just have the entity require a player to look at it for x seconds before dealing damage instead of damaging the player as soon as they make visual contact? This way, there is more flexibility for latency issues, and you don’t have to worry about client-side cons such as desync. Latency shouldn’t be a big issue here anyways, and if it is, that player likely has more to worry about anyways.

As @cakeycocoa mentioned, client-side implementation would at most allow bad actors to ignore the entity, so if you don’t care about someone being able to permanently render this entity harmless, go for it. Frankly, I would implement it server-side and just eat the latency issues.

Any visual effects that come from this, however, should be client-sided, full stop.

2 Likes

Yeah thats indeed how I planned.

You can’t necessarily determine what direction a client’s camera is facing. This is an unavoidable issue that forces you to develop such an entity on the client. The same issue occurs with A-90 and the server’s inability to determine precise mouse movements.

Doors doesn’t have any persistent global leaderboards, and most other entities are server-sided, so in light of providing a good experience for the player-base, I would consider an endeavour to exploit-proof 1-2 entities unproductive.

The only entity I would attempt to apply sanity checks to is A-90, as the server can confidently determine movement and physical rotation; albeit physical rotation can be managed by the exploiter

@TheRealGavintalks

2 Likes

So what you’re trying to suggest is that I should not run server-side checks for this entity? sorry if I misunderstood

For the Eyes entity, it is not worth applying server-sided checks. The client may be facing the entity, but line-of-sight cannot be confirmed

1 Like