Memory limits

From Wiki of ZZT
Revision as of 07:27, 4 January 2026 by Asie (talk | contribs) (Created page with "ZZT features a number of memory limits owing to the limitations of its 16-bit DOS platform and its programming. These limits are typically increased by patched builds, forks and source ports. The wiki discusses the limits as they apply to official ZZT builds, in particular ZZT 3.2. == Board size limit == The maximum size of a board is '''20000 bytes''', excluding the two-byte size header at its beginning. This is caused by the memory buffer used to serialize world...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ZZT features a number of memory limits owing to the limitations of its 16-bit DOS platform and its programming.

These limits are typically increased by patched builds, forks and source ports. The wiki discusses the limits as they apply to official ZZT builds, in particular ZZT 3.2.

Board size limit

The maximum size of a board is 20000 bytes, excluding the two-byte size header at its beginning. This is caused by the memory buffer used to serialize worlds having that size - larger boards are possible, but corrupt dynamically allocated memory past the serialization buffer.

Remember that this serialization happens every time a player tries to exit the board, using both board edges and passages, as well as whenever a player chooses to save the game. A board's size also changes dynamically as stats get created and destroyed, as well as when elements are placed and removed.

World size limit

The maximum size of a world is bound only by the 640 kilobytes of conventional memory present on a DOS. This memory consists of:

  • memory used by DOS,
  • memory used by drivers and resident programs,
  • static memory used by ZZT itself,
  • dynamically allocated memory for storing all boards of a loaded world,
  • dynamically allocated memory for storing the current board's state: object code and text window contents.

As some versions of ZZT have less code and data than others, they can allow loading slightly larger worlds. In particular, SoftDisk's Worlds of ZZT is comped without

To check the amount of free memory at any time, use the ?+DEBUG cheat. Here are some measurements of applying this cheat on an empty world in various emulated environments:

ZZT 3.2 free memory on a default empty world
Environment ?+DEBUG Notes
MS-DOS 6.22 + HIMEM m391650 DOS=HIGH,UMB, no other drivers
FreeDOS 1.4 m315762 Empty CONFIG.SYS and AUTOEXEC.BAT
FreeDOS 1.4 + HIMEMX m436082 DOS=HIGH,UMB + SHELLHIGH, no other drivers
DOSBox v0.74-3 m448931
Zeta 1.1.2 m549906 Zeta cheats by offering 736 kilobytes of conventional memory and an effective DOS memory size close to zero.

Rule of thumb advice is as follows:

  • A world under 300 kilobytes should run on most reasonable DOS configurations.
  • A world under 350 kilobytes should run on most DOS configurations adjusted for running games which require a lot of conventional memory.
  • A world under 400 kilobytes should run on most specialized DOS configurations for maximizing conventional memory.
  • A world above around 420 kilobytes will not run on most DOS configurations achievable in the real world.

Text window line limit

The maximum number of lines that may be displayed in a text window is 1024. This also acts as an effective limit on the number of world files that may be present in ZZT's directory, as demonstrated in this video.