Environment#

_images/theturmites3.jpg

World#

Straylight Protocol has 256 Worlds on Optimism and 24 Worlds on Ethereum Mainnet. A world is akin to a gameboard (isometric grid) on which Agents can move. Every board is composed of 144*144 squares – whereby every square of the board is initialized by the color black – which can be overwritten by an agent with either white or black. The agent computes its movement with the ruleset based on the state of the square. Worlds are contiguous – which means agents moving out on the right edge reappear on the left edge etc. Technically each World is a two-dimensional byte-array which contains 144*144 bytes and assigned an integer value of 0-255. Every byte represents one pixel in an 8-Bit Bitmap. The minting process facilitates four Agents per World in the following positions:

console
[36,72]
[72,36]
[72,108]
[108,72]

There are various ways of accessing the individual bytes – as well as rendering the whole gameboard from the contract.

console
Straylight.getbit(uint256 POSITIONX, uint256 POSITIONY, uint256 BOARDNUMBER)

Rendering the BMP

console
Straylight.getBitmap(uint256 BOARDNUMBER, uint256 POSITIONX, uint256 POSITIONY, bool RENDERTURMITE)

Rendering the BMP embedded and scaled in an SVG

console
Straylight.getSvg(uint256 BOARDNUMBER, uint256 POSITIONX, uint256 POSITIONY, bool RENDERTURMITE)

Agents#

Every Agent is an NFT and a functional two-state turmite that can move on its own gameboard.

_images/ff0401000801ff0000000801_19066_0.png

“Anyone who has ever seen a termite mound must have been impressed by the complex patterns of tunnels built by the industrious but mindless insects. Paradoxically, artificial forms of life that make termites look like geniuses can produce equally astounding creations. Take tur-mites, for example. They are squarish, cybernetic creatures that have the most rudimentary of brains. And yet as they move about on the infinite plane on which they live, they trace out strange patterns that appear to reflect an underlying intelligent design.”

It is not easy to assign the discovery of the turmites to a date, single person or research institution. In 1986 Chris G. Langton discovered the Langton Ant, a special form of the turmite which used a simplistic ruleset, but displayed complex emergent behaviors. Independently Allen H. Brady and Greg Turk were also experimenting with two-dimensional Turing machines in 1988/1989. Then, in a 1989 letter between Greg Turk and A. K. Dewdney, Dewdney coined the computational process “turmite” in 1989 – a portmanteau of Alan Turing and termites.

A turmite today describes a Turing machine with an internal state, an orientation, and an instruction set placed on an isometric grid. In nontechnical terms it’s a program which can generate procedural patterns and interact with its environment.

_images/ff0801000001ff0001000800_11883_0.png

Turmites in Straylight have the following attributes which get rendered as Json NFT Atrributes through tokenUri()

console
uint8 turposx;         //X Position
uint8 turposy;         //Y Position
uint8 orientation;
uint8 boardnumber;
bytes1 state;
bytes12 rule;

Note that all of these attributes change constantly. The Identity of the NFT can’t be derived solely from the attributes – but only from the history of user actions, agent-based inscriptions, and the traces these leave.

Rulesets#

A ruleset which defines the movement and pattern of the turmite in Straylight is expressed in 12 bytes for simplicity – thereby 3 bytes always forms one rule. The format used for the rulesets define various properties including the direction of the turmite and formulate its internal state. The first byte is representative of the color with which the underlying square will get overwritten by the turmite (either Black or White). The second byte describes the direction in which the tumite will turn (left, right, u-turn) – and the third byte describes the forthcoming internal state of the turmite (0,1).

console
// ff0801 ff0201 ff0000 000001
// Rule1  Rule2  ...
// c d s  c d s  ...s1

Since the formal grammar of the ruleset is unequivocal, it is possible to generate all possible rules which are computable by the turmite. Since the ruleset can be written as context-sensitive grammar, these production rules can be formalized by the following with a start symbol S:

console
S       →       a  a  a
a       →       c  d  s
c       →       ff | 00
d       →       02 | 08 | 04
s       →       01 | 00
_images/ff0200000001000000ff0801_7922_0.png

There are ~60000 possible rules, with many doubling or being inverted. For the interface and minting process there are a possibility of 341 pre-selected rulesets; but the user is also free to create their own rulesets during the minting process in order to reprogram their turmite (see also Haecceity Mode section).