7.5.1 Components of a World
This section describes the objects used to build a world. This is useful to
understand the format of the Crystal Space map file
(see section 7.6.1 Format of Map File (XML)). To understand this you should know the basics of
the 7.5.2 Portal Engine. This section describes the components of the world
independent from the file format, so it is also useful if you want to build a
world from within your program.
The world is built up from the following objects:
-
Sectors. For details, see the portal engine discussion
(see section 7.5.2 Portal Engine). Basically sectors define an area
that can contain several geometrical objects. As opposed to earlier
versions of Crystal Space, a sector does not itself represent geometry.
Instead all geometry in a sector is made from Mesh Objects.
Theoretically a sector is infinite although in practice it is usually
logically bounded by sector walls or a sky object.
-
Mesh Objects. See the mesh object section for more specific information
about them (see section 7.7 Mesh Object Plug-In System). Mesh objects represent geometry in some
sector. Everything you can see (walls, actors, particle systems, ...) is
represented by some kind of mesh object. This is a very important concept
in the Crystal Space engine. Mesh objects can also be hierarchical.
A mesh object can have several children which in turn can also have children
and so on. The children of a mesh object are positioned relative to the
parent. So when you move the parent the children will automatically move
with the parent.
-
Mesh Object Factories. Mesh object factories are objects that
can be used to create mesh objects that inherit characteristics
from their mesh factory. Basically a mesh object factory is like
a blue-print for creating a mesh object. Mesh factories can also
be hierarchical like mesh objects.
-
Portals. Again see the portal discussion (see section 7.5.2 Portal Engine) but
the idea is that sectors are normally totally independent areas
unless you connect them through portals. Portals are currently implemented
inside the Thing Mesh Object. There you can assign a portal to some
sector to a single polygon.
-
Light Sources. There are different ways how light is applied to objects
to increase performance. See section 7.5.3 Lighting.
-
Collection Objects. These are simply groups of other objects. Do not
confuse them with hierarchical objects.
-
Regions. A region is also a collection of objects but the purpose
is different (as opposed to collections). A region can contain textures,
materials, mesh objects, mesh factories, lights, collections, sectors,
sequences, triggers, shared variables, .... Regions are useful when you
want to load/unload big parts of a world dynamically. This can be used in
cases where the world is too big to fit in memory and you want to use dynamic
loading.
-
Key/value Pairs. A key/value pair is a
{key,value} tuple describing some game specific concept.
Key/value tuples are represented by a pair of strings. If you have
built levels for Quake before, you are probably familiar with this concept
from Quake's Entities. Almost all objects in the Crystal Space
engine support these key/value pairs so you can attach this kind of
information to anything. Crystal Space itself will not use this information
but your game can query it and perform the appropriate actions.
In theory it is up to your program as to how these key-value tuples
are interpreted. However, Crystal Space has set some standards to make life
easier for level designers and also to make levels as portable as possible
between different Crystal Space games. See section Keylist Standards.
-
Nodes. A node represents a point in space. The engine itself will not
use nodes but a game can use them to represent game specific data.
The Thing Mesh Object is probably the most important mesh object
as it can be used to define how the basic structure of your world looks
like. Here is a list of concepts that are related to Things:
-
Polygons. Things are made from polygons. To define such an
object you enumerate all polygons that make up the geometry of such thing.
-
Portals. As mention above portals are a special case of
polygons that point to some other sector (or sometimes the same
sector in case of a mirror).
-
Texture Planes. Polygons in a thing are texture mapped
using a transformation from object to texture space. A texture
plane describes this transformation. You can directly specify texture
planes but more usually you use uv mapping coordinates to do this.
Keylist Standards
This section describes some guidelines for key/value tuples.
The most important key is the `classname' key. It tells the program the
type of an object. All the following guidelines are set for special object
classes. If you don't agree with them, you should use different classnames.
The following classnames are standardized:
@@@FIXME: Write this.
This document was generated using
texi2html