This topic is about collecting ideas and requirements for the portalengine of the game. The goal is to generate a xml structure which contains several definitions of segments and containing portals.
The base of the definitions is a segment. For this we define entities inside. The xml file should not contain geometrical data such as polygons, meshes or vertices. An exception must be made for portals, these must contain geometrical data.
So first we need to determine which entities exist:
Entity types:
- room (part of a section)
- door (allow/deny access to a portal)
- portal (a transition point to another segment)
Next we have basic data for each entity:
- position in the segment - 3D coordinate
- direction of the entity - 3D vector
And we need special data for each entity:
...todo... (first determine all types of entities)
current state:
Code:
(element) segment-list (segment+)
(element) segment (portal+, entity+)
- (attr) name (required) string
(element) entity (model, door) - contains any object
- (attr) class (required) string - class/group of entity
- (attr) name (required) string - a name to identify it
- (attr) pos (required) 3DPoint - position point relative to segment
- (attr) dir (required) 3DVector - alignment/direction as vector
- (attr) state (optional) bool - object is initial on or off (on if missing)
(element) model - data of a model file conected with an entity
- (attr) file (required) string - name of file to be loaded
- (attr) scale (optional) double - scaling of model (1 if missing)
- (attr) pos (optional) 3DPoint - position of model (0,0,0 if missing)
- (attr) dir (optional) 3DVector - direction of model (1,1,1 if missing)
(element) door - door data if entity class is "door"
- (attr) portal (required) string - name of the portal that is connected with this door
- (attr) target (required) string - name of the segment and door in this segment this door is connected to (example: "seg0:door1")
(element) portal (shape) - defintion of a portal
- (attr) class (required) string - class/group of portal
- (attr) name (required) string - a name to identify it
- (attr) target (required) string - name of the segment and portal in this segment this portal is linked to (example: "seg0:portal1")
(element) shape - defintion of portal geometry
- (text) - list of vertices (simply all edge points in a row like "1,1,0 -1,1,0 -2,-2,0 1,-1,0" must be in the same plane)
entity classes
Code:
- empty - default room entity
- solid - a single object
- door - a door
- group - ?
feel free to add or modify