Spatial Data Model

Space is the interface for accessing spatial data in the game universe.

A Space contains Entities.

Entities can have some shape, defined by zero or more vertexes (2D or 3D, although 2D vertexes could just be a 3D vertex with height set to zero, or the local height of the terrain).

Entities can have the following kind of Shape:
 * Points - a single location, and a direction. Located at some vertex.
 * May have some data values.
 * Used for: Characters, Creatures, Trees, Stones, etc.
 * Has a simple bounding sphere or cylinder used for collisions.
 * Lines - a continuous line, possibly with many vertexes. May have branching lines that connect to it by using shared vertexes.
 * May have some fixed data values, or data values that are interpolated between data values located at each vertex or at the start and end vertex.
 * Used for: Roads, Rivers, City walls, etc.
 * Areas - a continuous(?) area defined by a number vertexes. Can be triangulated.  Has a border line.  May have lines connecting to it by sharing vertexes with the border line.
 * May have fixed data values, or data values that are interpolated between data values located at each triangulated vertex, or at the edge vertexes.
 * Used for: Fields, Lakes, City Blocks, Neighbourhoods, Cities.
 * Shell - a three dimensional volume, possibly with some openings. Can contain Volumes inside.
 * Used for: Buildings, Ships, larger Vehicles, Tunnel hmmand Cave entrances etc.
 * Has a more complex collision shape than Point. The collision shape can have portals that allow entering some space inside the shell, or seeing into the inside space.
 * Fields - a function spanning the whole space
 * May have some fixed or location specific data values.
 * Used for: Ground height, water height?, snow thickness, wind, air pressure, etc.

Containers

 * Spatial Container - a container that has entities laid out in some 3D formation.
 * Implementations: Room Space, Planet Space, Stellar Space.
 * Entity Container - no specified three dimensional structure, just contains a list of Entities. Can be exposed to the outside world through some connection? (making it a simple Component actually)
 * Used for: Inventories, item processing machines, storage cabinets, etc.
 * Can not contain areas or lines, or points located at some vertex, just
 * Component Container - no three dimensional structure, just contains components / entities that are connected to each other. May contain connections that are exposed to the outside space.  (Not sure if we need this).
 * Used for: Machines, Bodies, etc.
 * Can not contain areas. Note that components may be laid out in a 2D structure in a design though, and are connected with line type connectors..

Spatial Containers

 * Room Space - has a convex area, with a floor, ceiling, and walls.
 * The floors, ceilings, or walls can have openings in them, connecting this volume to Spaces
 * Used for: Rooms, Tunnels, Caves, etc.
 * Planet Space - contains a ground plane that wraps around. Is connected to a Stellar Space if one goes high enough upwards.
 * Used for: Planets, moons, stars, very large space ships (Death Star style).
 * Stellar Space - a stellar system or similar, with some stars, planers, moons, asteroid belts, rings, and such, which can orbit each other. If one approaches a planetary body (or star) close enough, one enters the Planet Space for that planetary body.
 * Areas don't make much sense in stellar space..

Relative locations:

- A feature could be located relative to another feature (contained in it?) (if the original feature is transformed, so is the contained one).

Views

 * A view on the spatial data would contain the features that are visible in the area of the view, at the resolution of the view.
 * The view could be listened to for changes also.
 * We might want both a top-down view with constant resolution, and a perspective view from an observer with resolution inversely proportional to the distance

Implementation
[22:39] The data model implementation would have to be able to take features from different sources (generated, stored data, etc), and be able to store changes to apply to one or more features..