DarwinBotsManual
Open the app EspañolES

Defenses

Shell, slime, venom and poison: how they are made with energy, what they cost, which ones wear off on their own, and what they do to whoever attacks you.

A bot can turn energy into four substances: shell, slime, venom and poison. All four are made the same way, but each one works against something different. This page explains how they work; the sysvars that handle them are in Defenses.

SubstanceMade withRead fromPer 1 of energyCap per cycleWears off on its ownWorks against
Shell.mkshell.shell10100nobody shots (−6) and venom shots (−3)
Slime.mkslime.slime102002% per cycleties and viruses
Venom.strvenom.venom1100noit is ammunition: it paralyzes
Poison.strpoison.poison41002% per cycleenergy shots (−1), memory shots and steals through a tie

Making them

The DNA writes how much it wants to add in the command for each substance. The engine makes it in the actions phase of the same cycle, before the shots (so venom that was just made can already be shot in that cycle), and sets the command back to 0. To keep making more you have to write it again.

The price has two parts:

This bot makes 100 of each in its first cycle:

' A hundred of each defense at birth
cond
 *.robage 0 =
start
 100 .mkshell store
 100 .mkslime store
 100 .strvenom store
 100 .strpoison store
stop

Without transaction costs it costs 145 energy (10 + 10 + 100 + 25). With the costs of the F1 preset it pays 22 more, and those 22 show up in its waste.

A few details:

What wears off on its own

Slime and poison lose 2% per cycle, at the start of the forces and collisions phase. A reserve that isn't topped up is cut in half in about 35 cycles. If you top up the same amount every cycle, the reserve settles near 50 times that amount: with 200 of slime per cycle, near 10000; with 100 of poison, near 5000.

Shell and venom don't wear off on their own: they stay until shots eat them, you shoot them, or you dismantle them.

Shell

Shell stands between some shots and the bot. Each hit eats the shell first, and only what's left reaches the bot.

It doesn't stop energy shots (−1), memory shots, waste shots or viruses. For the first two there is poison.

The hidden cost is weight: every 200 of shell weigh the same as 1000 of body (.mass), and a heavier bot accelerates less with the same thrust (see Physics).

Slime

Slime doesn't stop energy, body or venom shots (see Shots). It works against two things:

Since it evaporates, a layer of slime has to be topped up every cycle.

Venom

Venom is a weapon: it is shot with -3 in .shoot. The shot carries whatever .shootval says (unsigned and never more than you have) or, if it is 0, a twentieth of your .venom. Besides the venom itself, it costs the cost of shooting like every other shot.

When it hits a bot of another species:

  1. Its shell stops as much as it can (see above).
  2. The venom that gets through is turned into cycles of paralysis: each point of venom, one cycle, added to whatever it already had (up to 32000).
  3. The victim receives your .vloc and .venval pair, just as they were when you shot, and it replaces the one from any earlier hit.

As long as it has cycles of paralysis left, the engine writes the .venval into the victim's .vloc cell every cycle. It does this at the start of the forces and collisions phase, after its DNA has run and before the actions, so the command you set is carried out in that same cycle and its DNA can't correct it. Apart from that, the paralyzed bot keeps working: it moves, shoots and runs its DNA. The victim sees how many cycles it has left in .paralyzed.

If it hits one of your own species, it doesn't paralyze it: the venom is added to its reserve.

' At birth: my venom makes the victim give away energy
cond
 *.robage 0 =
start
 .shoot .vloc store
 -2 .venval store
 100 .strvenom store
stop

' I look for something to look at
cond
 *.eye5 0 =
start
 40 .aimdx store
stop

' I shoot 30 venom at it, just once
cond
 *.eye5 0 >
 *.venom 30 >
 *50 0 =
start
 30 .shootval store
 -3 .shoot store
 1 50 store
stop

In the test, against a stationary bot, the target ended up paralyzed for about 30 cycles. In each one it shot a gift with 1% of its energy and ended up 781 down. Since the target wasn't looking at the shooter, those gifts were lost into the void.

Venom can also be injected through a tie (see Ties and multicellular bots).

Poison

Poison isn't shot: it is a passive defense that acts when you get bitten.

It doesn't stop −6 shots: that's what shell is for.

The poison shot travels like any other, with your .ploc and your .pval from that moment. When it hits a bot of another species, it adds cycles of poisoning: the force of the hit divided by 1.5 (up to 32000). In the test, the bite from a bot with 1000 body (220 force) left it with 145 cycles of poisoning. For as long as they last, the engine writes your .pval into its .ploc cell every cycle, at the same moment as paralysis. The poisoned bot sees how many cycles it has left in .poisoned.

If the poison hits one of your own species, it is added to its reserve and doesn't poison it. So biting a toxic sibling doesn't feed you either, but it doesn't poison you.

A very effective use is to point .ploc at .shoot with .pval at 0: the poisoned bot has its shoot command cleared every cycle and can't bite again.

' Whoever bites me stops shooting: their .shoot stays at 0
cond
 *.robage 0 =
start
 .shoot .ploc store
 0 .pval store
stop

cond
 *.poison 1000 <
start
 100 .strpoison store
stop

In the test, a hunter that kept shooting −1 went 200 cycles without gaining any energy. Every time its poisoning ran out it went back to biting, and the poison stopped it again.

Where venom or poison writes

The rules for .vloc and .ploc are the same:

ValueVictim's cell
1 to 1000that cell
greater than 1000taken modulo 1000, like an address (1050 is 50)
0 or negativea random one on each hit
340 (.delgene)none: it is protected

They are configuration: the engine doesn't clear them, but a newborn starts with everything at 0. That's why many bots set them with *.robage 0 =. Each cycle the paralysis or poisoning count drops by 1, and when it runs out the engine stops writing. A bot can be paralyzed and poisoned at the same time, and then the engine overwrites two cells.

A Bestiary bot

Alga Toxicus uses venom and poison in three genes. At birth it points both cells at .shoot and chooses -2 for its venom. Then it shoots venom every cycle toward a random side and, when it has energy to spare, it reproduces and tops up both reserves:

cond
 *.robage 0 =
start
 .shoot .ploc store
 .shoot .vloc store
 -2 .venval store
stop

cond
start
 120 rnd .aimdx store
 -3 .shoot store
stop

cond
 *.nrg 1000 >
start
 50 .repro store
 100 .strpoison store
 100 .strvenom store
stop
end

Whoever gets paralyzed gives away energy every cycle, and whoever bites it ends up unable to shoot, because its .pval is 0. In a test against a hunter that shoots −1 at everything it sees, the hunter was paralyzed almost immediately: since its .shoot received −2 every cycle, it never got to bite, and in 120 cycles it went from 3000 to 935 energy.

What another bot has of each substance can be seen by looking at it, in .refshell, .refvenom and .refpoison (see What it sees (ref*)). The strategies that live off these defenses are in Defensive bots.