OB3

OB3 is the 3D model file format used by RuneScape Classic for scenery during most of its development lifespan, up until its closure. It is the successor to the earlier OB2 file format, used early in 2001, and also by earlier Jagex games, such as the Games Domain Castle. Compared to OB2, OB3 offers greater opportunities for compression, making it important in the dial-up era of the early 2000s.
Like most RuneScape Classic file formats, OB3 is a simple binary format using big endian byte order for integers.
Features
[edit | edit source]OB3 supports a maximum of 65535 vertices and faces per model. Each face can have an arbitrary number of vertices, allowing the RSC game engine to support square polygons as well as the standard triangular polygons.
The front and rear of each face can have a separate "fill" defined, which is either a solid colour, a texture, or invisible. When lighting the scene, an intensity can be applied for each face as well. Colour is supported with 15-bit precision (meaning it's not perfectly "true colour").
It does not support true animation. Animated sequences are achieved through either rotation (see sails), or through cycling through different models (see fire). In some cases, animated face textures are used, as in the fountain.
Format
[edit | edit source][uint16_t] num_vertices [uint16_t] num_faces [uint16_t...] vertex1 x coordinate, vertex2 x coordinate... [uint16_t...] vertex1 y coordinate, vertex2 y coordinate... [uint16_t...] vertex1 z coordinate, vertex2 z coordinate... [uint16_t...] face1 vertex count, face2 vertex count... [uint16_t...] face1 front fill, face2 front fill... [uint16_t...] face1 back fill, face2 back fill... [uint16_t...] face1 intensity, face2 intensity... [variable...] face1 vertex index 0, face1 vertex index 1, face2 vertex index 0...
If the number of total vertices in the model is below 256, the face vertex indices are stored as an unsigned byte, and otherwise as an unsigned 16-bit integer.
Fill encoding
[edit | edit source]The RSC 3D engine has a custom way of encoding RGB colours into 15 bits (five bits per red, green, and blue component), which are then made negative. This allows easily distinguishing textured polygons from those with a solid colour fill, because the solid colour fill will always be negative. Textures always point to a specific texture index.
A magic number (32767) is used to indicate faces which have no fill.
Trivia
[edit | edit source]- OB3 is quite similar to the Wavefront OBJ format in concept.
- RuneScape 2 used an identically named model format that had a completely different feature set and representation.
- Usually, 3D models are made from triangles, and sometimes quads. However, OB3 models are constructed from polygons with an arbitrary number of points. Some models use polygons with as many as 16 points, as well as odd numbers like 7.
| Features | |
| File formats | |