What are the limits on various things?
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.
- 1 Graphics
- 2 Backdrops
- 3 Palettes
- 4 Maps
- 5 Tilesets
- 6 Songs
- 7 Sound Effects
- 8 Heroes
- 9 NPCs
- 10 Doors
- 11 Attacks
- 12 Enemies
- 13 Enemy Formations
- 14 Enemy Formation Sets
- 15 Items
- 16 Tags
- 17 One-time usable NPCs
- 18 Scripts
- 19 Text boxes
- 20 Shops
- 21 Spells
- 22 Vehicles
- 23 Money
- 24 Menus
- 25 Slices
- 26 See Also
All 16-color paletted graphics, including heroes, walkabouts, enemies of each size, weapons and attacks are limited to 32767 graphics sets. (See also What are the correct sizes for each type of graphics?)
- 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
See also: Plan for raising sprite frame limits
You can have up to 32767 backdrops (battle & textbox backgrounds)
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.
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.
The number of sound effects playable at once depends on the music backend (at least 8). 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.EXE 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.
You can combine your enemies into up to 32767 formations.
Enemy Formation Sets
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.
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
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). The maximum size of a single compiled script is 256KB (which is a few times more than all the scripts in Wandering Hamster put together), besides this there is no script buffer limit.
Subscripts can be nested up to four deep (that is, a script/plotscript and four subscripts). There is 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.
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
You can use up to 100000 timers. See the allocate timers command.
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 (This is a WIP feature)
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.
The only realistic limitation on slices is memory and speed. If you add 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 arrangement 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.
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.