Highscore file format

From Stunts Wiki
Revision as of 21:12, 16 April 2011 by 91.36.240.64 (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This Article describes the File Format of the Highscore files used by all versions of Stunts. Each Track has its own Highscore Table.

Offset Data Type Length Field Name Description
0 CHAR[17] (ASCIIZ) 17 Name Driver's Name, terminated with a NUL Character
17 CHAR[21] (ASCIIZ) 21 Car Driver's Car, terminated with a NUL Character
38 CHAR[4] 4 Unknown Unknown Data is stored Here
42 CHAR[8] (ASCIIZ) 8 Opponent
50 UCHAR[2] 2 Time

The 4. Field (Opponent has the following structure:

Offset Data Type Length Field Name (or constant) Description
0 CHAR[2] 2 Opponent ID
2 CHAR 1 Character '/'
3 CHAR[4] 4 Opponent Car
7 CHAR 1 NUL Character

The Size of an Entry is 52 Bytes. Every Highscore File contains exactly 7 Entries = 364 Bytes per File. The 5. Field (Time) is expressed in Hundreds of a Second, and is calculated as following:

   TIME = time [1] * 1280 + time [0] * 5

To convert this time to normal min:sec:hundreds format, use the following calculations (hundr contains the time in hundreds):

    hundreds = (hundr % 100)
    hundr /= 100
    sec = (hundr % 60)
    min = (hundr / 60)
Personal tools