RegulationKicks
untyped bigint// kicks each side takes before sudden death (win by 1), or at most
Value
(5 <untyped> bigint)
DefaultWinBy
untyped bigint// goals a challenger must win by, unless the creator chose 1 or 3
Value
(2 <untyped> bigint)
MaxWinBy
untyped bigintValue
(3 <untyped> bigint)
CreatorPercent
untyped bigint// of the pot, paid to the game's creator when it is won
Value
(20 <untyped> bigint)
MinDeposit
untyped bigint// ugnot to seed a pot (1 GNOT)
Value
(1000000 <untyped> bigint)
MinEntryFee
untyped bigint// ugnot (0.1 GNOT)
Value
(100000 <untyped> bigint)
DefaultTimeout
untyped bigint// blocks a challenger may sit idle
Value
(1000 <untyped> bigint)
MinTimeout
untyped bigintValue
(30 <untyped> bigint)
MaxTimeout
untyped bigintValue
(200000 <untyped> bigint)
engine
typeValue
v3.engine
instance
*v3.engine- OID
- 04357b…6aaf:4
instance details
Instance
func() shots.ImplInstance returns the implementation, for a caller that registers it explicitly rather than relying on init.
- OID
- 04357b…6aaf:6
Instance details
init.12
func()- OID
- 04357b…6aaf:8
init.12 details
winBys
*v0.Tree// game id -> int
- OID
- 04357b…6aaf:10
winBys details
WinBy
func(gameID uint64) intWinBy is how many goals a challenger must win game gameID by: as chosen at creation, or 1 for a game created before this implementation.
- OID
- 04357b…6aaf:12
WinBy details
setWinBy
func(gameID uint64, winBy int)setWinBy records a new game's margin. It crosses into this realm: the engine's methods run as the shots realm, which may not write this realm's table.
- OID
- 04357b…6aaf:13
setWinBy details
takeWinBy
func(config string) (int, string)takeWinBy removes "winBy=N" from a config string, returning N (DefaultWinBy if absent) and the rest for penalty.ParseConfig.
- OID
- 04357b…6aaf:14
takeWinBy details
checkConstants
func(cfg v0.Config) stringcheckConstants allows a game four small changes from the default constants, and nothing else: the chain's mixes are the equilibrium of the default game, and every change opens a gap a skilled player can use. Within these ranges a player who plays the best moves wins 11-14% of shootouts (against 11% under the defaults); outside them up to 40%, which no pot survives. The ranges, as the web client offers them: goal width goalWidth 6400..7000 mm keeper size keeperScale 1117..1235 (95..105% of 1176) keeper agility diveMin and diveMax at 90..105% of 2600 and 5200, together (diveMax = 2 x diveMin) shot speed ballMaxSpeed 34000..37400 mm/s (100..110%) It returns why cfg is refused, or "".
- OID
- 04357b…6aaf:15
checkConstants details
decided
func(sc v0.Shootout, winBy int) v0.Sidedecided says whether a shootout is over, and who won it. Win by 1 is a normal shootout (penalty.Shootout's rules, sudden death included). For a larger margin it is SidePlayer once the player is sure to finish winBy goals ahead after RegulationKicks each, SideChain once they no longer can, and 0 while it is open.
- OID
- 04357b…6aaf:16
decided details
settled
func(s v0.Session) v0.Sessionsettled is an ended session as it stays on chain: everything but its kicks (see SETTLING).
- OID
- 04357b…6aaf:17
settled details
entropy
func(g v0.Game, s v0.Session, blockTime int64) v0.Seedentropy is the kick's 32-byte seed: SHA-256 of the block time and the kick's identity (see the package comment for what that does and does not guarantee).
- OID
- 04357b…6aaf:18
entropy details
mustGame
func(st *shots.StateRef, id uint64) v0.Game- OID
- 04357b…6aaf:19
mustGame details
session
func(st *shots.StateRef, id uint64, no int) (v0.Session, bool)session reads the live session of a game as this realm's own copy.
- OID
- 04357b…6aaf:20
session details
ownGame
func(g v0.Game) v0.GameownGame and ownSession rebuild values read through shots.Store in this realm. What Store hands back was allocated by the shots realm, and the VM refuses writes to another realm's objects (a pointer-method update such as Shootout.Record trips its cross-realm check), so the engine only ever mutates copies it built itself; PutGame/PutSession copy them back.
- OID
- 04357b…6aaf:21
ownGame details
ownSession
func(s v0.Session) v0.Session- OID
- 04357b…6aaf:22
ownSession details
mustPlayersSession
func(st *shots.StateRef, gameID uint64, player .uverse.address) (v0.Game, v0.Session)- OID
- 04357b…6aaf:23
mustPlayersSession details
itoa
func(n int64) string- OID
- 04357b…6aaf:24
itoa details
u64
func(n uint64) string- OID
- 04357b…6aaf:25
u64 details
chainPlan
typechainPlan is a keeper plan of the chain's mix: cum is the cumulative weight out of 65536 (the seed's first two bytes pick the first entry above them), the rest the plan's four uint16 under the default constants.
Value
v3.chainPlan
chainKick
typechainKick is a kick of the chain's mix, in the realm's units for the default goal: aim mm, contact milli-radii, power per-mille.
Value
v3.chainKick
chainKeeper
[]v3.chainPlanThe equilibrium mixes for the default constants (a double-oracle solution of the shooter-keeper game on the physics engine; the value is a 78.5% conversion rate). Plans: a third wait and read the shot; the rest dive fast across the goal, mid-height or low. Kicks: low and hard 2.2 m out, top corners, high down the middle.
- OID
- 04357b…6aaf:27
chainKeeper details
chainKicks
[]v3.chainKick- OID
- 04357b…6aaf:36
chainKicks details
pick
func(u uint32, cum func(...), n int) intpick is the index of the first entry whose cumulative weight is above u.
- OID
- 04357b…6aaf:47
pick details
seedU16
func(s v0.Seed) uint32- OID
- 04357b…6aaf:48
seedU16 details
keeperFor
func(seed v0.Seed, c v0.Config) v0.KeeperPlankeeperFor is the chain's keeper plan for a kick. Under constants with other mode bands (StarShare, ReadShare) a plan keeps its mode: a read stays a read, and a dive keeps its place within the dive band.
- OID
- 04357b…6aaf:49
keeperFor details
kickFor
func(seed v0.Seed, c v0.Config) v0.ShotInputkickFor is the chain's kick, its aim scaled to the game's goal and its contact kept inside the game's selectable disc.
- OID
- 04357b…6aaf:50
kickFor details
isqrt
func(n int64) int64- OID
- 04357b…6aaf:51