What are the limits on various things?

Jump to navigation Jump to search

Many people ask about the various limits on different features. Here is a more-or-less complete list of all the limits on various things in an OHRRPGCE game.


All graphics, including heroes, walkabouts, enemies of each size, weapons, attacks, portraits, tilesets and backdrops, are limited to 32767 graphics sets. (See also What are the correct sizes for each type of graphics?)

Frame limitations:

  • Walkabouts may have 8 frames: 2 in each direction
  • Hero sprites have 8 frames: Standing/Walk Frame A, Walk Frame B, Attack A, Attack B, Cast/Use Item, Defend, Hurt, Dead
  • Enemy sprites all have 1 frame
  • Weapons have 2 frames
  • Attacks have 3 frames animated any number of ways


You can have up to 32767 master palettes, only one of which can be used at once. Each master palette contains 256 colours from the usual 24-bit RGB colour-space. It can also be modified in-game. You can have 32767 16-color palettes, with colours chosen from the active master palette.


Starting with release rusalka, you can have up to 32767 maps. (In version quaternion and older, the limit was 100 maps.)

Map width and height must multiply together to a number less than or equal to 100000. for example, 200*100 = 20000, is okay, but 600*200 = 120000, is not allowed.

Each map can have up to 16 layers, numbered 0 to 15. You can select how many layers are drawn on top of the hero and NPC sprites.

You can define 9999 zones (bitmaps) per map, numbered 1-9999. No more than 15 zones may overlap at any tile on the map.


You can have up to 32767 tilesets. Each layer of a map can optionally use a different tileset. (You can change tilesets with plotscripting using the load tileset command.)


You can have up to 32767 songs, which can be any of BAM, MIDI, OGG, or various Module formats: IT, S3M, MOD and XM. MP3 and WAV are also supported by automatically converting to OGG. See: BAM

Only one song may play at once (no cross-fading), a limit imposed by our music libraries.

Sound Effects[edit]

You can have up to 32767 sound effects. They are in OGG format, but you can also import WAV and MP3 files and they will be converted. There is a 1 MB limit on each imported sound effect.

The number of sound effects playable at once depends on the music backend (at least 16). Each sound may only play once at a time, simply because we forgot to allow it.


You can have 4 heroes in your active party at a time. You can have 41 heroes in your party at once, including both active and reserve heroes. You can have 512 heroes defined in your whole game. Each hero you create in CUSTOM may appear in the party any number of times (that is, up to 41). The party size limits were imposed by memory limits in the old DOS version, and persist for historical reasons.


There's no limit on the number of NPCs defined for each map. You can place more than one copy of the same NPC in different places on the map. There is a maximum of 300 total NPC "instances" per map. So yes, you can actually create more NPCs than you can use on a map.

See also: Plan for raising NPC-per-map limits


There is a maximum of 100 doors per map. However, you can have up to 200 door links leading away from a map, with any number per door. This is so that the same door can lead to different places depending on conditionals.


You can define up to 32767 attacks.

An attack can do up to 2147483647 damage (unless a Damage Cap is set), however the enemy and hero editors let you specify a maximum of only 32767 HP. (You can use Cure attacks to increase HP above that.)


You can define up to 32767 enemies.

Enemy Formations[edit]

You can combine your enemies into up to 32767 formations.

Enemy Formation Sets[edit]

You can combine your formations into up to 255 formation sets. This limitation is because the formation set number has to be stored in 8 bits of data.


Starting with version ypsiliform the limit is 32000 items.

There are up 600 slots in your inventory (up to 600 types of items in your inventory at a time), although you can lower it if you want. This was a limit imposed by the SAV format, and it will be raised further in the future.

You can have up to 99 instances of each of those items in each slot of your inventory. That is just a screen-space limit, plus it is longstanding RPG tradition. If you gain more than 99 of an item, the next 99 will fill another slot in the items menu, and so on. You can also reduce the maximum stack size of an item.

See also: Plan for increasing item limit


There are 16000 normal tags. (Tags 0 and 1 are special, 2-15999 are customizable). In old games you need to turn on the "Don't limit maximum tags to 999" backwards-compatibility bitset to access all of them.

One-time usable NPCs[edit]

You can have up to 15999 one-time usable NPCs, numbered from 1 to 15999.

See also: Plan for increasing available tags


Your game can contain more than 16383 scripts. The script interpreter can handle up to 128 scripts at a time, with up to 8192 local variables in total (including recursive scripts). Unlike ancient versions, there's effectively no limit on the size (or length) of scripts or on the total size of the running scripts.

Subscripts can be nested up to four deep (that is, a script/plotscript can contain a subscript containing a subscript containing a subscript containing a subscript). There's no limit to the number of subscripts in a script.


You can have up to 50001 global script variables (numbered 0 to 50000).

Global and local variables are signed 32-bit integers, which means they can take values from -2147483648 to 2147483647.

Each script can have up to 100 local variables including arguments, but not including any local variables defined in subscripts. Scripts can have up to 32 arguments.

Script strings[edit]

You can use 100 different embeddable "plotstrings" at a time, numbered from 0 to 99. However, you can use the create text command to display (or store) an unlimited number of strings at a time. There is also a plan for replacing plot-string strings with real strings in any full-fledged programming language (which will of course remove the 100 string limit). There is no limit on the length of a string

Script timers[edit]

You can use up to 100000 timers. See the allocate timers command.

Text boxes[edit]

You can have up to 32767 text boxes.


You can have up to 32768 shops defined (numbered 0-32767) and each shop can contain up to 50 items/heroes (file format limitation). Before the fufluns release, the max allowed shop ID was 99


Each hero can have up to 4 spell lists, each containing up to 24 spells.


You can define up to 32767 vehicle types, but the number of vehicles you can actually place is limited by the number of NPCs per map.


The maximum amount of money the party can carry is 2000000000. This is the largest neatly rounded number that can fit in a signed 32 bit number. (2147483647 is the real largest 32-bit number, but 2 billion seemed cleaner)


You can have up to 32767 menus, but are limited to a total of 32767 menu items for all menus combined. For example, if you created 128 menus that each had 256 menu items, you would not be able to create any more menu items.


Since ichorescent there is a limit of 221 ≈ 2.1 million slice handles (effectively, the number of slices you can create) existing at once.

However, if you create too many slices, your game will run too slow. The number of slices that is "too many" will vary depending on the speed of your computer, the types and sizes of the slices, and the complexity of the scripting you are performing on them. For example, you can fill the whole screen with 320x200=64000 rectangle slices of size 1*1 and probably still run at 30 fps, but if you tried to iterate over all those slices every frame with a script it would be very slow. Setting slices to invisible (or better still, children of an invisible slice) mostly prevents them from being processed by the engine, but a million invisible slices will still cause a game to lag.

Most slice attributes, such as X, Y position, size, and padding can store any number from -2147483648 to 2147483647 if set by a script, but the slice editor imposes some additional limits.

See Also[edit]