Notations and some important data structures used in Habbo Hotel
Habbo Avatar Figure Notation (HAFN) v2 is a standard for the text-based string notation designed to represent Habbo avatar appearances using compact, dot-separated codes. Each string encodes structured data that represents figure parts, set IDs, and optional color IDs, and it is based on the data exposed by the figuredata
currently available.
While HAFN v2 reflects how avatar figures are encoded in Habbo URLs and backend systems, it is not an official Sulake notation, and future changes may not be adopted by Sulake.
This specification exists to formalize and document how Habbo encodes avatar figure strings for rendering and customization purposes. It is:
figuredata
files.HAFN v2 is a textual representation of avatar configuration that enables:
It DOES NOT include aditional elements such as avatar actions and visual effects, as described in Section 8.
This document is aimed at developers, archivists, modders, and enthusiasts in the Habbo community working on avatar-related tools and experiences. Familiarity with string manipulation and XML parsing (for reading figuredata
) is recommended.
HAFN v2.0 defines the current known structure of Habbo avatar strings, based on the parsing behavior seen in Habbo Hotel and customizable through the figuredata
file.
HAFN is community-maintained. While it matches current usage patterns, Sulake may change the format at any time. Future extensions will aim to preserve backward compatibility whenever possible.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
An implementation is considered HAFN v2.0 compliant if it adheres to the syntax, validation logic, and resolution rules defined in this document. A conforming parser implementation:
figuredata
structure.figuredata
.A valid HAFN v2.0 string MUST:
figuredata
.An HAFN v2 string encodes the full appearance of a Habbo avatar. It consists of multiple figure parts, separated by dots (.
). Each part encodes a type, set ID, and up to two color IDs.
The following Extended Backus-Naur Form (EBNF) defines the syntax of HAFN v2.0:
<figure> ::= <part> ("." <part>)*
<part> ::= <type> "-" <setId> [ "-" <colorId1> [ "-" <colorId2> ] ]
<type> ::= "hr" | "hd" | "ch" | "lg" | "sh" | "ea" | "cc" | ... ; (see figuredata)
<setId> ::= <positiveInteger>
<colorId1> ::= <positiveInteger>
<colorId2> ::= <positiveInteger>
Field | Type | Description |
---|---|---|
type |
String | A valid part type as defined in figuredata |
setId |
Integer | A valid set ID belonging to the specified part type |
colorId1 |
Integer | A valid first color ID (MAY be required depending on the part) |
colorId2 |
Integer | A valid second color ID, OPTIONAL (for parts with two color layers) |
Each part MUST match an existing set
entry in the figuredata
file under the corresponding <settype type="...">
.
The following regular expression can be used to validate the general structure of an HAFN v2.0 string:
(?:[a-z]{2}-\d+(?:-\d+(?:-\d+)?)?)(?:\.(?:[a-z]{2}-\d+(?:-\d+(?:-\d+)?)?))*
Each part is separated by a dot (.
). The parser MUST:
.
to extract individual parts-
to determine its type, set ID, and optional colorsfiguredata
structurefiguredata
under <settype type="...">
paletteid
referenced by that part’s set definitionError Code | Description |
---|---|
ERR_UNKNOWN_TYPE | type not found in current figuredata |
ERR_INVALID_SETID | Set ID not defined for given type |
ERR_INVALID_COLOR | Color ID not valid for palette used in set |
ERR_FORMAT_SYNTAX | Missing - , bad delimiter use, invalid part format |
ERR_PART_INCOMPLETE | Missing required set ID or color ID |
An HAFN-compliant parser MUST reject invalid strings and report an appropriate error.
Consider the following example HAFN v2.0 string:
hr-890-45.hd-600-10.ch-665-1408.lg-716-1408-1408
Explanation:
hr-890-45
→ Hair, set ID 890, color 45hd-600-10
→ Head, set ID 600, color 10ch-665-1408
→ Shirt (chest), set 665, color 1408lg-716-1408-1408
→ Pants (legs), set 716, dual color 1408The avatar could have way more parts defined:
hr-802-37.hd-180-1.ch-3030-1408.lg-3023-64.sh-3068-1408-64.ea-1403-1408.cc-3280-64-1408.cp-3284-64
Explanation:
hr-802-37
→ Hair, set ID 802, color 37hd-180-1
→ Head, set ID 180, color 1ch-3030-1408
→ Shirt, set 3030, color 1408lg-3023-64
→ Pants, set 3023, color 64sh-3068-1408-64
→ Shoes, set 3068, primary color 1408, secondary 64ea-1403-1408
→ Glasses, set 1403, color 1408cc-3280-64-1408
→ Coat, set 3280, primary color 64, secondary 1408cp-3284-64
→ Print, set 3284, color 64
There are other aspects related to the avatar figure that are not covered by this specification, such as clothing items that uses multiple parts, avatar actions (e.g., laying, sitting, waving, dancing), and visual effects. These elements are not present in the notation itself and should be considered as purely informative in this document, they do not define or alter the notation in any way.
Below are links to relevant data sources used to compute or render these elements. Further documentation may be written to explain them in more detail:
Future versions MAY include:
Revisions to the specification SHALL be versioned appropriately, and backward compatibility MAY be maintained where possible.
Although HAFN v2 is a textual notation and does not execute code, implementations MUST sanitize and validate input strings rigorously to prevent issues such as:
Important
HAFN v2 strings do not verify clothes or color ownership. They represent appearance only and should not be used to enforce access or ownership of figure parts.
Strict adherence to the syntax and processing guidelines is required for safe implementation.
figuredata
XML, Habbo.com. Available at: https://www.habbo.com/gamedata/figuredata/1external_flash_texts
Definition, Habbo.com. Available at: https://www.habbo.com/gamedata/external_flash_texts/1This document was developed with contributions from:
v1
to v2
to let the v1
be the numeric-based notation.The following table lists the currently supported two-letter identifiers used for avatar figure parts, along with their names, icons, and examples.
Category Name | Category Icon | Subcategory Identifier ▲ | Subcategory Name | Subcategory Icon | Examples |
---|---|---|---|---|---|
Torso | ![]() |
ca |
Jewelry (top accessories) | ![]() ![]() |
|
Torso | ![]() |
cc |
Jackets | ![]() ![]() |
|
Torso | ![]() |
ch |
Shirts | ![]() ![]() |
|
Torso | ![]() |
cp |
Prints | ![]() ![]() |
|
Head | ![]() |
ea |
Goggles (eyewear) | ![]() ![]() |
|
Head | ![]() |
fa |
Masks (face accessories) | ![]() ![]() |
|
Head | ![]() |
ha |
Hats | ![]() ![]() |
|
Body | ![]() |
hd |
Face & Body | ![]() ![]() ![]() ![]() |
|
Head | ![]() |
he |
Accessories | ![]() ![]() |
|
Head | ![]() |
hr |
Hair | ![]() ![]() |
|
Legs | ![]() |
lg |
Trousers | ![]() ![]() |
|
Legs | ![]() |
sh |
Shoes | ![]() ![]() |
|
Legs | ![]() |
wa |
Belts (bottom accessories) | ![]() ![]() |