High scores: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Added category.)
(De-stubbified)
 
Line 1: Line 1:
{{Stub}}
ZZT has the ability to save the '''high scores''' for worlds. The scores are stored in files named <code>[world name].HI</code>.
 
If a <code>.HI</code> file exists, the high score list are loaded when a world is initially loaded. The list can be viewed by pressing <code>H</code> on the [[title screen]].
 
If the player gets a [[game over]], the player's [[score]] is greater than zero, and the player's score is not less than the 30th place score, then the player is given the chance to input their name. The text "-- You! --" is displayed on the line where the player's score is. If the player's score is tied with another, then the newer score takes precedence on the list.
 
If a player opts not to enter a name for their high score, their high score is saved to the file regardless. However, since the high score window only displays scores with a name longer than zero characters the score will be effectively invisible, but it will still count against the 30 score limit. The score can still be seen by inspecting the file with a hex editor.
 
High score files have no internal means of verifying they are associated with the correct world, nor any sort of anti-tampering measures.


== File Format ==
== File Format ==


High scores for a given world are stored in a file named <code>[world name].HI</code>. Each entry in the high score table has the following format:
Each entry in the high score table has the following format:


{|class="wikitable"
{|class="wikitable"
Line 16: Line 24:
|}
|}


This format of NameLength, Name, High Score repeats 30 times, from the highest score to the lowest.
This format of NameLength, Name, High Score repeats 30 times, from the highest score to the lowest. A proper high score file should be exactly 1590 bytes in size.


[[Category:File formats]]
[[Category:File formats]]

Latest revision as of 03:38, 26 December 2025

ZZT has the ability to save the high scores for worlds. The scores are stored in files named [world name].HI.

If a .HI file exists, the high score list are loaded when a world is initially loaded. The list can be viewed by pressing H on the title screen.

If the player gets a game over, the player's score is greater than zero, and the player's score is not less than the 30th place score, then the player is given the chance to input their name. The text "-- You! --" is displayed on the line where the player's score is. If the player's score is tied with another, then the newer score takes precedence on the list.

If a player opts not to enter a name for their high score, their high score is saved to the file regardless. However, since the high score window only displays scores with a name longer than zero characters the score will be effectively invisible, but it will still count against the 30 score limit. The score can still be seen by inspecting the file with a hex editor.

High score files have no internal means of verifying they are associated with the correct world, nor any sort of anti-tampering measures.

File Format

Each entry in the high score table has the following format:

Offset Hex Data type Description
0 0x00 UINT8 NameLength
Length of the name entered for the high score.
1 0x01 char[50] Name
Name associated with the high score. While the format allows 50 characters to be stored, a maximum of 34 characters may be input on the name entry screen. Due to the reserved space when displaying scores, names 37 or more characters will begin to print over the window's border and into the board area. Up to 43 characters will be drawn to the screen this way, with any additional characters remaining completely hidden.
51 0x33 INT16LE High Score
The numeric value of the high score.

This format of NameLength, Name, High Score repeats 30 times, from the highest score to the lowest. A proper high score file should be exactly 1590 bytes in size.