Skip to content

OES (OpenEQ Standard Format)

Cody Brocious edited this page Jul 31, 2018 · 15 revisions

The OES (OpenEQ Standard Format) is designed to encompass every feature of the legacy EverQuest file formats, while greatly simplifying loading and rendering.

Note on datatypes

Values in all little endian. Strings are represented with a 32-bit unsigned length, followed by that number of UTF-8 bytes. Bools are 32-bit, where 0 is false and anything else is true. Floats are 32-bit, vector types are floats.

Overall structure

OES files are contained within a compressed archive (PKZip by default), with the initial OES file being named main.oes. Other OES files, textures, and more might be present in the archive.

The OES file itself is set up as a tree of atoms, each one having the structure:

  • byte[4] typecode -- This is the type of atom
  • u32 id -- Atom ID (must be unique per file)
  • u32 dataSize -- Size of atom data in bytes
  • u32 childSize -- Total size of children in bytes
  • u32 childCount -- Number of children
  • byte[dataSize] data -- Atom-specific data
  • Atom[childCount] children -- Child atoms

Types of atoms

N.B. If the typecode listed here is <4 bytes, it is padded with spaces (0x20) at the end. E.g. "imp" becomes "imp ".

  • root -- Root node
  • ref -- Atom reference
  • imp -- Import
  • mat -- Material
  • fx -- Effect
  • tex -- Texture
  • zone -- Zone
  • regn -- Region
  • char -- Character model
  • obj -- Object
  • inst -- Object instance
  • lit -- Light
  • skin -- Skin
  • mesh -- Static mesh
  • aset -- Animation set
  • amsh -- Animated mesh
  • abuf -- Animation buffer

Root Node

Simple container for cases where you want to have multiple top-level atoms for an OES file, e.g. a collection of character models.

Atom Reference

This references an atom, replacing the reference node with the atom it references.

  • u32 id -- Atom ID to reference

Import

This loads an OES file from the current archive, replacing the import node with the nodes from the referenced file.

  • string filename -- Filename of OES file to import, including extension

Material

Represents a single material, which may be made up of zero or one effect and zero or more textures. If no effect is present, default rendering will occur.

  • bool alphaMask -- Discards fragment if alpha < 0.5
  • bool transparent -- Is transparent (forward rendered, sorted back-to-front)
  • bool emissive -- Is emissive (not affected by lighting)

Effect

Represents an effect, in the form of a single fragment shader.

  • string name -- Name of an effect (pre-built into engine/OpenEQ)
  • u32 paramCount -- Number of parameters
  • EffectParam[paramCount] params -- Effect parameters

EffectParam struct

  • string name -- Parameter name
  • EffectParamType type -- Parameter type
  • T value -- Parameter value, of the type indicated by type

EffectParamType enum

  • U32 -- 0
  • Float -- 1
  • Vec2 -- 2
  • Vec3 -- 3
  • Vec4 -- 4
  • Mat4x4 -- 16
  • String -- 64

Texture

Represents a texture, loaded by file from the current archive.

  • string filename -- Filename of the texture to load

Zone

Represents a single zone instance. Must contain one skin.

  • string name -- Name of the zone

Children: Regions, meshes, object instances, lights, exactly one skin

Region

Represents a region of the zone, by a set of bounding planes, where the interior of the region is defined by being on the positive side of all planes.

  • u32 planeCount -- Number of bounding planes
  • vec4[planeCount] planes -- Bounding planes
  • vec3 ambientColor -- Ambient color for the zone
  • RegionFlag regionFlag -- Flag for the region
  • string targetZone -- If region is a zoneline, this contains the destination zone name, otherwise empty

RegionFlag enum

  • None = 0
  • Water = 1
  • Lava = 2
  • ZoneLine = 3
  • PvP = 4

Character Model

Represents a character model, containing some number of meshes, at least one animation set, and at least one skin.

The order of animated meshes in the object must match the order of the corresponding animation buffers in the animation sets.

  • string name -- Optional name of the character model

Object

Represents a placeable object, containing some number of meshes and at least one skin.

  • string name -- Optional name of the object

Object Instance

Represents a single object instance.

  • u32 id -- ID of Object node
  • string skinName -- Name of object skin, or empty if default
  • vec3 position -- Position of object
  • vec3 scale -- Scale of object
  • vec4 rotation -- Quaternion describing rotation of object

Light

Represents a point light.

  • vec3 position -- Position of the light
  • vec3 color -- Light color
  • float radius -- Light radius
  • float attenuation -- Attenuation of light (TODO: Define properly)

Skin

Maps materials to meshes. This node must be placed alongside mesh nodes, which will automatically be mapped to the materials present inside the skin atom.

  • string name -- Name of the skin, or empty if default

Static Mesh

Represents a single static, indexed mesh.

  • bool collidable -- Indicates if the mesh should be used for collisions
  • u32 indexCount -- Number of indices in the index buffer
  • u32 vertexCount -- Number of vertices in the vertex buffer
  • uint[indexCount] indexBuffer -- Indices for mesh
  • float[vertexCount * 8] vertexBuffer -- Interleaved vertex position (vec3), normal (vec3), and UV texture coords (vec2)

Animation Set

Represents one named animation. Must be contained within a character model node. Must contain one animation buffer per animated mesh associated with the character.

  • string name -- Name of the animation
  • float speed -- Frames per second

Animated Mesh

Represents a single animated, indexed mesh. Must contain at least one animation buffer; the first will be used as the default pose for the mesh.

  • bool collidable -- Indicates if the mesh should be used for collisions
  • u32 indexCount -- Number of indices in the index buffer
  • u32 vertexCount -- Number of vertices in the vertex buffer
  • float speed -- Frames per second for animation. This is ignored if animation sets are in use.
  • uint[indexCount] indexBuffer -- Indices for mesh

Animation Buffer

Represents a set of vertex buffers for an animated mesh.

  • u32 frameCount -- Number of frames (must be > 0)
  • u32 vertexCount -- Number of vertices (must match the animated mesh with which this buffer is associated)
  • float[frameCount][vertexCount * 8] vertexBuffers -- Each frame is a vertex buffer containing interleaved vertex position (vec3), normal (vec3), and UV texture coords (vec2)
Clone this wiki locally