Jump to content

Btrieve

From Galactic Empire wiki

Btrieve is the indexed record-storage system used by Galactic Empire and MajorBBS. GE saves players, ships, planets, and mail as records in separate files. Unlike a table queried with SQL, a Btrieve file is accessed through operations such as finding a record by a key or stepping to the next or previous record in key order.

The same file can have several keys. For example, GE can find a player by user ID, while the user database's score key lets ROSTER walk players in score order. The game does not need to load every player and sort the list itself. When a stored score changes, the database updates that key's ordering. This is why a key's field offset and signedness matter: they affect lookup and order, not just how bytes are saved. See Scoring and rosters and Data structures for GE's specific records and keys.

GE's .DAT files are therefore not plain text, and the separate team file is an exception: it is a text table, not Btrieve. On 32-bit systems, the Btrieve call interface is known as WBTRV32. MBBSEmu uses the open-source WBTRV32 replacement, which preserves the Btrieve-style calls while storing the live data in SQLite .db files. See Database files for filenames, backups, and resets.

See also