Changes between Version 3 and Version 4 of SimulationRequirements


Ignore:
Timestamp:
Jan 7, 2010, 10:59:51 PM (14 years ago)
Author:
Philip Taylor
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SimulationRequirements

    v3 v4  
    11== High-level simulation system requirements ==
     2
     3''Part of the [wiki:TDD_Simulation simulation documentation].''
     4
     5This is a description of some concerns that the simulation system is designed for. Any code that interacts with the simulation system must be careful not to violate these requirements.
    26
    37=== Security ===
     
    1317In extreme unrecoverable cases like resource exhaustion, the game should (safely) terminate.
    1418
    15 === Cheat prevention ===
    16 
    17 ???
    18 
    1919=== Determinism ===
    2020
     
    2828
    2929Error situations (can't open data file, can't allocate new JS object, etc) may cause non-deterministic behaviour, but the error must be logged so we can debug out-of-sync errors.
     30
     31=== Cheat prevention ===
     32
     33There are two main ways that players can cheat:
     34 * Accessing information they shouldn't have access to (e.g. details of their enemies' units that are hidden in the fog-of-war)
     35 * Modifying the world in ways they shouldn't be able to (e.g. giving themselves extra resources, or causing an enemy's unit to decide to turn around and walk away)
     36
     37It's impossible to prevent people reading information, so we can just try to make it harder (e.g. by expecting people to run officially validated binaries with some anti-debugger tricks etc). The simulation system is concerned with preventing unfair state modifications.
     38
     39Since multiplayer is based on synchronised simulation, we assume that all players are running the same basic simulation code, and we can control how it responds to inputs received over the network. (If they're not all the same, they'll go out of sync and the match will stop.)
     40
     41We can't stop people sending arbitrary commands over the network, so our job is to make sure the simulation code responds to those inputs in a way that makes it hard to cheat. In our model, the GUI is untrusted and can send arbitrary commands to the simulation; the only thing guaranteed by the engine is that each command will be associated with a player ID, which correctly matches the network client the command was received from. The simulation code therefore has sole responsibility for validating the actions against the player ID - make sure players can only move their own units, can only attack enemy units, can only build buildings in clear terrain and when they have sufficient resources, etc. The GUI might do some similar checks to provide immediate feedback to the user, but that must never be relied on.