Conditionless Bots

From WikiManual
Revision as of 23:35, 22 January 2006 by 66.91.141.218 (talk) (conditionless bots)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

These are bots that use boolean style logic gates, created from basic math rules and equations.

Typically this is done to reduce costs associated with normal conditions.

True or False

True conditions result in the memory location being multiplied by 1. A false results in a 0 or -1 multipliation, stoping the action.

Basic

The simpliest memory locations to use are those that are already either a one or zero; .hit, .edge, and .fixed are prime examples.

20 .up *.hit mult store
.hit *.hit mult dec

This code moves the bot whenever it is hit, then zero's the memory location of hit. Since hit can only have the values zero or one it's a breeze to use.

Suppose now we want the bots to react when a value is zero, like say looking around when nothing is seen. A typical mult will cause the bot to cancel the action. To use zero we'll have to convert it into a one.

314 rnd .aimdx
*.eye5 sgn 1 sub -1 mult mult
store

The middle is the code we're interested in. First the sign(sgn) of eye5 is found, then one is subtracted(sub) from it; resulting in zero(positive value) or -1(no value). Next it is multiplied by -1, perhaps the most important step this takes advantage of zero remaining the same and -1 becoming a positive one. At last we have our true value which we multiply by aimdx to make the bot turn only when it doesn't see anything.

Moderate

Equal or Not?