How to prevent cheating in our (multiplayer) games?

前端 未结 3 417
春和景丽
春和景丽 2020-12-04 07:09

If you are writing a game you should think about cheaters and how to prevent them from cheating.

I don\'t think only the mmo multiplayer games but also singleplayer

3条回答
  •  生来不讨喜
    2020-12-04 07:58

    When the game is based on completely a server-client architechture, the job is almost done I think, but there is also wall hacks or something else.

    If you cannot move most of the logics to run on the server-side, at least try to share as little state as realistically possible during each game play phase, in other words: keep each player's active game mode into account and only share information that's actually relevant at that time.

    This will not only reduce the possibility to cheat, but also reduce the traffic caused by your protocol, i.e. it will improve the efficiency.

    This is a technique that in itself has long been known and applied in the gaming/simulation industry to improve efficiency when rendering large 3D scenes.

    There, "frustum culling" is used to determine which parts of a scene are actually visible, so that only the relevant parts are rendered.

    Similarly, the same technique can be used to restrict multiplayer clients to only receive certain updates/information if they are actually relevant, e.g. if other clients are actually within a "range of relevance", so that other clients may retrieve corresponding updates.

    Still, differentiate between relevance and "visibility": two players separated by a door may not actually "see" eachother, but depending on the surroundings, may very well hear eachother. So, differentiate between different types of "visibility": propagating audible state doesn't necessarily have to imply propagating the player's actual position in game coordinates. The same applies vice versa: only because you 'see' a player, you are not necessarily entitled to also hearing the client (e.g. imagine a scope on a rifle).

    In other words, try to loosely couple the update packets that you support, so that they don't have mutual dependencies on one another, and can also be propagated/subscribed to independently.

    Cheating can be largely controlled just by applying proper encapsulation and data hiding mechanisms, so that multiplayer clients do not generally share global state, but shared state is instead directly dependent on the player's active context (position, heading, orientation, speed etc).

提交回复
热议问题