#    Settings for the codeblock mod, shown under Mods in the advanced settings.
#
#    GENERATED by scripts/gen_settingtypes.lua. Do not edit this file: edit a
#    default in lib/config.lua or the wording in that script, and run it again.
#
#    Everything here bounds what one player program may do, except the two under
#    Appearance. They are read once, when the mod loads, so a change needs a
#    server restart.
#
#    The per-codelevel limits take four numbers separated by commas, one for
#    each codelevel from 1 (novice) to 4 (poweruser). A value that is empty, or
#    that is not four numbers, is ignored with a warning in the log and the
#    built-in default is used instead. doc/api.md describes what each one does.
#
#    The engine does not read this file for defaults - it only parses it to draw
#    the settings menu, and a mod setting the menu has never written reads back
#    as unset. So the values below are copies of the real defaults in
#    lib/config.lua, which is why they are generated rather than kept in step by
#    hand.

[Codelevel]

#    Codelevel a player is given on first join. 1 to 4.
#    Leave empty for the built-in default, which is 3 in singleplayer - where
#    the player is the administrator, but has no use for the widest ceilings
#    there are - and 2 on a server, where an unvetted joiner would otherwise
#    arrive holding a large share of every limit below.
codeblock_default_auth_level (Default codelevel) string

[Files]

#    Largest program file, in kilobytes, that will be read from or written to a
#    player's directory. Not a limit on a running program: it bounds the read
#    itself, which is paid for three times over - the file, the copy kept in
#    memory, and the formspec the editor sends to the client. A program a person
#    edits is kilobytes. Nothing saved from the editor can exceed 640 kB in any
#    case, that being the engine's own ceiling on a formspec submission.
codeblock_max_file_kb (Maximum program file size) int 128 1 640

[Pacing]

#    Milliseconds the drone waits after each command. Zero is no wait. This is
#    what makes the novice codelevels slow enough to watch; it costs the server
#    nothing, as a waiting drone is not running.
codeblock_pace_ms (Pace between commands) string 250,5,0,0

#    Microseconds one drone may spend advancing its program per server step. A
#    cap, not an allowance: a drone gets the smaller of this and its share of
#    the server budget below.
codeblock_step_budget_us (Step budget per drone) string 1000,2000,4000,8000

#    Microseconds per server step for all running drones together, divided
#    equally among them. Without it, each new drone costs the server another
#    full budget. A dedicated server steps roughly every 90000 microseconds.
codeblock_server_step_budget_us (Step budget for all drones) int 16000 1000 90000

[Work limits]

#    Seconds of running time one program gets. Counted as time the drone was
#    actually advanced, not wall clock, so pacing and a busy server do not eat
#    into it. This is what stops a program that never finishes.
codeblock_max_runtime_s (Maximum running time) string 30,60,120,300

#    Nodes one program may write. Also the ceiling on a single shape, since
#    neither a shape's dimensions nor the drone's distance are limited.
codeblock_max_nodes_written (Maximum nodes written) string 100000,500000,1000000,50000000

[Memory limits]

#    Megabytes of map one program may hold. Touching a node pins its 16 KiB
#    mapblock in the server's memory, and this is the only limit that can see
#    that: the heap limit below measures Lua memory, and a mapblock is not on
#    the Lua heap. The engine unloads an idle mapblock by itself, so a program
#    over this ceiling is slowed down rather than stopped.
codeblock_map_memory_mb (Maximum map footprint) string 16,64,128,512

#    Lua heap growth, in megabytes, one program run may cause. Checked when the
#    drone yields, so it catches a program that accumulates rather than one that
#    allocates everything in a single call.
codeblock_heap_mb (Maximum heap growth) string 16,64,128,512

#    Largest string, in megabytes, a single call may produce. Covers the single
#    allocation the heap limit cannot see.
codeblock_max_string_mb (Maximum string size) string 1,8,16,64

[Appearance]

#    Whether a player who has set no preference of their own sees the drone HUD
#    while their program runs: the file, whether it is running or paused, and
#    what the run has spent of each of the three limits that can stop it. On,
#    because it is the only place a running program's budget can be seen, and it
#    leaves the screen the moment the program ends. A player's own choice, made
#    in the editor, overrides this.
codeblock_drone_hud (Drone HUD) bool true
