DarwinBotsManual
Open the app EspañolES

Your first simulation

Step by step: pick a scenario on Home, watch it run in Observe, pause, change the speed, inspect a bot, seed one of your own and save the run.

On this page you'll open the app, set a world running, look at a bot up close, seed a bot you wrote yourself and save everything to carry on another day. You don't need to know how to program: the DNA in step 6 is copied and pasted.

1. Pick a scenario

Open the app. The first screen is Home. If you haven't run anything yet, it says “No runs yet” at the top and the Pick a scenario button scrolls you down to the gallery.

A scenario is a ready-to-use world: the size of the field, the physics, the light, the costs and the species that are seeded at the start. The app ships thirteen:

ScenarioWhat it has
Primordial soupAlgae and a minimal animal, with mutations. The starting point to watch a species evolve.
Predator and preyZebedee V2.1 hunting over a field of algae.
F1 matchTwo league bots face to face, under the F1 league rules.
F2 matchTwo F2 league bots face to face, with their solar energy and their disqualification.
F3 matchTwo F3 league bots face to face, with their solar energy and their disqualification.
MB matchTwo multi-bots in the F2 world, with no disqualification.
SB matchTwo short bots, on a bigger field.
SS matchTwo single-store bots, under the F1 league rules.
F4 matchTwo league bots face to face, on a field with twice the side and the old-age upkeep at 1.
Day and nightThe sun sets every 1000 cycles and the population oscillates.
MazeA spiral maze the bots can see.
OceanWater physics in a world with no edges.
ArchipelagoRock islands and two teleporters.

To get started, find Primordial soup and click Start. The app builds the world with a new random seed, sets it running and takes you to Observe.

The other button on each card, Tweak, opens the scenario in Experiment so you can change it before starting (see Scenarios). On the league matches' cards the main button doesn't say Start but Pick bots, and takes you to Compete, because a match is set up by choosing the entrants.

2. What you're looking at

Observe has three parts:

At the very top, in the sections bar, an indicator says whether the simulation is running (with its name) or paused (with the cycle it stopped at). From any section, a click there brings you back to Observe.

At first not much will happen: the animals roam the field looking for algae, and when they see one they approach it and shoot it to take its energy. In time children are born, the chart climbs and the first events appear. What each bot does in each cycle is told in The cycle and the order of actions.

3. Pause and change the speed

ControlWhat it does
Pause / StartStops and resumes the simulation.
One cycleAdvances exactly one cycle. Useful for following a bot step by step.
× 1, × 10, × 100How many cycles are calculated for each frame drawn. It starts at × 10.
MaxAs fast as your computer can; it draws when it has time.
ViewEnriched (the usual one), Classic (like the original program) or Outline.
Color byIn the enriched view, colors the bots by species, energy, body, generation, mutations, age, DNA length or genetic distance.

To move around the world: the mouse wheel zooms in and out, and once you've zoomed in you can drag the world. The buttons in the corner of the world do the same (Zoom in, Zoom out, Fit the whole field). With focus on the world, + and − zoom in and out, the arrow keys pan, and 0 fits the whole field again.

With × 100 or Max, Primordial soup gets through its first thousands of cycles right away. That's how you see evolution: it happens over tens of thousands of cycles, not hundreds.

4. Look at a bot up close

Click a bot. The panel on the right jumps to the Bot tab, with the inspector: the name of its species, its generation, its mutations and its age, and its resources (energy, body, venom, shell, waste). On the Summary tab you also see its energy curve, what its eyes see and which genes of its DNA ran in this cycle.

A few things to try:

  1. Click Follow: the camera follows the bot around the world.
  2. Pause and advance with One cycle, watching Genes active this cycle to see which gene lights up when the bot sees an alga.
  3. Open the DNA tab to read its program, or Senses to see the fan of its nine eyes.
  4. Click Family to highlight its descendants in the world.

If you don't know which one to look at, Find the best selects the fittest bot in the simulation (vegetables don't count). To go back to the “Live” panel, close the inspector with the ✕. The other tabs (Memory, Console, Control) are covered in The inspector.

5. A bot from the Bestiary

The Bestiary is the collection of community bots that the app ships. To add one to the world that's running:

  1. Click Seed on the bottom bar.
  2. Under Bot, choose A bot from the library… and search for it by name (try “Zebedee” or “Hunter”).
  3. Check the Count (5, or 15 if it's a vegetable), the Starting energy (3000) and the Color.
  4. Click Seed.

The new species shows up in the world and on the chart, and is noted in the events. You can also seed from the Bots section: open a bot's profile and click Seed (see Bots: library and profile).

6. Seed a bot of your own

This DNA is a minimal hunter: if it sees nothing, it moves forward and turns at random; if it sees a bot of another species, it heads toward it; if it's close enough, it shoots it to take its energy; and when it has gathered energy to spare, it reproduces.

' My first bot: looks for food, eats and reproduces
' Gene 1: if it sees nothing (or sees one of its own), move forward and turn at random
cond
 *.eye5 0 =
 *.refeye *.myeye = or
start
 10 .up store
 200 rnd .aimdx store
stop
' Gene 2: if it sees another one, go toward it
cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 20 .up store
stop
' Gene 3: if it's close enough, shoot it to take its energy
cond
 *.eye5 50 >
 *.refeye *.myeye !=
start
 -1 .shoot store
stop
' Gene 4: with energy to spare, reproduce
cond
 *.nrg 10000 >
start
 50 .repro store
stop
end

To seed it:

  1. Click Open in the app on the block: the app opens the new-bot dialog with this DNA already loaded. (The Copy button puts it on your clipboard, in case you'd rather paste it by hand.)
  2. Enter a Name (for example, “My first bot”) and click Create: the editor opens with the DNA.
  3. On the bot's profile, click Seed, pick a Color that stands out, leave the Number of bots at 5 and the Starting energy at 3000, and click Seed into the current run.

Follow it with the inspector. In the tests we ran with the engine, seeding these five bots alongside those of Primordial soup, by cycle 4000 there were already between 20 and 70, and by cycle 10,000, from about 200 to over a thousand, depending on the seed. Since Primordial soup has mutations turned on, in time you'll see children with changed DNA: the inspector shows how many mutations each one has accumulated.

Every line of this bot is explained in the DNA chapter: genes in Genes: cond, start, else and stop, eyes in Vision, shooting in Shots and reproduction in Reproduction. To write one from scratch, follow A bot that moves. If you want to keep it and improve it, create it in Bots with + New bot: the DNA editor warns you about errors as you write.

7. Save the run

A run is a simulation with its history: the scenario it came from, its seed, the changes you made to it and its events. To save it:

  1. Click Save on the bottom bar.
  2. Type a Name.
  3. Click Save in the browser.

It's saved in this browser. The app keeps the last 20 runs. If the run was already saved, the button says Update the saved run, and next to it Save as new appears to save a separate copy. Download .dbsim, on the other hand, downloads a file with the simulation, to take it to another computer.

To carry on another day, open Home and find the run under Saved runs, or use Runs on the Observe bar. When you resume it, it comes back paused: click Start. The world carries on from where you left it, although the randomness doesn't continue exactly as it would have if you hadn't saved it (see Seeds and reproducibility). Where everything you save lives and how to export it is in Your data.

What's next