Initial commit.
[existenz.git] / DESIGN.md
1 # Virtual 3D address space
2
3 Each *plane* is a separate space where objects exist and actors can
4 move around.  Each *plane* is a torus, i.e. at the end of the address
5 space the coordinates wrap around.  *Cells* are the smallest unit which
6 can be mapped to servers, which simulate them.  The association between
7 cells and servers is done via DNS(?).  The same risks apply.
8
9 Clients receive and send sensations and actions from and to *virtual
10 addresses*, which are then routed to the underlying servers.
11 *Subscriptions* define which messages a client is interested in.
12 Servers may serve less events in case permissions or the simulation
13 itself don't allow for them to be served to a particular client (think
14 visibility or fog of war).
15
16 *Federation* between servers in the grid is necessary to handle overlap
17 and transition between cells as well as event relay to adjacent cells.
18
19 All *objects* in the world are instances of *blueprints* from the server
20 database.  Blueprints are cryptographically signed packages of assets,
21 code and other metadata, which can be taken with you from server to
22 server.  A server might not run your objects, but could give you a
23 temporary replacement.  Ownership and trust is managed analogous to
24 Bitcoin and the GPG web of trust.  Your identity is linked to an account
25 on another server, which manages your assets, however only concensus
26 opinion is ultimately valid as a proof of ownership etc.
27
28 Special rules depend on the server settings.
29
30 The common protocol allows for integration of various quality levels,
31 assets and other web infrastructure.
32
33 # Limits
34
35 - Coordinates:  -2^62+1 to 2^62-1 signed integers used as fixed point
36   floats where the basic unit is 1000, i.e. down to millimeter scale.
37   This presumably allows faster/smaller implementation on languages with
38   GC and tagged representation of fixnums.
39 - Cells:  Depends on hardware limits and base scale, e.g. in the area of
40   1km to 10km cubes.  However given the current state and in the
41   foreseeable future cells of this size should be good enough.  Future
42   iterations may co-locate cells on the same server and/or raise the
43   cell sizes.
44
45 # Protocol
46
47 - Events:  Binary frames in custom protocol.
48 - World information, objects, etc:  Might be shared as structured text
49   form data, i.e. SEXP/JSON/XML.
50 - Content exchange:  Via direct connection, server download, or
51   distributed, i.e. Bittorrent.
52
53 A single server instance can run one or more cells.  From the point of
54 view of a client a proxy can distribute load and provide a single
55 address to access a network of simulated cells.
56
57 +---------------------------------------------+  +-------..
58 | +--------+ +--------+ +--------+ +--------+ |  | +--------+
59 | |CELL ...| |CELL 23 | |CELL 24 | |CELL ...| +--+ |CELL ...|
60 | +--------+ +--------+ +--------+ +--------+ +--+ +--------+
61 |                  SERVER 1                   |  | SERVER ...
62 +------+------------+------------+------------+  +----+--..
63        |            |            |                    |
64   +----+-----+ +----+-----+ +----+-----+              |
65   |CLIENT ...| |CLIENT 42 | |CLIENT ...+--------------/
66   +----------+ +----------+ +----------+