DarwinBotsManual
Open the app EspañolES

Parameters: Physics

The medium the bots move in: maximum speed, thrust efficiency, friction, fluid, gravity, collision bounce, random shoves, inertia and size.

These parameters define the medium the bots move in: how fast they can go, what slows them down, what pushes them and how they collide. They change a lot which kind of strategy pays off. In a world without friction, a bot that has stopped pushing keeps going forever; in one with strong friction, standing still is free and moving is expensive.

In Experiment's basic mode, the Medium control sets five of these parameters at once with the original DarwinBots' values:

MediumMedium densityViscosityStatic frictionKinetic frictionZ gravity (against the floor)
Space (how the app starts)00000
Fluid0.00000010.0005000
Solid (the F1 league's)000.60.42

If you change any of them by hand, the control switches to Custom. Everything that happens in the forces and collisions and movement phases is in Physics, with measured examples; here you get what each parameter changes. What it costs to move isn't in this group but in the costs (Move, Turn).

Max speed

Speed cap of a bot.

Default
40
Usual range
0 to 1000
Variable
MaxVelocity
Key
opt:11
Live
can be changed while the simulation runs
Mode
advanced only

The cap on a bot's speed, in units per cycle; bots read it in .maxvel. The app starts at 40 and the F1 league raises it to 180. It clips two things: the final speed of each cycle and the shove the bot can give itself with .up and company, so the cost of moving doesn't go past this cap either (see voluntary thrust).

With 40, crossing a 32000 field takes at least 800 cycles.

Motor efficiency

Fraction of the requested thrust that becomes motion. At 0 bots cannot move on their own.

Default
0.66
Usual range
0 to 1
Variable
PhysMoving
Key
opt:12
Live
can be changed while the simulation runs
Mode
advanced only

What fraction of the requested thrust turns into movement. With 0.66, the value in the app and in the F1 league, 40 .up store gives a light bot about 26 speed in the first cycle. The cost is computed on the requested thrust, not on what it yields: lowering this value makes moving more expensive without making anything cheaper.

With 1 all the thrust is used; with 0 bots can't move on their own (gravity, collisions and ties still move them). In pond mode, floating costs more the lower this value is.

Brownian motion

Random nudges every cycle.

Default
0
Usual range
0 to 100
Variable
PhysBrown
Key
opt:13
Live
can be changed while the simulation runs
Mode
advanced only

Random shoves: every cycle, each bot gets a shove in a random direction, of up to half this value, and a small random turn as well. Like any shove, it is divided by the mass, so it barely moves heavy bots. The app has it at 0.

It keeps anything from staying completely still: it mixes populations and gets vegetables out of the fixed positions where they were born. With tides (Tides (cycles; 0 = off)) the engine rewrites it every cycle. See Brownian motion.

Medium density

Fluid drag (water ≈ 1e-7).

Default
0
Usual range
0 to 0.001
Variable
Density
Key
opt:14
Live
can be changed while the simulation runs
Mode
basic and advanced

The density of the fluid. Together with Viscosity, it decides the drag: a subtraction from speed that grows with speed and with the bot's radius, and that doesn't depend on its mass. If either of the two is 0, there is no drag. Density also adds added mass: the fluid the bot drags along with it gives it more inertia, without making it heavier for gravity.

The app has it at 0; the original's water is 0.0000001 (1e-7), which is what the Fluid medium sets. Useful values are very small: the usual range goes up to 0.001. See the fluid.

Viscosity

Viscous drag (water ≈ 0.0005).

Default
0
Usual range
0 to 0.1
Variable
Viscosity
Key
opt:15
Live
can be changed while the simulation runs
Mode
basic and advanced

The viscosity of the fluid, the other half of the drag (see Medium density). The app has it at 0; the original's water, the Fluid medium's, is 0.0005. With those values a bot at the cap of 40 doesn't go past 20 while pushing and stops dead the moment it quits; with a viscosity ten times smaller, it glides for several cycles. The table in the fluid compares the two.

Static friction

Floor friction to start moving.

Default
0
Usual range
0 to 2
Variable
CoefficientStatic
Key
opt:16
Live
can be changed while the simulation runs
Mode
basic and advanced

Friction for starting off. If a bot is standing still and what pushes it in that cycle doesn't exceed mass × Z gravity (against the floor) × this coefficient, it doesn't move, and the thrust is charged anyway. If it is already moving, it only slows down sideways pushes. Without Z gravity it does nothing.

The app has it at 0 and the F1 league at 0.6: with that, a bot of mass 1 (and Z gravity (against the floor) at 2) has a threshold of 1.2 of effective thrust, and since the engine only uses 0.66 of what you ask for (Motor efficiency), it has to ask for more than 1.8 (2 .up store) to start off. The threshold grows with mass, so very heavy bots get stuck. See friction.

Kinetic friction

Floor friction while moving.

Default
0
Usual range
0 to 2
Variable
CoefficientKinetic
Key
opt:17
Live
can be changed while the simulation runs
Mode
basic and advanced

Friction in motion: every cycle it subtracts mass × Z gravity (against the floor) × this coefficient from the bot's speed, without letting it go negative. It isn't divided by the mass, so it slows heavy bots much more. Without Z gravity it does nothing.

The app has it at 0 and the F1 league at 0.4: a bot of mass 1 loses 0.8 speed per cycle and, if it stops pushing at 40, comes to a halt in about 50 cycles.

Collision elasticity

0 = soft collisions; 1 = full bounce.

Default
0
Usual range
0 to 1
Variable
CoefficientElasticity
Key
opt:18
Live
can be changed while the simulation runs
Mode
advanced only

How much bots bounce when they collide with each other. With 0, the value in the app and in the F1 league, the collision is soft: along the direction of the hit the two end up with the same velocity, as if one pushed the other. With 1 they bounce like billiard balls. It also changes how much two overlapping bots separate per cycle: with 0 about a quarter of the overlap is undone, with 1 almost all of it.

With high bounce, a bot that rams gets sent flying; with soft collisions, it can push another one. See collisions between bots.

Z gravity (against the floor)

Presses bots against the floor: enables friction.

Default
0
Usual range
0 to 100
Variable
Zgravity
Key
opt:19
Live
can be changed while the simulation runs
Mode
basic and advanced

A gravity that moves nobody: it presses the bots against the “floor” and is what makes friction work. The two coefficients (Static friction and Kinetic friction) are multiplied by it, so with 0 (as the app starts) there is no friction even if the coefficients aren't 0. The F1 league uses 2.

Y gravity (downwards)

Pulls bots towards the bottom edge.

Default
0
Usual range
0 to 100
Variable
Ygravity
Key
opt:20
Live
can be changed while the simulation runs
Mode
advanced only

Downward gravity: every cycle it adds this value to the vertical speed of every bot, whatever it weighs. With 1, a bot standing still falls at 1, 2, 3… up to the speed cap. The app has it at 0.

With walls, everything ends up at the bottom; if top and bottom are connected (Top ↔ bottom connected), bots fall forever. In pond mode (Pond mode (light by depth)) it is what lets you float with .setboy. With tides (Tides (cycles; 0 = off)) the engine rewrites it every cycle. See gravity and buoyancy.

No inertia

Bots stop dead when they stop pushing.

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

No inertia: at the end of every cycle the engine zeroes everyone's velocity. A bot moves only while it pushes and stops dead when it quits. Nothing builds up from one cycle to the next: with gravity 1, a bot always falls 1 per cycle instead of going faster and faster. Off in the app.

In a test, a bot pushing 40 with the default efficiency moved 26 per cycle, always the same, and stood still in the cycle it stopped pushing. While it was moving, .velscalar reported 26, but .velup and .veldx read 0.

Fixed bot radii

All bots the same size, whatever their body.

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

All bots are the same size, with a radius of 60, whatever body or chloroplasts they have. Mass keeps changing as usual; only the size changes, which decides when two bots touch, how much the fluid slows them and how much light they block. Without this option, a bot with 1000 body measures 114 and one full of chloroplasts approaches 415 (see a bot's physical state). Off in the app.

With fixed radii, getting fat doesn't make you easier to reach, and it doesn't take light from your neighbors.