Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v2 source pure

Package strata (v2, "Derin Zaman") is a Sinopia engine: a geological plate of an invented earth. On the left a cross-...

Overview

Package strata (v2, "Derin Zaman") is a Sinopia engine: a geological plate of an invented earth. On the left a cross-section: beds of eight rock types, each with its own texture, folded by an integer sine field, cut by faults (every bed boundary steps along the fault plane), crossed by dikes, sills or quartz veins, sometimes truncated by an angular unconformity, with fossils in the beds and the present land surface on top (meadow, forest, bare rock or snow). On the right the stratigraphic column of the same beds: each formation named (Kızıldere, Akyayla, ...), dated in Ma, drawn with its true thickness and a width by its resistance (a weathering profile), fossils and events marked. Rare events tell a story: an aquifer with its well, a karst cave, an oil trap under an anticline with its derrick, a gold vein, an impact boundary.

It is the successor of Strata v1 (p/.../art/strata/v1, which stays untouched): the same FNV-1a + splitmix64 streams (seed+"|traits" and seed+"|art") and the same integer sine table, a new picture. frontend/src/engines/stratav2.ts is a byte-identical TypeScript twin; strata_test.gno pins golden vectors that the twin asserts too.

Unlike v1 the art reads Input.TokenID (the column's title, "Section 42"). It never reads heights or moves, so the engine is not living. Pure integer maths: no floats, no time, no block data.

Constants 3

const DefaultParams

1const DefaultParams = `{"era":"Seeded","folding":"Seeded","surface":"Seeded"}`
source

DefaultParams is the canonical form of the defaults; it renders exactly like "".

const MaxSVGBytes

1const MaxSVGBytes = 28672
source

MaxSVGBytes: the largest output measured is 16,755 B (10,000 default seeds and 8,000 params renders, docs/engines/strata-v2.md); about 1.7x margin, within the 28 KB budget.

const ParamsSchema

1const ParamsSchema = `{"type":"object","properties":{` +
2	`"era":{"type":"string","title":"Era","enum":["Seeded","Red Beds","Chalk Sea","Volcanic Arc","Coal Age",` +
3	`"Desert Dunes","Ice Age","Lapis Vein"],"default":"Seeded"},` +
4	`"folding":{"type":"string","title":"Folding","enum":["Seeded","Flat","Gentle","Folded","Contorted"],"default":"Seeded"},` +
5	`"surface":{"type":"string","title":"Surface","enum":["Seeded","Meadow","Forest","Bare Rock","Snow"],"default":"Seeded"}}}`
source

ParamsSchema is the Studio form. Studio sends JSON.stringify of the values in this property order; ValidateParams accepts exactly that or "".

Functions 9

func Manifest

1func Manifest() engine.Manifest
source

Manifest describes the engine. Author and FeeBps are set by the adapter.

func Render

1func Render(in engine.Input) string
source

Render returns the raw SVG for in.Seed, in.Params and in.TokenID.

func SVG

1func SVG(seed string, cfg Config, tokenID string) string
source

SVG renders a seed under cfg with the token number tokenID. The art stream's draw order is part of the contract (it mirrors stratav2.ts).

func SectionNumber

1func SectionNumber(tokenID string) int
source

SectionNumber is the number in the column title: Input.TokenID read as a decimal, modulo 1,000,000. Anything but ASCII digits (or "") is 0.

func Traits

1func Traits(in engine.Input) []engine.Trait
source

Traits returns the eight traits of in.Seed in TraitTypes order. It never renders: eight draws and a score.

func ValidateParams

1func ValidateParams(params string) error
source

ValidateParams accepts "" (the showcase defaults) and the canonical JSON.

func Defaults

1func Defaults() Config
source

Defaults is the showcase look (params "").

func ParseParams

1func ParseParams(params string) (Config, error)
source

ParseParams accepts "" or the canonical JSON Studio produces, nothing else.

func TraitsOf

1func TraitsOf(seed string, cfg Config) TraitSet
source

TraitsOf returns the traits of a seed under cfg.

Types 2

type Config

struct
1type Config struct {
2	Era, Folding, Surface int
3}
source

Config is a parsed params string; -1 means drawn from the seed.

type TraitSet

struct
1type TraitSet struct {
2	Era, Event, Fossil, Intrusion, Folding, Tectonics, Surface, Rarity string
3	Score                                                              int
4}
source

TraitSet is the decoded traits of a seed; the picture reads the same draw.

Dependencies

Source Files 2