|
| |
| Map & Actor File Specifications (v0.2) |
| The map and actor file specifications are currently in an intermediate state. As more
features are added to the engine, they are sure to change. Tools will be available within
the next few releases for converting simple .OBJ files to actor and map files. However, the tool will
only convert the vertices, normals, and texture coordinates into the correct format initially. Other
things such as portals, actors in maps, lights in maps, etc, will have to be placed by hand until better map editing
tools are made available.
|
| |
| Map Specification v0.2 (.e3m) |
| For a good example, see pongroom.e3m in the Pong Clone game |
| |
| Tags available in a mapfile as of v0.2 are as follows: |
|
# is a comment in the mapfile. A line beginning with this will be ignored.
TEXTURESET A textureset is a text file that defines the path to a texture and gives it an aliased name.
That aliased name is what is used in the mapfile (and engine for that matter) when refering to a texture.
SECTOR A sector is a logical grouping of triangles, portals, actors, particle systems, etc. Each
sector in the map must be given a unique sectorID. This makes it possible to link portals to other sectors via their ID.
In a portal algorithm such as the one present in E3D, it is necessary to have these well defined for good performance because
the engine calculates and renders the minimal number of sectors possible from the camera actor's viewpoint. So,
think of a sector as a room in a map. This sector is connected to other sectors by things called portals. Portals
are sort of like doorways to other sectors. As an actor crosses this invisible portal, the engine will automatically
update that actors current sector to be in the linked sector.
For more information you can search on portal rendering algorithms.
TRIANGLE A triangle is the basic geometry of objects in E3D. A triangle is defined by its 3 (x, y, z) vertex coordinates,
its 3 (u, v) texture coordinates, and a texture name as aliased in the maps textureset.
ACTOR To load an actor from a mapfile, a copy of it must first be preloaded in the engine (this can be seen in the Pong clone).
Then, when the map loader encounters an actor, it uses the name (2nd parameter) of the actor tag, looks it up in the engine, and
creates and inserts a copy of the preloaded actor into the engine with the specified position, forward, and up vectors.
Actors are defined by their registered name, id (the id of the actor once in the engine), an (x, y, z) position coordinate,
an (x, y, z) forward vector (this should be normalised!) which will be used to rotate the actor to match that up vector, and an
(x, y, z) up vector (this should be normalised!) which will be used to rotate the actor to match that up vector AFTER it rotates to
the forward vector. The up and forward vectors should be at right angles to each other and normalised.
PARTICLESYSTEM To load a particle system from a mapfile, a copy of it must first be preloaded in the engine similarly to an actor.
Then, when the map loader encounters the particle system, it uses the name (2nd parameter) of the ps tag, looks it up in the engine, and
creates and inserts of copy of the preloaded particle system into the engine with the specified position, forward, and up vectors.
Particle systems currently do not have an ID within the engine. They are simply kept on a list. It was assumed that any sort of
particle system that is loaded in a mapfile probably won't need to be grabbed and modifed quickly. For more dynamic particle systems (ones that
move around for example), loading them programmatically and holding onto the reference to the PS for modification is more suited. If
it turns out that many people would like the PS's ID'd, then that could be added in future versions.
PORTAL A portal defines links between sectors. Portals are rectangular. A portal must be defined in both sectors being linked (eg: a portal
points to another portal in another sector). Map files should be broken into logical sectors
for efficient rendering via a portal algorithm present in the engine. A portal is defined by its name (or ID) in the map,
the type of portal is either FAST or ACCURATE (FAST is the only supported portal at this point!), the ID of the sector
the portal is linking to, the portalID of the portal this portal is linking to in the linked sector, and the 4 (x,y,z) vertex coordinates
that make up the 4 corners of the portal. Currently portals do not translate or rotate a linked sector to "line up" with
the portal something collided into (this will come in the future). So, to get the results I expect you desire from portals (seemless links between sectors),
linked portals should have the same vertex coordinates.
|
| |
TEXTURESET [textureSetName] [NOJAR, JAR] /*JAR means that the textures/texSet are defined within a jar */
SECTOR
[sectorID]
{
TRIANGLE
[vAX] [vAY] [vAZ], [vBX] [vBY] [vBZ], [vCX] [vCY] [vCZ],
[tcAU] [tcAV], [tcBU] [tcBV], [tcCU] [tcCV], [texturesetTexName]
#List all the triangles in the fashion described above. Note the seperate lines. Actors and maps will eventually be much more similar in style
ACTOR
[actRegdName], [actID], [posX] [posY] [posZ], [forX] [forY] [forZ], [upX] [upY] [upZ]
#List all the actors in the fashion described above
PARTICLESYSTEM
[psRegdName], [posX] [posY] [posZ], [forX] [forY] [forZ], [upX] [upY] [upZ]
PORTAL
[portalName], [portalType], [linkSector], [linkPortal], [vAX] [vAY] [vAZ], [vBX] [vBY] [vBZ], [vCX] [vCY] [vCZ], [vDX] [vDY] [vDZ]
#List all portal in the fashion described above
#LIGHT is currently unavailable but will be used to add lights to a sector. Lights must be added programmatically in v0.1*/
}
#List all sectors in the fashion described above
|
| |
| Actor Specification v0.2 (.e3a) |
| For a good example, see goal.e3a in the Pong Clone game |
| |
| Tags available in actor files as of v0.2 are as follows: |
|
This is subject to change in following versions to look more like a mapfile. Comments are currently unsupported in actor files
TEXTURESET A textureset is a text file that defines the path to a texture and gives it an aliased name.
That aliased name is what is used in the actorfile (and engine for that matter) when refering to a texture.
MODEL This indicates the start of an actors model. Only 1 model per actor file is currently supported
TRIANGLEA triangle is the basic geometry of objects in E3D. A triangle is defined by its 3 (x, y, z) vertex coordinates,
its 3 (u, v) texture coordinates, and a texture name as aliased in the maps textureset.
| | |
TEXTURESET [textureSetName] [NOJAR, JAR]
MODEL
{
TRIANGLE [vAX] [vAY] [vAZ], [vBX] [vBY] [vBZ], [vCX] [vCY] [vCZ],
[tcAU] [tcAV], [tcBU] [tcBV], [tcCU] [tcCV], [texturesetTexName]
#List all the triangles in the fashion described above. Unlike maps, the entire def of each item is on the same line... */
#Bones, etc, will be defined in here once implemented */
}
|
| |