DarwinBotsManual
Open the app EspañolES

Parameters: Light and day/night

When and where there is sun: the day and night cycle, the random sun strip, the thresholds that turn the sun on or off according to the world's energy, and pond mode.

Solar share per cycle says how much the sun gives; this group says when and where it gives it. There are four mechanisms, which can be combined:

MechanismParametersWhat it does
Day and nightDay/night cycle, Half period (cycles)The sun turns on and off on a clock.
Random sunRandom sun (weather)Only a vertical strip of the field gets light, and it moves.
ThresholdsSun ON below a threshold, Sun OFF above a threshold and their settingsThe sun turns on or off according to the world's total energy.
PondPond mode (light by depth), Light intensity, Depth gradientLight weakens with depth.

If you touch nothing, the app starts with full sun all the time, across the whole field. The F1 league base turns on only the random sun. At night no bot photosynthesizes, but costs keep being charged, so long nights put heavy pressure on the vegetables and on the animals that live off them. Bots find out through .daytime.

The complete mechanics are on the chloroplasts page, in Day and night and The sun strip. In Experiment's basic mode, the Day and night control handles the first two parameters at once: 0 turns the clock off and any other number turns it on with that duration.

Day/night cycle

At night vegetables get no energy.

Default
no
Usual range
yes / no
Variable
DayNight
Key
opt:33
Live
can be changed while the simulation runs
Mode
basic and advanced

Turns on the day and night clock: the sun switches off and on by itself, with stretches lasting Half period (cycles) cycles plus one. Off (as the app starts), the state stays fixed at whatever Daytime says, which is normally day.

In a test with a half period of 3, a vegetable ate for three cycles, spent four in the dark and ate again for four: only the first day is one cycle shorter.

Half period (cycles)

Each stretch of day or night lasts this value plus 1 cycles.

Default
500
Usual range
1 to 32000
Variable
CycleLength
Key
opt:34
Live
can be changed while the simulation runs
Mode
basic and advanced

How long each stretch of light or darkness lasts, in cycles: it actually lasts one more than this number, so with 500, the app's value, there are 501 cycles of sun and 501 of night. It only counts with Day/night cycle on.

A short period alternates quickly and a vegetable with reserves barely notices; a long one forces it to store energy for the night or to adapt, as Chloroplastus from the Bestiary does (see having chloroplasts).

Random sun (weather)

The lit band wanders at random.

Default
no
Usual range
yes / no
Variable
SunOnRnd
Key
opt:40
Live
can be changed while the simulation runs
Mode
advanced only

With this parameter only a vertical strip of the field, from top to bottom, gets sun; it drifts slowly and changes heading and width every so often (on average, once every 2000 cycles). Its width goes from a quarter of the field to the whole field. Outside the strip no chloroplast produces anything, even in daytime. The app has it off; the F1 league turns it on.

It creates seasons: a vegetable standing still goes through long spells of sun and shade, and one that moves can follow the light. If you turn it off in a running simulation, the sun goes back to covering the whole field. See the sun strip.

Sun ON below a threshold

The sun rises when total energy drops below the threshold.

Default
no
Usual range
yes / no
Variable
SunUp
Key
opt:35
Live
can be changed while the simulation runs
Mode
advanced only

Turns the sun on when the world's total energy drops below On threshold. It is useful for rescuing a dying population: if the food runs out, light arrives even if it is night. What exactly it does to the clock is decided by Threshold mode. Off in the app.

The total energy adds up the energy and ten times the body of all bots, corpses included, plus the energy of the gifts (−2 shots) in flight. It is measured at the end of a cycle and used in the next one.

On threshold

Total energy below which the sun rises.

Default
500000
Usual range
0 to 2147483647
Variable
SunUpThreshold
Key
opt:36
Live
can be changed while the simulation runs
Mode
advanced only

The threshold for Sun ON below a threshold, in energy units; the app starts at 500000. To give you a sense of scale: a freshly seeded bot with 3000 energy and 1000 body counts 13000, so 500000 is about 38 bots like that. It is best to keep it below Off threshold.

Sun OFF above a threshold

The sun sets when total energy exceeds the threshold.

Default
no
Usual range
yes / no
Variable
SunDown
Key
opt:37
Live
can be changed while the simulation runs
Mode
advanced only

Turns the sun off when the world's total energy goes over Off threshold. It is the brake on a population that grows too much: without light, the vegetables stop producing and the whole chain slims down. It is counted the same way as in Sun ON below a threshold. Off in the app.

In a test with a single vegetable (13000 total energy) and the threshold at 5000, the vegetable ate in the first cycle, when there was no measurement yet, and never saw the sun again.

Off threshold

Total energy above which the sun sets.

Default
1000000
Usual range
0 to 2147483647
Variable
SunDownThreshold
Key
opt:38
Live
can be changed while the simulation runs
Mode
advanced only

The threshold for Sun OFF above a threshold, in energy units; the app starts at 1000000, about 77 freshly seeded bots. If you also use Sun ON below a threshold, keep this one higher than On threshold: between the two lies the band of energy in which the sun follows its normal course.

Threshold mode

What the threshold does to the day/night cycle.

Default
0
Values
0 = suspend until the next cycle · 1 = suspend for good · 2 = advance the sun
Variable
SunThresholdMode
Key
opt:39
Live
can be changed while the simulation runs
Mode
advanced only

What a threshold does when it is crossed. It only matters with Sun ON below a threshold or Sun OFF above a threshold on:

  • suspend until the next cycle (0, the app's value): while the energy is on the other side of the threshold, every cycle the sun (or the darkness) is forced and the day clock is paused. When the energy comes back, the clock continues from where it was.
  • suspend for good (1): the threshold changes the sun's state and the state stays that way until something else changes it (the clock, if it is on). With both thresholds on, the clock is ignored completely: the sun turns on when it drops below On threshold and doesn't turn off until it passes Off threshold, like a thermostat.
  • advance the sun (2): the threshold sets the day (or the night) and restarts the clock; when the energy comes back, that stretch lasts in full (with the clock off, the state simply stays that way).

Pond mode (light by depth)

Light fades with depth.

Default
no
Usual range
yes / no
Variable
Pondmode
Key
opt:30
Live
can be changed while the simulation runs
Mode
advanced only

Pond mode: light comes in from the top with the strength of Light intensity and weakens with depth, according to Depth gradient. In this mode Solar share per cycle isn't used. In addition, with downward gravity (Y gravity (downwards)) and with top and bottom not connected (Top ↔ bottom connected), bots can float at whatever height they choose with .setboy (see gravity, ponds and tides).

Light intensity

Light at the pond surface. At 0 nobody photosynthesizes in pond mode.

Default
0
Usual range
0 to 32000
Variable
LightIntensity
Key
opt:31
Live
can be changed while the simulation runs
Mode
advanced only

The light at the surface of the pond, in the same units as Solar share per cycle: in the top strip of the field, a value of 10 gives the same as solar energy at 10. It only counts with Pond mode (light by depth) on.

The app has it at 0, and that means that if you turn on the pond without touching this value, nobody photosynthesizes. In a test with 100, a vegetable of 16000 chloroplasts at a depth of 12000 gained 4.65 energy per cycle, and one closer to the surface, more.

Depth gradient

How fast light fades with depth.

Default
1.02
Usual range
0 to 10
Variable
Gradient
Key
opt:32
Live
can be changed while the simulation runs
Mode
advanced only

How much the light fades going down. Depth is counted in steps of 2000 (1 at the very top, 17 at the bottom of a 32000 field), and the light at each step is Light intensity divided by the step raised to this number. With 1.02, the app's value, at 2000 depth half the light arrives and at the bottom, about an eighteenth. With 0 the light is the same across the whole pond; with 2, 1/289 reaches the bottom. It only counts with Pond mode (light by depth) on.

Daytime

Current state of the cycle (the engine flips it).

Default
yes
Usual range
yes / no
Variable
Daytime
Key
opt:41
Live
can be changed while the simulation runs
Mode
advanced only

The state of the sun right now: day or night. With the clock (Day/night cycle), or with a threshold acting in the suspend for good or advance the sun modes (Threshold mode), the engine changes it by itself and this parameter is for reading it or for forcing a change in a running simulation. In the suspend until the next cycle mode, the threshold turns the sun on or off without touching this state. Without a clock, on the other hand, it stays wherever you put it: off means night forever. In a test, a vegetable with this parameter at “no” gained nothing and read .daytime as 0 the whole time.