brain
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
brain
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game/bots/brain.module — toddler soldier bots (GAMEPLAY slice). 4 red allies + 5 blue enemies. Each bot is an actor (see game.match) with a root entity carrying a characters.toddler visual. Behaviour: patrol (waypoints, cover pieces, the sandbox) → spot an enemy within BOT.sightRange with a line-of-sight raycast → after BOT.reactionTime start shooting in bursts with BOT.aimError, moving to the far side of a nearby cover_* piece, holding / peeking / strafing → occasionally lob a pinecone (BOT.grenadeChance per second, 3 per life) → retreat to a juice box when hurt. Stunned bots freeze; tagged bots sit in TIME-OUT then respawn.
rand(a: number, b: number) → number
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
pose(b: any, p: string, rate: number?) → void
| arg | type | description |
|---|---|---|
| b | any | |
| p | string | |
| rate | number? |
markerList(glob: string) → void
| arg | type | description |
|---|---|---|
| glob | string |
spawnPoint(team: string, i: number) → vector
| arg | type | description |
|---|---|---|
| team | string | |
| i | number |
scanArena( ) → void
covers( ) → void
makeBot(ctx: any, team: string, idx: number, name: string) → any
| arg | type | description |
|---|---|---|
| ctx | any | |
| team | string | |
| idx | number | |
| name | string |
pos( ) → void
spawnAll(ctx: any) → void
| arg | type | description |
|---|---|---|
| ctx | any |
list( ) → void
respawn(b: any) → void
| arg | type | description |
|---|---|---|
| b | any |
resetAll( ) → void
onTagged(b: any) → void
Called by match when a bot is tagged.
| arg | type | description |
|---|---|---|
| b | any |
onStunned(b: any, secs: number) → void
| arg | type | description |
|---|---|---|
| b | any | |
| secs | number |
onHurt(b: any, attacker: any) → void
| arg | type | description |
|---|---|---|
| b | any | |
| attacker | any |
blocked(ctx: any, p: vector, dir: vector, dist: number) → boolean
| arg | type | description |
|---|---|---|
| ctx | any | |
| p | vector | |
| dir | vector | |
| dist | number |
moveToward(ctx: any, b: any, goal: vector, speed: number, dt: number) → boolean
Steps toward `goal`; returns true when reached (or hopeless).
| arg | type | description |
|---|---|---|
| ctx | any | |
| b | any | |
| goal | vector | |
| speed | number | |
| dt | number |
faceYaw(b: any, targetYaw: number, dt: number) → void
| arg | type | description |
|---|---|---|
| b | any | |
| targetYaw | number | |
| dt | number |
coverSpot(b: any, threat: vector) → vector
Cover spot: on the far side of a cover piece from the threat.
| arg | type | description |
|---|---|---|
| b | any | |
| threat | vector |
pickWaypoint(b: any) → vector
| arg | type | description |
|---|---|---|
| b | any |
eye(p: vector) → vector
| arg | type | description |
|---|---|---|
| p | vector |
findTarget(ctx: any, b: any) → any
| arg | type | description |
|---|---|---|
| ctx | any | |
| b | any |
muzzle(b: any) → vector
| arg | type | description |
|---|---|---|
| b | any |
shoot(ctx: any, b: any, t: any) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| b | any | |
| t | any |
throwNade(ctx: any, b: any, t: any) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| b | any | |
| t | any |
think(ctx: any, b: any, dt: number, playing: boolean) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| b | any | |
| dt | number | |
| playing | boolean |
update(ctx: any, dt: number, playing: boolean) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| dt | number | |
| playing | boolean |
clear( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
These counts cover only the parts this page shows. Problems on the parts it leaves out are not counted here.
This asset
●1problemagent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.