Reference
Limits
Every number of the computers: speed, memory and its costs, screens, storage, network, events and the hard limits of the language.
Every limit of the computers and of the language, in one place. The last column names the file of the mod where the number is set, for the curious. The server owner can change a few of them in world/serverconfig/computingages-server.toml: they are marked "config".
#The six computers
| Computer | os.tier() | Instructions per tick | Per second at 256 RPM | Memory (cells) | Stress (su per RPM) |
|---|
| Tube Computer | 1 | 20 | 400 | 2,048 | 16 |
| Transistor Mainframe | 2 | 80 | 1,600 | 8,192 | 8 |
| Minicomputer | 3 | 300 | 6,000 | 32,768 | 4 |
| Personal Computer | 4 | 1,200 | 24,000 | 131,072 | 2 |
| Microcontroller | 4 | 400 | 8,000 | 16,384 | 1 |
| Modern Computer | 5 | 5,000 | 100,000 | 1,048,576 | 1 |
| Computer | Screen | Text (columns × rows) | gfx drawing (pixels) | Storage | Network |
|---|
| Tube Computer | paper teletype | 40 × 14 | none: no gfx | Punch Card Deck, 4 KB | none |
| Transistor Mainframe | green phosphor | 51 × 19 | 306 × 171 | Magnetic Tape Reel, 16 KB | none |
| Minicomputer | amber phosphor | 51 × 19 | 306 × 171 | Floppy Disk, 64 KB | Data Cable |
| Personal Computer | 16 colours | 51 × 19 | 306 × 171 | Floppy Disk, 64 KB | Data Cable, Radio Modem, Wi-Fi Router |
| Microcontroller | 16 colours | 40 × 12 | 240 × 108 | soldered memory, 16 KB | Data Cable, Radio Modem, Wi-Fi Router |
| Modern Computer | 16 colours | 64 × 24 | 384 × 216 | Solid-State Drive, 1 MB | Data Cable, Radio Modem, Wi-Fi Router |
Libraries by computer: gfx everywhere but on the Tube Computer, net from the Minicomputer on, vehicle on the Personal Computer, the Microcontroller and the Modern Computer. The stress values are the defaults of the config (one key per computer). Source: ComputerTier.java, CAConfig.java, ComputerApis.java.
#Speed
| Limit | Value | Source |
|---|
| Full speed | at 256 RPM, in either direction; faster gives nothing more | ComputerTier.java |
| Below 256 RPM | proportional: half at 128 RPM, an eighth at 32 RPM; the fractions of an instruction add up from tick to tick | Machine.java |
| No rotation, or overstressed | the computer is frozen: no instruction, timers and sleep paused | ComputerBlockEntity.java |
| Cost of an instruction | 1; a library call costs 1 plus its extra cost (table below) | Interpreter.java |
| Budget left when the program waits | lost for that tick | Machine.java |
| Waits already satisfied | the program resumes in the same tick, 16 times per tick at most | Machine.java |
| Extra costs above the budget | a debt, paid back on the next ticks | Interpreter.java |
Changes to the world (redstone, links, set_speed) | applied once, at the end of the computer's tick; the last value asked wins | ComputerBlockEntity.java |
| Boots | one every 10 ticks at most (half a second); a quicker reboot waits | ComputerBlockEntity.java |
| Computers per server tick | 512 (config maxComputersTickedPerTick, 16 to 100,000); beyond, the others run every other tick | CAConfig.java |
Divisions are rounded down: printing 40 characters costs 1 + 2 instructions.
| Call | Extra instructions |
|---|
print, write, term.write | 1 per 16 characters |
fs.read, fs.write, fs.append | 1 per 16 characters |
fs.copy | 1 per 16 bytes copied |
import | 1 per 16 characters of the file |
string.find, string.split | 1 per 16 characters of the text |
string.rep | 1 per 8 repetitions |
table.insert at a position | 1 per 8 elements of the list |
table.remove | 1 per 8 elements after the position |
table.concat | 1 per 16 characters of the result |
table.contains | 1 per 8 elements |
table.sort without a function | about n × log2(n) for n elements |
table.sort with a function | each comparison is a call of your function |
gfx.pixel, gfx.line, gfx.rect, gfx.circle, gfx.triangle, gfx.clear, gfx.fill, gfx.scroll | 1 per 64 pixels touched |
gfx.text | characters × scale × scale |
gfx.image | 1 per row, plus 1 per 64 pixels |
os.memory | 1 + 1 per 16 cells in use (it measures the memory) |
net.send | 32, plus the walk of the network and the copy of the data |
net.broadcast | 64 + 8 per computer in reach, plus the walk and the copy |
net.computers, net.networks | 64, plus the walk of the network |
peripheral.list, peripheral.find | 16 + 4 per block touching the Data Cable network |
peripheral.wrap | 8 |
A network name (type@x,y,z) | 1 per 4 blocks touching the network |
vehicle.position, vehicle.velocity, vehicle.speed | 8 |
Inventory list, count, push | 1 per slot of the inventory |
Kinetic stress, capacity | 1 per block of the kinetic network |
The walk of the network costs 1 per block touching the computer's Data Cable network, plus, on the Personal Computer, the Microcontroller and the Modern Computer, 1 per loaded computer of the world. The copy of a message costs 1 per value plus 1 per 16 characters. Sources: the libraries (BaseLib.java, FsLib.java, StringLib.java, TableLib.java, GfxLib.java, NetApi.java, PeripheralApi.java, VehicleApi.java, DeviceAdapters.java).
#Memory
The memory of a computer is counted in cells. Only the data the program can still reach counts: a table no variable points to any more is free again.
| What | Cells | Source |
|---|
| A table | 4 | Interpreter.java |
| Each entry of a table (key and value) | 2, plus the cells of a string or table stored in it | Interpreter.java |
| A string | 1 + 1 per 8 characters (a 100-character string: 13 cells) | Values.java |
A number, a boolean, nil | nothing beyond the slot that holds it | Interpreter.java |
| A global variable | 2 + the cells of its name, plus its value | Interpreter.java |
| A function value | 4 | Interpreter.java |
| The local variables of a file (chunk level) | 1 each | Interpreter.java |
| The code of a file | 1 per 4 words of bytecode + 1 per constant + 4 per function | Proto.java |
| A call in progress | 8, plus 1 per value on the stack | Interpreter.java |
| An event waiting in the queue | 6 + 2 per field + the cells of its strings and tables | Event.java |
The libraries (math, term...) | free | Interpreter.java |
| Limit | Value | Source |
|---|
| Measuring the memory | os.memory() measures it now, at a cost of 1 instruction per 16 cells | OsLib.java |
| When the count passes the capacity | the memory is measured again; out of memory only if the live data really exceeds it | Interpreter.java |
| Receive buffer | a message is refused when it would make the waiting events take more than a quarter of the memory: 8,192 cells on a Minicomputer, 32,768 on a Personal Computer, 4,096 on a Microcontroller, 262,144 on a Modern Computer | Machine.java |
#Language
| Limit | Value | Error | Source |
|---|
| Calls inside each other | 200 | stack overflow | Interpreter.java |
| Values on the stack | 65,536 | stack overflow | Interpreter.java |
| Length of a string | 65,536 characters | string too long | Interpreter.java, StringLib.java, TableLib.java |
| Blocks and parentheses nested in the source | 200 | too many nested levels | Parser.java |
| Numbers | 64-bit floating point; printed with 14 significant digits; whole numbers below 10^15 print without decimals | | Values.java |
| Whole-number arguments | up to 2,147,483,647 | number has no integer representation | Values.java |
string.format | width of 2 digits at most, precision 99 at most | invalid conversion | StringLib.java |
string.char | codes 0 to 65,535 | value out of range | StringLib.java |
tonumber(text, base) | base 2 to 36 | base out of range | BaseLib.java |
Tables sent by net | 32 levels deep | table is too deep (or cyclic) to convert | Values.java |
#Events and time
| Limit | Value | Source |
|---|
| Tick | 1/20 of a second: os.time() counts them, os.clock() is os.time() / 20 | OsLib.java |
| Event queue | 256 events; when full, the oldest is dropped | Machine.java |
| Timers waiting at the same time | 256 (too many timers) | Machine.java |
sleep and timers | rounded up to whole ticks, 1 tick at least | BaseLib.java, OsLib.java |
net.receive(timeout) | rounded up to whole ticks, 1 tick at least | NetApi.java |
os.day_time() | 0 to 23,999 (0 is sunrise, 6000 noon) | OsLib.java |
drag events | one every 50 ms at most | TerminalScreen.java |
paste | 4,096 characters | TerminalScreen.java, ComputerBlockEntity.java |
#Screen and keyboard
| Limit | Value | Source |
|---|
| A character | 6 × 9 pixels of the gfx drawing | Terminal.java |
| Colours | 16 (see Colours) | Terminal.java |
Tab stops of print and write | every 4 columns | Terminal.java |
gfx pixel size, line thickness, text and image scale | 1 to 64 | GfxLib.java |
gfx.fill | 1,048,576 pixels at most | GfxLib.java |
gfx.text font | 3 × 5 pixels, no accents (é becomes e) | Graphics.java |
| Monitor wall | up to 8 blocks wide and 6 high: monitors of the same kind, facing the same way, forming a full rectangle | MonitorGroups.java |
A line of read() or of the prompt | 1,024 characters | LineInput.java |
| History of the prompt | 50 lines | LineInput.java |
| Distance to use a terminal | 16 blocks | ComputerBlockEntity.java |
| Screen updates sent to players | every 2 ticks at most (config terminalSyncInterval, 1 to 20) | CAConfig.java |
#Storage
| Medium | Capacity | Read by | Source |
|---|
| Punch Card Deck | 4 KB (4,096 bytes) | every computer with a drive (all but the Microcontroller) | CAItems.java |
| Magnetic Tape Reel | 16 KB (16,384 bytes) | Transistor Mainframe, Minicomputer, Personal Computer, Modern Computer | CAItems.java |
| Floppy Disk | 64 KB (65,536 bytes) | Minicomputer, Personal Computer, Modern Computer | CAItems.java |
| Solid-State Drive | 1 MB (1,048,576 bytes) | Modern Computer | CAItems.java |
| Soldered memory of the Microcontroller | 16 KB (16,384 bytes) | the Microcontroller only (it has no drive) | ComputerTier.java |
| Limit | Value | Source |
|---|
| A file or folder name | 1 to 32 characters: letters without accents, digits, _, ., -; not . or .. | FileSystem.java |
| A whole path | 128 characters, slashes included | FileSystem.java |
| Files and folders on one medium | 1,024 | FileSystem.java |
| Size of a file | its text in UTF-8 bytes: 1 byte per plain letter, 2 for é | MemoryFileSystem.java |
| Size of a folder | nothing (only the files inside count) | MemoryFileSystem.java |
| A file in the editor | up to the free space of the medium plus its own size, 1,048,576 characters at most | ComputerBlockEntity.java |
| Undo in the editor | 200 steps | CodeBuffer.java |
#Network
| Limit | Value | Source |
|---|
| A message | 2,048 values (keys included) and 32,768 characters of text in all, 32 levels of tables | NetApi.java, Values.java |
| Receive buffer | a quarter of the receiver's memory (see Memory) | Machine.java |
| Radio Modem | 128 blocks | RadioBlock.java |
| Wi-Fi Router | 256 blocks; all the routers with the same SSID form one network | RadioBlock.java |
| Range multiplier | 1 (config wirelessRangeMultiplier, 0.1 to 16), applied to both ranges | CAConfig.java |
| Between two antennas | the shorter of their two ranges | NetworkManager.java |
| SSID | 32 characters, longer names are cut | WifiRouterBlockEntity.java |
| Data Cable network | 2,048 cables explored from a computer | WiredNetworks.java |
distance of messages and net.computers | rounded to a tenth of a block | NetworkManager.java |
| Who receives | computers that are on, in loaded chunks that tick; a computer at the shell prompt (no program running) loses the message, although net.send returned true | NetworkManager.java, Machine.java |
#Blocks and world
| Limit | Value | Source |
|---|
| Redstone strength | 0 to 15; rs.set and link.set bring other values back into that range | ComputerBlockEntity.java, LinkApi.java |
| Redstone Link frequencies | 32 per computer, link and Redstone Link peripherals together (too many link frequencies) | LinkApi.java |
| Redstone Link range | Create's own linkRange: 256 blocks by default (Create's server config) | Create |
| Display Link lines | 16 lines of 128 characters; longer lines are cut, extra lines ignored | DisplayApi.java |
| Label of a computer | 32 characters (os.label refuses longer, the label command cuts) | OsLib.java, Shell.java |
| Readings of the Create Simulated sensors | rounded to 0.001 | SimulatedSensors.java |
vehicle.position, vehicle.velocity, vehicle.speed | rounded to 0.01 | VehicleApi.java |
push of an inventory | 64 items when no count is given | DeviceAdapters.java |