Parameters: Costs
How much energy the simulation charges a bot for running its DNA, moving, shooting, making defenses, having a body and growing old.
This group sets the price of everything a bot does. All prices are paid in energy (.nrg) and are the same for every bot in the world, vegetables included. With the app's factory values they are all 0: living and acting is free, and a bot only runs out of energy if it spends it on something (giving it away, moving it to the body, making defenses) or if it is taken away. Change them when you want evolution to reward thrifty bots, or when you set up a world with tournament rules.
This page says what each parameter charges. The overall mechanism (in which phase of the cycle each thing is charged, what happens if the energy goes negative) is in Energy, body and waste, and the DNA side of it in Execution and costs.
How costs are charged
Each cost is charged as price × Cost multiplier. The multiplier is 1 by default and is the master knob: at 0 everything is free even if the prices aren't, at 2 everything costs double. It lives in the Parameters: Dynamic costs group because the engine can move it by itself to steer the population toward a target.
There are three kinds of costs:
| Kind | When it is paid | Parameters |
|---|---|---|
| Per instruction | Every time the DNA executes one, in the DNA phase. | Number to Flow control |
| Per action | When the bot does something: push, turn, tie, shoot, make. | New chloroplast, Move to Shoot, Venom to Shell |
| Upkeep | Every cycle, even if the bot does nothing; also when reproducing. | DNA per cycle, DNA copy, Body upkeep to Age cost linear fraction, Logarithmic age cost, Linear age cost |
Charges don't look at the balance: the energy can go negative between one phase and the next, and only in the actions phase is it decided whether the bot died (see Energy, body and waste). Corpses don't pay upkeep.
A negative price, or a negative multiplier, turns the cost into a payment: with the multiplier at −1 and the store at 1, each store adds 1 energy to the bot. The app accepts a negative price with an unusual-value warning; it accepts a negative multiplier without any warning.
Shortcuts: F1 and no costs
You don't need to enter the 26 values by hand. In Experiment, Basic mode has a Costs control with three options: F1 sets the league's prices, No costs puts everything back to the factory values, and Custom is what you see when the values match neither of the other two (for example, because you changed one in Advanced mode). In advanced mode, the F1 settings button and the scenario's F1 league base set the same prices, along with the rest of the league's rules (see Experiment and Experiment: advanced mode).
The F1 prices are these; everything else in the group stays at 0 (and so does the dynamic adjustment):
| Parameter | F1 |
|---|---|
| Condition | 0.004 |
| Store | 0.04 |
| New chloroplast | 0.2 |
| Move | 0.05 |
| Tie | 2 |
| Shoot | 2 |
| Venom and Poison | 0.01 |
| Slime and Shell | 0.1 |
| Body upkeep | 0.00001 |
| Age cost | 0.01, from almost the moment it is born |
| Cost multiplier | 1 |
With those prices, shooting and tying are what's expensive; running the DNA and having a body hardly cost anything. F1 copies the original, which set the costs from 1 onward to 0: it doesn't touch Number, so if you changed it by hand, it stays as it was.
Number
Per DNA number executed.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
NUMCOST- Key
cost:0- Live
- can be changed while the simulation runs
- Mode
- advanced only
Charged for every number the DNA pushes onto the stack as it runs, such as 10, or .up when the sysvar has no asterisk (it is an address, that is, a number). Inside a gene that is off, the numbers are not executed and cost nothing. It is the cost that grows most with the length of the DNA that really runs: a typical gene has more numbers than anything else. See Numbers and reads.
*.number read
Per memory read (*.x).
- Default
- 0
- Usual range
- 0 to 1000
- Variable
DOTNUMCOST- Key
cost:1- Live
- can be changed while the simulation runs
- Mode
- advanced only
Charged for every memory read with an asterisk, such as *.eye5 or *50. A bot that checks many senses per cycle pays once per read, even if it reads the same one twice. See *<numero> | *.<sysvar>.
Basic command
add, sub, mult…
- Default
- 0
- Usual range
- 0 to 1000
- Variable
BCCMDCOST- Key
cost:2- Live
- can be changed while the simulation runs
- Mode
- advanced only
Paid by every basic operator executed: arithmetic and stack handling, such as add, mult, rnd, dup or swap. The full list is in Basic.
Advanced command
angle, dist, sqr…
- Default
- 0
- Usual range
- 0 to 1000
- Variable
ADCMDCOST- Key
cost:3- Live
- can be changed while the simulation runs
- Mode
- advanced only
Paid by every advanced operator: trigonometry and geometry, such as angle, dist, sqr or pow. debugint and debugbool belong to that family but never cost anything. See Advanced.
Bitwise command
Bitwise operations.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
BTCMDCOST- Key
cost:4- Live
- can be changed while the simulation runs
- Mode
- advanced only
Paid by every bitwise operator, such as & or <<. See Bitwise.
Condition
Per comparison.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
CONDCOST- Key
cost:5- Live
- can be changed while the simulation runs
- Mode
- advanced only
Charged for every comparison, such as >, = or %=. Note: a gene's conditions are always evaluated, because the engine has to know whether the gene runs, so even genes that end up off pay this cost. With the F1 rules it is 0.004. See Comparisons.
Logic
and, or, not…
- Default
- 0
- Usual range
- 0 to 1000
- Variable
LOGICCOST- Key
cost:6- Live
- can be changed while the simulation runs
- Mode
- advanced only
Paid by every logic operator, the ones that combine or manipulate boolean results: and, or, not, dropbool and the others in Logic.
Store
Per memory write.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
COSTSTORE- Key
cost:7- Live
- can be changed while the simulation runs
- Mode
- advanced only
This is the price of store, the instruction the bot acts with: almost everything it does goes through a store. The variants pay a fraction: inc and dec a tenth; addstore and its relatives, a fifth; rndstore, sgnstore and sqrstore, a seventh; absstore and negstore, an eighth. A store that doesn't get to write (because of a false inline condition, or because the address is 0) costs nothing. With the F1 rules it is 0.04. See Execution and costs.
New chloroplast
Per chloroplast a bot builds.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
CHLRCOST- Key
cost:8- Live
- can be changed while the simulation runs
- Mode
- advanced only
Charged for every chloroplast the bot buys with .mkchlr. The purchase is canceled entirely if it would leave the bot with less than 100 energy, and that rule applies even if the price is 0: a bot with 90 energy can't buy a single one. Removing them with .rmchlr is free. With the F1 rules it is 0.2: 1000 chloroplasts cost 200 energy. See Chloroplasts and vegetables.
Flow control
cond, start, stop…
- Default
- 0
- Usual range
- 0 to 1000
- Variable
FLOWCOST- Key
cost:9- Live
- can be changed while the simulation runs
- Mode
- advanced only
Paid by the gene markers: cond, start, else and stop. They run even if the gene is off, so a bot with many genes pays this cost for each one every cycle. See Flow.
Move
Per unit of thrust.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
MOVECOST- Key
cost:20- Live
- can be changed while the simulation runs
- Mode
- advanced only
This is the price of pushing with .up, .dn, .sx and .dx, per unit of thrust. It is charged on the thrust after it has been clipped by the speed cap, so asking for more than the world allows doesn't cost more, and the bot is never charged more energy than it has. In pond mode you also pay to stay afloat. With the F1 rules it is 0.05. See Physics.
Turn
Per 200 units of turn (one radian).
- Default
- 0
- Usual range
- 0 to 1000
- Variable
TURNCOST- Key
cost:21- Live
- can be changed while the simulation runs
- Mode
- advanced only
This is the price of turning, per 200 units of turn (about 57 degrees): a quarter turn costs 1.57 times the price and a full turn, 6.28. You pay the same whether you turn with .aimsx, .aimdx or .setaim. The F1 rules don't charge for turning. See Physics.
Tie
Per tie attempt, divided by the ties after the attempt plus 1. The birth tie charges it to the parent.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
TIECOST- Key
cost:22- Live
- can be changed while the simulation runs
- Mode
- advanced only
Charged every time the bot tries to tie to another with .tie and there is someone in range, whether or not the tie comes out. It is also charged at every birth, for the birth tie: the parent pays it (in sexual reproduction, the mother). The price is divided by the number of ties the bot has after the attempt, plus one, so the first tie costs half the price, the second a third, and so on; a failed attempt, with no ties, costs the full price. With the F1 rules it is 2: a child costs a parent that had no other ties 1 energy. See Ties and multicellular bots.
Shoot
Per shot.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
SHOTCOST- Key
cost:23- Live
- can be changed while the simulation runs
- Mode
- advanced only
This is the base price of a shot with .shoot. How much the shooter pays depends on the type: feeding shots, venom and waste divide it by the number of ties plus one, memory shots pay it in full, and a feeding shot with a large .shootval multiplies it (the table is in Shots). It is also paid, without the bot asking for it, by the shot it uses to expel waste when too much builds up, and by a virus shot (Viruses). With the F1 rules it is 2.
DNA per cycle
Per cycle and DNA length.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
DNACYCCOST- Key
cost:24- Live
- can be changed while the simulation runs
- Mode
- advanced only
An upkeep cost: every cycle, the bot pays this price for each instruction in its genome (not counting the final end), whether or not it runs. It is what punishes the junk DNA that accumulates with mutations. A DNA of 100 instructions plus the end, with the price at 0.01, costs 1 per cycle. See Execution and costs.
DNA copy
On reproduction, per DNA length.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
DNACOPYCOST- Key
cost:25- Live
- can be changed while the simulation runs
- Mode
- advanced only
Charged when reproducing, for each instruction in the genome (this time counting the end): it is the price of copying the DNA for the child. If the parent can't afford it, it is left with 0 energy, but the child is born all the same. It is also paid by whoever makes a virus, for each word of the gene it copies. See Reproduction.
Venom
Per unit of venom made.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
VENOMCOST- Key
cost:26- Live
- can be changed while the simulation runs
- Mode
- advanced only
This is the transaction cost for each unit of venom the bot makes with .strvenom, on top of the fixed conversion (1 energy per unit). What is paid as this cost doesn't disappear: it becomes waste (.waste). With the F1 rules it is 0.01. See Defenses.
Poison
Per unit of poison made.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
POISONCOST- Key
cost:27- Live
- can be changed while the simulation runs
- Mode
- advanced only
Same as the venom one, for the poison made with .strpoison (the fixed conversion is 1 energy per 4 units). The cost also becomes waste. With the F1 rules it is 0.01. See Defenses.
Slime
Per unit of slime made.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
SLIMECOST- Key
cost:28- Live
- can be changed while the simulation runs
- Mode
- advanced only
The cost per unit of slime made with .mkslime, on top of the fixed conversion (1 energy per 10). It becomes waste. A bot tied to others in a multicellular organism pays less: the cost is divided by the number of ties plus one, although the waste is added in full. With the F1 rules it is 0.1.
Shell
Per unit of shell made.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
SHELLCOST- Key
cost:29- Live
- can be changed while the simulation runs
- Mode
- advanced only
The cost per unit of shell made with .mkshell, with the same rules as slime: a fixed conversion of 1 energy per 10, the cost becomes waste, and in a multicellular organism it is divided by the ties plus one. With the F1 rules it is 0.1. See Defenses.
Body upkeep
Per cycle and body unit.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
BODYUPKEEP- Key
cost:30- Live
- can be changed while the simulation runs
- Mode
- advanced only
Body upkeep: every cycle, the bot pays this price for each point of .body. It makes storing energy in the body cost something. At 0.001, a bot with 1000 body loses 1 per cycle; with the F1 value (0.00001), a hundredth of that. See Energy, body and waste.
Age cost
Per cycle, from the starting age.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
AGECOST- Key
cost:31- Live
- can be changed while the simulation runs
- Mode
- advanced only
The age cost: what the bot pays per cycle once its age has passed the starting age. As it stands it is a fixed amount; with Logarithmic age cost or Linear age cost it grows with the years. It lets old bots make room for their children without you having to program their death. With the F1 rules it is 0.01 and the starting age stays at 0. See Death and corpses.
Age at which the cost starts
Cycles of life before the age cost applies.
- Default
- 0
- Usual range
- 0 to 2147483647
- Variable
AGECOSTSTART- Key
cost:32- Live
- can be changed while the simulation runs
- Mode
- advanced only
The age, in cycles, from which Age cost is charged: charging starts when the age exceeds it. With 0 (the factory value) it is charged from the second cycle of life, because in the first one the age is still 0. The logarithmic and linear forms count cycles from this age, not from birth.
Age cost linear fraction
Slope of the linear age cost.
- Default
- 0
- Usual range
- 0 to 1000
- Variable
AGECOSTLINEARFRACTION- Key
cost:33- Live
- can be changed while the simulation runs
- Mode
- advanced only
The slope of the linear age cost: how much is added to Age cost for each cycle lived after the starting age. With the cost at 1 and the slope at 0.5, the bot pays 1.5 in its first cycle of old age, 2 in the second, 2.5 in the third, and so on. It only counts if Linear age cost is on.
Logarithmic age cost
Grows with the logarithm of age.
- Default
- no
- Usual range
- yes / no
- Variable
AGECOSTMAKELOG- Key
cost:51- Live
- can be changed while the simulation runs
- Mode
- advanced only
When on, the age cost is Age cost times the natural logarithm of the cycles lived since the starting age: it grows fast at first and then more and more slowly. With the cost at 10, the bot pays 6.9 when it is 2 cycles into old age, about 46 at 100 and about 69 at 1000. If you also turn on Linear age cost, this one wins.
Linear age cost
Grows linearly with age.
- Default
- no
- Usual range
- yes / no
- Variable
AGECOSTMAKELINEAR- Key
cost:60- Live
- can be changed while the simulation runs
- Mode
- advanced only
When on, the age cost grows in a straight line: Age cost plus Age cost linear fraction for each cycle lived since the starting age. In the long run it is harsher than the logarithmic one, because it never flattens out. It has no effect if Logarithmic age cost is also on.