Limits

Every size, count and budget, with its number.

Sizes are binary. 1 KB is 1,024 bytes and 1 MB is 1,048,576 bytes.

The ZIP #

LimitValueWhat it limits
zip.bytes16 MBThe largest mod ZIP, compressed.
zip.unpacked_bytes64 MBWhat every file in one mod adds up to, unpacked.
zip.files2,000 filesThe most files one mod may hold. Folder entries and repository files (rule repo_files: hidden names starting with a dot, __MACOSX, Thumbs.db, node_modules, and at the top README.md, CHANGELOG.md, LICENSE and the media folder) are dropped first and not counted.
zip.path_bytes160 bytesThe longest path inside a mod, after the one top folder is stripped. ASCII only.

Files #

LimitValueWhat it limits
file.manifest_bytes64 KBThe largest mod.json.
file.json_bytes256 KBThe largest .json file other than mod.json.
file.lua_bytes512 KBThe largest .lua file.

JSON #

LimitValueWhat it limits
json.depth32 levelsHow deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

Switched-on mods #

LimitValueWhat it limits
mods.enabled32 modsThe most mods switched on at once.
mods.enabled_unpacked_bytes96 MBEvery switched-on mod together, unpacked, on a computer.
mods.enabled_unpacked_bytes_phone24 MBEvery switched-on mod together, unpacked, on a phone or a low-memory device.

Messages #

LimitValueWhat it limits
messages.lines256 linesThe most lines in one mod's messages file.
messages.key_bytes48 bytesThe longest line key.
messages.text_bytes400 bytesThe longest line, in UTF-8 bytes. Lines wrap by width, not by a count of characters. A row holds 180 pixels of the game's font, which is about 24 letters. Narrow letters like i and l take less room, and wide ones like W and m take more. A page holds 4 rows.

Shops #

LimitValueWhat it limits
shops.stock6 goodsThe most goods in one block for the flower shop: one per bench spot.
shops.blocks8 blocksThe most blocks in the list one shop takes in shops.json.
shops.lines8 linesThe most lines in one slot of a block's "lines". The keeper says one of them each time.
shops.percent_max1,000 percentThe highest price_percent or buy_back_percent.
shops.name_chars40 charactersThe longest shop name (the flower shop's door sign), in Unicode code points.
shops.line_chars160 charactersThe longest shop line (a slot of "lines"), in Unicode code points.
shops.line_newlines3 newlinesThe most line breaks in one shop line.
shops.price_max99,999 BellsThe highest price a mod shop may ask. The game raises a price below its own buy-back to the buy-back. The buy-back is what Nook pays for the item.

Scripts #

LimitValueWhat it limits
lua.memory_bytes4 MBMemory one mod's script may use. Over it, the script stops for the session.
lua.memory_total_bytes16 MBMemory every mod's script together may use.
lua.budget200,000 instructionsInstructions one mod may run per event, counting all its handlers for that event together. The main chunk gets its own count. Library work is charged too: every 64 bytes allocated, every 4 pattern-matching steps and every element a table function touches. An allocation the memory limit refuses is charged too: one instruction for every 64 bytes the script holds. Over the limit, the script stops for the session.
lua.deadline_ms250 millisecondsWall-clock backstop on a script's main chunk, for time the instruction count cannot see: one long call into C, or a garbage collection. The instruction budget is what stops a main chunk that does too much. On a slow device it is stretched by the device's pace (lua.pace_frame_ms).
lua.handlers_per_event16 handlersThe most handlers one mod may register for one event.
lua.log_per_event20 linesMod log lines kept per event for one mod: its log() lines and the refusals written when it called cmd.* or timer.*. The rest are dropped, and the log says so once.
lua.log_per_session500 linesMod log lines kept per mod per session: log() lines and every refusal of its commands and timers. A script stop is always written.
lua.event_deadline_ms125 millisecondsWall-clock backstop on one event run, for time the instruction count cannot see: one long call into C, or a garbage collection. The instruction budget is what stops an event run that does too much, and it counts the same on every device. On a slow device it is stretched by the device's pace (lua.pace_frame_ms). A busy device does not stop a mod that stays inside its budget.
lua.frame_budget_ms4 millisecondsLua time all mods together get per frame. Once it is spent, every game event without an answer waits for the next frame, and villager_talked is skipped for the rest of that frame. command_finished and question_answered always run. It never stops or strikes a mod. At least one waiting event runs each frame, so on a slow device events wait longer but still run.
lua.slow_run_ms8 millisecondsAn event run longer than this is a strike. On a slow device it is stretched by the device's pace (lua.pace_frame_ms).
lua.slow_runs3 strikesStrikes in a row before the script is stopped ("kept the game waiting"). A run under the limit clears the strikes.
lua.pace_frame_ms4 millisecondsThe game's own work per frame that counts as full speed. Mods' Lua time is left out of it. When the game's recent frames take longer (a slow phone, a busy machine), the wall-clock limits are stretched. The stretch is recent frame work divided by this, from 1 up to lua.pace_stretch_max. It applies to lua.deadline_ms, lua.event_deadline_ms and lua.slow_run_ms. The frame cap and the instruction budget are never stretched.
lua.pace_stretch_max8 timesThe most a slow device stretches the wall-clock limits. At this stretch an event run's backstop is 1 second and a strike is a run over 64 ms.
lua.deferred_events64 eventsEvents waiting for a later frame. Past that, an event is dropped and logged.

The store #

LimitValueWhat it limits
store.bytes8 KBThe whole store of one mod in one town, store.player's values included. The whole store.client of one mod has the same limit. A set that would go over is refused and changes nothing.
store.key_bytes64 bytesThe longest store key.
store.value_bytes1 KBThe longest string a store value may be.
store.towns16 townsTowns whose mod data one browser keeps. Writing a 17th drops the file of the least recently written other town.
store.towns_bytes1536 KBWhat every town's mod data in one browser adds up to. Writing past it drops the least recently written other towns' files first. Mod data therefore never pushes a save over the cloud's 5 MB.

Other #

LimitValueWhat it limits
items.per_mod64 itemsItems in one mod's items file.
items.total512 itemsMod items across every switched-on mod.
items.renames64 renamesEntries in one mod.json "renames".
items.texture_files16 filesPictures in one mod item's own textures folder (its "textures" setting), counting the files in its subfolders.
textures.label_chars40 charactersThe longest label before a texture name in a mod, as in bookshelf-top_tex1_32x32_626709d910129694_$_8.png. A label is lowercase letters, digits and dashes, then one underscore.
textures.png_side2,048 pixelsThe longest side of a PNG texture.
textures.png_decoded_bytes96 MBDecoded pixels of every mod's PNG textures together, on a computer. A PNG past it is left out and named on its mod's row.
textures.png_decoded_bytes_phone24 MBThe same on a phone or low-memory device.
textures.dds_bytes96 MBImage bytes of every mod's DDS textures together on a computer, as the graphics card holds them. Only the first mip level counts: 1 byte a pixel for BC7 and DXT5, half a byte for DXT1 and 4 bytes uncompressed. A DDS past the limit is left out and named on its mod's row. The HD pack does not count.
textures.dds_bytes_phone24 MBThe same on a phone or low-memory device.
settings.per_mod16 settingsSettings one mod declares.
depends.per_mod16 modsMods in depends, in optional_depends and in conflicts, each.
data_version.max1,000,000 versionThe largest data_version.
remote.copy_bytes64 KBData a remote.call copies each way.
remote.functions32 functionsFunctions one mod offers with remote.add.
exports.per_mod32 functionsRemote functions one mod.json "exports" lists. It is also the most that remote.add offers.
exports.description_chars120 charactersOne "exports" description, on one line.
nook.stock16 goodsThe most goods in one block for Nook's store.
visitors.stock6 goodsThe most goods in one block for a visiting seller (Crazy Redd, Saharah, the fireworks stall).
letters.per_file32 lettersLetters in one letters file.
letters.header_chars24 charactersA letter header, not counting {player}.
letters.body_chars192 charactersA letter body or a board notice.
letters.body_lines6 linesLines on the letter paper or a board page.
letters.footer_chars32 charactersA letter footer.
letters.sender_chars8 charactersA letter's name in the mailbox list. It is the letter's optional sender. Without a sender, it is the footer's first 8 characters.
calendar.per_file16 daysDays in one calendar file.
talk.pools32 poolsPools in one talk file.
talk.lines_per_pool32 linesLines in one pool.
talk.line_chars160 charactersA page of a villager line (a pool's or a script's), in Unicode code points. It may have at most 3 line breaks. A line that is one string is one page, wrapped to as many windows as it needs.
commands.per_event4 commandsCommands one mod may queue in one event.
commands.sounds_per_event2 commandsplay_sound calls one mod may make in one event. They count toward commands.per_event too.
commands.sounds_per_minute10 commandsSounds one mod may play in any 60 seconds of the player's real clock, the ones waiting to play included. A sound counts when the game plays it. One refused does not count. A sound has no daily limit.
commands.waiting32 commandsCommands waiting, all mods together.
commands.waiting_per_mod8 commandsCommands one mod may have waiting.
commands.letters_per_day3 commandssend_letter per mod per game day in each town. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule. A command counts when the game applies it, and the count is kept across a reload. A command lost with a closed tab before then never counts. The limit check adds the commands still waiting. A command refused for where the player is (The City, a visit) does not count.
commands.items_per_day5 commandsgive_item per mod per game day in each town. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.
commands.lines_per_day20 commandsshow_line per mod per game day in each town. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.
commands.asks_per_day10 commandsask per mod per game day in each town. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.
commands.take_items_per_day6 commandstake_item per mod per game day in each town. A take counts when its question is shown, whatever the player answers. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.
commands.take_bells_per_day6 commandstake_bells per mod per game day in each town. A take counts when its question is shown, whatever the player answers. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.
commands.take_item_count15 itemsThe most pieces of one item a single take_item may ask for. It is the number of pockets.
commands.take_bells_amount99,999 BellsThe most Bells a single take_bells may ask for. It is the most a wallet holds.
commands.weather_per_day4 commandsset_weather per mod per game day in each town. A change counts when the game changes the weather. One refused, or one that found the town already in that weather (via unchanged), does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule: a sky that changes every few minutes is no weather.
commands.saves_per_day32 commandssave per mod per game day in each town. A save counts when the game writes the town. One refused, or one that found nothing changed (via unchanged), does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule: every save also uploads the town to the cloud.
commands.save_spacing_seconds10 secondsThe least time between two saves by mods, all mods together, on the player's real clock. A save asked for sooner is refused with command-too-soon. A refused save does not start the wait; one that found nothing changed does.
timers.per_mod16 timersThe most timers one mod may have waiting in one town.
timers.minutes_max10,080 minutesThe longest a timer may wait, in game minutes. It is 7 game days. A timer never waits longer than this from any moment, so a clock set back cannot strand one.
timers.name_bytes40 bytesThe longest timer name. A name is letters, digits, _, - and . only.
timers.data_bytes240 bytesThe longest text a timer's data may be.
commands.letter_chars192 charactersA letter's text. It must also fit the letter's 6 lines of 192 pixels.
commands.letter_from_chars8 charactersA letter's signature, also the mailbox list's sender. It is one line. A line break or another control character is refused.
commands.line_bytes400 bytesA show_line text.
commands.ask_chars120 charactersAn ask question.
commands.choice_chars16 charactersOne answer of an ask.
commands.choices_min2 answersThe fewest answers an ask may offer.
commands.choices_max4 answersThe most answers an ask may offer.
commands.papers64 papersLetter papers, numbered 0 to 63.
commands.hat_side32 pixelsThe width and the height of a picture cmd.set_hat puts on the hat or cmd.set_shirt on the shirt. It must be exactly this size, the size of an Able Sisters design.
commands.hat_colors16 coloursThe most colours a hat or shirt picture may have, as a design. Every pixel must be opaque. Colours are kept at 5 bits a channel, as the game keeps a design's.
commands.hat_file_bytes64 KBThe largest PNG file cmd.set_hat or cmd.set_shirt reads. A 32 x 32 picture is far smaller.
calendar.board_per_day3 noticesBoard notices that go up on one day across every mod. The first ones in load order go up. On a full board, a mod notice first takes the place of an earlier day's mod notice. It never pushes off a page dated today.
talk.line_newlines3 newlinesThe most line breaks in a page of a villager line (a pool's or a script's).
talk.pages8 pagesPages in one villager line, when the line is a list of pages (a pool line, or a line a script returns). Each page starts on a clean window.
talk.villager_chars8 charactersA pool's "villager" name, as the game spells it.
items.price_max99,999 BellsThe highest price an item in a mod's items file may have.
manifest.name_chars60 charactersThe longest mod "name", in Unicode code points, spaces at the ends not counted.
manifest.authors8 namesThe most names in "authors".
manifest.author_chars40 charactersThe longest name in "authors", spaces at the ends not counted.
manifest.description_chars500 charactersThe longest "description".
manifest.tags5 tagsThe most different tags in "tags".
settings.label_chars60 charactersA setting's "label", spaces at the ends not counted.
settings.description_chars200 charactersA setting's "description".
settings.choices_min2 choicesThe fewest "choices" a choice setting lists.
settings.choices16 choicesThe most "choices" a choice setting lists.
settings.choice_chars40 charactersOne choice of a choice setting, on one line.
settings.text_chars200 charactersThe largest "max_length" a text setting may ask for.
settings.number_max1,000,000,000 numberA number setting's "min" and "max" lie within minus this and this.
depends.range_bytes64 bytesThe longest version range in depends or conflicts.
depends.range_parts4 comparisonsThe most comparisons in one version range, like ">=1.0.0 <2.0.0" (two).
commands.reacts_per_minute10 commandscmd.react per mod per minute of the game clock. A reaction the game refused does not count. It is a safety limit, so a mod cannot keep a player reacting in a friend's town or The City.