Documentation
¶
Overview ¶
Package game is a game layer for NSGo apps: a fixed-step loop, input actions, sprites, tilemaps, scenes and sound, built on NSGo's public API only, so an app that does not import it links none of it.
This package holds Loop, which the others share. Each domain has a package of its own: math2d for 2D vectors, rectangles, circles and affine transforms, sprite for atlases, sprites, animations and batches, and sound for the mixer, its effects and music; input, tilemap (with the camera) and scene follow, and examples holds sample games.
Index ¶
- type Loop
- func (l *Loop) EffectiveTimeScale() float64
- func (l *Loop) Elapsed() time.Duration
- func (l *Loop) ElapsedSeconds() float64
- func (l *Loop) MarkDirty()
- func (l *Loop) Run(cx *core.Scope) (stop func())
- func (l *Loop) SetPaused(paused bool)
- func (l *Loop) SetTimeScale(scale float64)
- func (l *Loop) Step(n int)
- func (l *Loop) StepDuration() time.Duration
- func (l *Loop) StepNow(n int) int
- func (l *Loop) StepOnce()
- func (l *Loop) StepRate() int
- func (l *Loop) Steps() uint64
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loop ¶
type Loop struct {
// Rate is how many updates run a second, 60 when 0.
Rate int
// MaxSteps is the most updates one frame runs, Rate/10 (a tenth of a second's updates) and at least 1 when 0. A frame that would run more drops the whole steps past it, so an Update slower than its step, or a long hitch, slows the game rather than making each frame run more updates than the last.
MaxSteps int
// Paused stops Update from advancing with display time while Draw keeps running. Unpausing resumes from the current frame without a catch-up backlog.
Paused bool
// TimeScale scales simulated time, 1 when 0 or less (or not finite). Update still receives the fixed 1/Rate step, so 0.5 runs half as many updates a second and 2 runs twice as many.
TimeScale float64
// DrawRate caps Draw to at most DrawRate calls a second, uncapped when 0 or less. Update still runs at Rate.
DrawRate int
// OnDemand skips Draw on frames where no Update ran, unless MarkDirty has been called since the last Draw.
OnDemand bool
// Immersive hides a phone's system bars (mobile.Immersive) while the game plays, that is while the loop runs and is not Paused, and brings them back while it is Paused, as under a pause menu, and once it stops or its scope is disposed. The loop hides them as it starts or resumes in the foreground and applies a change to Immersive or Paused on its next frame, and leaves the bars as they are while the app is in the background. Desktop and web targets ignore it.
Immersive bool
// Update moves the game on by dt, which is always 1/Rate seconds.
Update func(dt time.Duration)
// Draw draws the frame; alpha, from 0 up to but not including 1, is how far the frame falls between the last update and the next.
Draw func(alpha float64)
// FrameTime, when set, receives each frame's length, the time it adds (0 for a frame stamped before the run started or resumed), ahead of the frame's updates. It is what frame-time statistics such as quality.Selector's read; a frame that ends a pause in the background measures from the time the window showed again, not the time away. It fires while Paused is set too, so a caller measuring only frames that simulate skips those itself.
FrameTime func(dt time.Duration)
// OnPause, when set, runs whenever Paused changes, so subsystems such as sound.Mixer (sound.Mixer.SetPaused) pause and resume with the loop. SetPaused calls it at once when the state changes; changing Paused directly calls it on the next frame, or in the same frame when Update changes it. If Paused is already true when Run starts, Run calls OnPause(true). Backgrounding does not call OnPause; both Loop and sound.Mixer follow core.Env.Lifecycle directly.
OnPause func(paused bool)
// contains filtered or unexported fields
}
Loop runs a game's updates at a fixed rate on a scope's display frames, and draws once a frame in between.
Each frame adds the time since the last one and runs Update once for each whole step of 1/Rate seconds it holds, zero or more times, then Draw once with how far the time left over reaches into the next step. A game moves its state in Update by the fixed dt, so it plays alike at any display rate, and Draw places what moves between the last two states by alpha, so it moves smoothly at any display rate.
Run reads the fields on each frame, so a game may change them while the loop runs.
Example ¶
Loop runs fixed updates on display frames. Here a root scope with a manual clock stands in for the app, and each RunFrame is one display frame 1/60 s after the last. The first frame starts the loop's clock, so the 59 frame intervals that follow give 29 updates at 30 Hz while every frame draws.
package main
import (
"fmt"
"time"
"github.com/nsgo-dev/game/packages/game"
"github.com/nsgo-dev/nsgo/core"
)
func main() {
clock := core.NewManualClock(time.Unix(0, 0))
frameWanted := false
root := core.NewRoot(core.RootOptions{Clock: clock, RequestFrame: func() { frameWanted = true }})
defer root.Dispose()
updates, draws := 0, 0
loop := &game.Loop{
Rate: 30,
Update: func(dt time.Duration) { updates++ },
Draw: func(alpha float64) { draws++ },
}
stop := loop.Run(root)
defer stop()
for range 60 {
clock.Advance(time.Second / 60)
if frameWanted {
frameWanted = false
root.RunFrame()
}
}
fmt.Println("updates:", updates, "draws:", draws)
}
Output: updates: 29 draws: 60
func (*Loop) EffectiveTimeScale ¶
EffectiveTimeScale returns the simulation time scale actually applied by Run (TimeScale when finite and > 0, else 1).
func (*Loop) Elapsed ¶
Elapsed returns the simulated game time advanced by fixed Update steps, rounded to the nearest nanosecond from ElapsedSeconds (so 60 steps at 60 Hz is exactly time.Second).
func (*Loop) ElapsedSeconds ¶
ElapsedSeconds returns the simulated game time advanced by fixed Update steps in seconds. Each contiguous run at a fixed rate contributes steps/rate seconds without integer-nanosecond drift, so 60 steps at 60 Hz is exactly 1.0.
func (*Loop) MarkDirty ¶
func (l *Loop) MarkDirty()
MarkDirty requests a Draw on the next frame when OnDemand is true.
func (*Loop) Run ¶
Run starts the loop on cx's display frames until cx is disposed or stop is called.
The loop pauses while cx's window is in the background (core.Env.Lifecycle), that is hidden, minimized or covered on a desktop and the app in the background on a phone, and resumes from the time it shows again, so the time away runs no updates. While running in the foreground it keeps the display awake (core.Scope.KeepAwake), releasing the hold when paused, stopped or disposed.
A frame adds the time between its display time and the last frame's, as core.Scope.RequestAnimationFrame gives it: the display's own frame time where the platform stamps one, so the frame length is the display's rather than when the engine got to the frame, and the graph clock's otherwise. The first frame after the loop starts or resumes adds the time from then to its display time, which may lie a frame ahead where the display stamps a frame with when it will show, so the loop's time is the shown frame's. A frame stamped before the time the loop started or resumed adds nothing, and the next frame adds the time from then.
With Immersive set, the run hides the system bars while the game plays and shows them again when it is paused, stopped or disposed. Runs in the same window share the bars: they stay hidden while any of them plays with Immersive set, and come back once the last of those pauses or ends, so a scene that starts its own loop before the last scene's loop is disposed keeps them hidden.
func (*Loop) SetPaused ¶
SetPaused pauses or resumes the loop's updates without accumulating a catch-up backlog, calling OnPause if the paused state changed.
func (*Loop) SetTimeScale ¶
SetTimeScale sets the simulation time scale; values at or below 0 run at 1.
func (*Loop) Step ¶
Step queues n fixed updates to run on the next display frame while Paused is true, redrawing afterward. Values at or below 0 do nothing.
Example ¶
SetPaused stops updates while frames keep drawing, and Step queues single updates while paused, as a debugger's frame advance does.
package main
import (
"fmt"
"time"
"github.com/nsgo-dev/game/packages/game"
"github.com/nsgo-dev/nsgo/core"
)
func main() {
clock := core.NewManualClock(time.Unix(0, 0))
frameWanted := false
root := core.NewRoot(core.RootOptions{Clock: clock, RequestFrame: func() { frameWanted = true }})
defer root.Dispose()
updates := 0
loop := &game.Loop{Update: func(time.Duration) { updates++ }, Draw: func(float64) {}}
defer loop.Run(root)()
frame := func() {
clock.Advance(time.Second / 60)
if frameWanted {
frameWanted = false
root.RunFrame()
}
}
loop.SetPaused(true)
for range 10 {
frame()
}
fmt.Println("paused:", updates)
loop.Step(3)
frame()
fmt.Println("after Step(3):", updates)
}
Output: paused: 0 after Step(3): 3
func (*Loop) StepDuration ¶
StepDuration returns the fixed duration passed to Update (time.Second / StepRate()).
func (*Loop) StepNow ¶
StepNow synchronously executes n fixed Update steps right away (whether Paused is true or false), followed by a Draw when Draw is set, and returns how many steps ran. Values at or below 0 do nothing and return 0. If Update stops an active Run, StepNow stops immediately without calling Draw.
func (*Loop) StepOnce ¶
func (l *Loop) StepOnce()
StepOnce queues one fixed update to run on the next display frame while Paused is true.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package a11y adds game accessibility primitives built on NSGo's public API: live captions for dialogue and sound effects, color-blind-safe palettes with CVD simulation and WCAG contrast helpers, persistent assist options, and screen-reader-ready native menus.
|
Package a11y adds game accessibility primitives built on NSGo's public API: live captions for dialogue and sound effects, color-blind-safe palettes with CVD simulation and WCAG contrast helpers, persistent assist options, and screen-reader-ready native menus. |
|
Package ability runs gameplay abilities with costs, cooldowns, charges, cast and channel times and conditions, activated by input actions and advanced one fixed game.Loop step at a time.
|
Package ability runs gameplay abilities with costs, cooldowns, charges, cast and channel times and conditions, activated by input actions and advanced one fixed game.Loop step at a time. |
|
Package accounts is a self-hostable player account service: guest accounts that upgrade to email sign-in or to a linked OAuth or platform identity (Game Center, Play Games, Steam), and short-lived tokens a game server verifies offline.
|
Package accounts is a self-hostable player account service: guest accounts that upgrade to email sign-in or to a linked OAuth or platform identity (Game Center, Play Games, Steam), and short-lived tokens a game server verifies offline. |
|
cmd/accountsd
command
Command accountsd runs the account service as a standalone HTTP server, with guest and email accounts in SQLite or Postgres.
|
Command accountsd runs the account service as a standalone HTTP server, with guest and email accounts in SQLite or Postgres. |
|
pgstore
Package pgstore opens an accounts.Store in a Postgres database with the github.com/jackc/pgx/v5 driver.
|
Package pgstore opens an accounts.Store in a Postgres database with the github.com/jackc/pgx/v5 driver. |
|
sqlitestore
Package sqlitestore opens an accounts.Store in a SQLite database file, with the pure-Go modernc.org/sqlite driver (no cgo).
|
Package sqlitestore opens an accounts.Store in a SQLite database file, with the pure-Go modernc.org/sqlite driver (no cgo). |
|
sqlstore
Package sqlstore is an accounts.Store over database/sql, shared by the SQLite (package sqlitestore) and Postgres (package pgstore) stores.
|
Package sqlstore is an accounts.Store over database/sql, shared by the SQLite (package sqlitestore) and Postgres (package pgstore) stores. |
|
storetest
Package storetest checks an accounts.Store implementation against the Store contract.
|
Package storetest checks an accounts.Store implementation against the Store contract. |
|
token
Package token issues and verifies the short-lived player tokens of the accounts service.
|
Package token issues and verifies the short-lived player tokens of the accounts service. |
|
Package achievements declares a game's achievements once, in a versioned YAML file, tracks each player's progress toward them, and reports that progress through NSGo's platform game services: Game Center on macOS, iOS and tvOS, and Google Play Games Services on Android.
|
Package achievements declares a game's achievements once, in a versioned YAML file, tracks each player's progress toward them, and reports that progress through NSGo's platform game services: Game Center on macOS, iOS and tvOS, and Google Play Games Services on Android. |
|
Package ai provides deterministic game AI building blocks: grid A* pathfinding (with line-of-sight smoothing, bounded expansion budgets, partial paths, incremental searches, and budgeted request queues), HPA* hierarchical pathfinding with incremental cluster updates, Jump Point Search (JPS) for uniform-cost grids, generic graph A*/Dijkstra/range search with hex tilemap adapters and 2D/3D waypoint graphs, 2D navigation meshes with funnel smoothing, polygon areas/filters, and path-corridor navigation agents, steering behaviors, velocity-based local avoidance (ORCA) in 2D and 3D XZ, behavior trees, utility AI scoring, goal-oriented action planning (GOAP), attack token pools, engagement slot assignment, squad coordination, spatial influence maps, tactical position queries with cover points, and perception with sight, hearing and memory.
|
Package ai provides deterministic game AI building blocks: grid A* pathfinding (with line-of-sight smoothing, bounded expansion budgets, partial paths, incremental searches, and budgeted request queues), HPA* hierarchical pathfinding with incremental cluster updates, Jump Point Search (JPS) for uniform-cost grids, generic graph A*/Dijkstra/range search with hex tilemap adapters and 2D/3D waypoint graphs, 2D navigation meshes with funnel smoothing, polygon areas/filters, and path-corridor navigation agents, steering behaviors, velocity-based local avoidance (ORCA) in 2D and 3D XZ, behavior trees, utility AI scoring, goal-oriented action planning (GOAP), attack token pools, engagement slot assignment, squad coordination, spatial influence maps, tactical position queries with cover points, and perception with sight, hearing and memory. |
|
internal/sense
Package sense is the perception engine behind ai.PerceptionSystem and perception3d.System: sight cones, a round-robin line-of-sight budget, hearing, and per-stimulus memory, all on float64 3D vectors so the 2D and 3D front ends share one implementation.
|
Package sense is the perception engine behind ai.PerceptionSystem and perception3d.System: sight cones, a round-robin line-of-sight budget, hearing, and per-stimulus memory, all on float64 3D vectors so the 2D and 3D front ends share one implementation. |
|
perception3d
Package perception3d is ai's perception for agents in a 3D world: sight cones around a forward vector, hearing and per-stimulus memory on math3d.Vec3, with line of sight through physics3d raycasts or a game's own check.
|
Package perception3d is ai's perception for agents in a 3D world: sight cones around a forward vector, hearing and per-stimulus memory on math3d.Vec3, with line of sight through physics3d raycasts or a game's own check. |
|
Package anim3d provides 3D skeletal animation playback for glTF 2.0 models, state machines, 1D/2D blend spaces with foot-phase synchronization, layered bone-masked and additive blending, timed animation events, inverse kinematics solvers, and root motion extraction for NSGo 3D games.
|
Package anim3d provides 3D skeletal animation playback for glTF 2.0 models, state machines, 1D/2D blend spaces with foot-phase synchronization, layered bone-masked and additive blending, timed animation events, inverse kinematics solvers, and root motion extraction for NSGo 3D games. |
|
Package animclip plays animation clips, the resource files of type animation that key any registered property of scene objects on a timeline, as Godot's AnimationPlayer does.
|
Package animclip plays animation clips, the resource files of type animation that key any registered property of scene objects on a timeline, as Godot's AnimationPlayer does. |
|
Package assets loads a game's atlases, sounds, images and custom data asynchronously without blocking display frames, organizes them into named per-scene groups with reactive progress, releases them when a scene ends, and provides a loading screen component.
|
Package assets loads a game's atlases, sounds, images and custom data asynchronously without blocking display frames, organizes them into named per-scene groups with reactive progress, releases them when a scene ends, and provides a loading screen component. |
|
Package bullets spawns, moves and draws the bullet patterns of shooters: rings, spirals and aimed bursts defined in versioned YAML.
|
Package bullets spawns, moves and draws the bullet patterns of shooters: rings, spirals and aimed bursts defined in versioned YAML. |
|
Package cards drags cards between the slots of a board in the game view and lays them out as fanned hands, decks, piles and grids, animating every move with game/tween on game.Loop's fixed steps.
|
Package cards drags cards between the slots of a board in the game view and lays them out as fanned hands, decks, piles and grids, animating every move with game/tween on game.Loop's fixed steps. |
|
Package cloudsave is a self-hostable cloud save service: per-account save slots over HTTPS, kept in versions so that concurrent writes from two devices are refused rather than silently overwritten, slots over a size limit are rejected, and the last few versions of each slot can be listed and restored.
|
Package cloudsave is a self-hostable cloud save service: per-account save slots over HTTPS, kept in versions so that concurrent writes from two devices are refused rather than silently overwritten, slots over a size limit are rejected, and the last few versions of each slot can be listed and restored. |
|
cmd/cloudsaved
command
Command cloudsaved runs the cloud save service as a standalone HTTP server, with slots in SQLite or Postgres.
|
Command cloudsaved runs the cloud save service as a standalone HTTP server, with slots in SQLite or Postgres. |
|
sqlstore
Package sqlstore is a cloudsave.Store over database/sql, for SQLite (OpenSQLite, with the pure-Go modernc.org/sqlite driver) and Postgres (OpenPostgres, with github.com/jackc/pgx/v5).
|
Package sqlstore is a cloudsave.Store over database/sql, for SQLite (OpenSQLite, with the pure-Go modernc.org/sqlite driver) and Postgres (OpenPostgres, with github.com/jackc/pgx/v5). |
|
storetest
Package storetest checks a cloudsave.Store against the contract the service relies on.
|
Package storetest checks a cloudsave.Store against the contract the service relies on. |
|
cmd
|
|
|
game
command
Command game is the game layer's command-line tool, run as `nsgo game` or `go tool game` from a module that adds it as a tool.
|
Command game is the game layer's command-line tool, run as `nsgo game` or `go tool game` from a module that adds it as a tool. |
|
game/_templates/projects/action3d
command
Command mygame is a third-person 3D action adventure built with NSGo and game.
|
Command mygame is a third-person 3D action adventure built with NSGo and game. |
|
game/_templates/projects/cards2d
command
Command suitladders is a single-player card game built with NSGo and game: climb four suit ladders from 1 to 9 with a hand of five cards, a draw pile and a discard pile that can be dealt again twice.
|
Command suitladders is a single-player card game built with NSGo and game: climb four suit ladders from 1 to 9 with a hand of five cards, a draw pile and a discard pile that can be dealt again twice. |
|
game/_templates/projects/fighting2d
command
Command fighting2d is a one-on-one 2D fighting game built with NSGo and game.
|
Command fighting2d is a one-on-one 2D fighting game built with NSGo and game. |
|
game/_templates/projects/fps3d
command
Command relayyard is a first-person shooter arena built with NSGo and game: clear three waves of drones and wardens with a hitscan rifle and a projectile launcher.
|
Command relayyard is a first-person shooter arena built with NSGo and game: clear three waves of drones and wardens with a hitscan rifle and a projectile launcher. |
|
game/_templates/projects/idle
command
Command hearthkeeper is an idle game built with NSGo and game: keep a fire fed, buy generators and upgrades with the embers it makes, earn while away, scatter the ashes for a lasting bonus and light the Everflame.
|
Command hearthkeeper is an idle game built with NSGo and game: keep a fire fed, buy generators and upgrades with the embers it makes, earn while away, scatter the ashes for a lasting bonus and light the Everflame. |
|
game/_templates/projects/platformer2d
command
Command mygame is a 2D side-scrolling platformer built with NSGo and game.
|
Command mygame is a 2D side-scrolling platformer built with NSGo and game. |
|
game/_templates/projects/puzzle2d
command
Command sparkslide is a 2D grid puzzle built with NSGo and game: slide a spark across the board to light every lamp in as few moves as you can.
|
Command sparkslide is a 2D grid puzzle built with NSGo and game: slide a spark across the board to light every lamp in as few moves as you can. |
|
game/_templates/projects/racing3d
command
Command mygame is a 3D racing game built with NSGo and game.
|
Command mygame is a 3D racing game built with NSGo and game. |
|
game/_templates/projects/rhythm
command
Command pulselanes is a four-lane rhythm game built with NSGo and game: notes fall to the beat of a song, and the player hits them as they reach the line.
|
Command pulselanes is a four-lane rhythm game built with NSGo and game: notes fall to the beat of a song, and the player hits them as they reach the line. |
|
game/_templates/projects/roguelike2d
command
Command mygame is a turn-based 2D roguelike built with NSGo and game.
|
Command mygame is a turn-based 2D roguelike built with NSGo and game. |
|
game/_templates/projects/rpg2d
command
Command hollowbrook is a small top-down RPG built with NSGo and game: a town and a meadow to walk, people to talk to, a pack of items and equipment, one quest, turn-based battles and three save slots.
|
Command hollowbrook is a small top-down RPG built with NSGo and game: a town and a meadow to walk, people to talk to, a pack of items and equipment, one quest, turn-based battles and three save slots. |
|
game/_templates/projects/rts2d
command
Command mygame is a 2D real-time strategy skirmish built with NSGo and game: gather crystals, build barracks, train an army and destroy the opponent's headquarters before it destroys yours.
|
Command mygame is a 2D real-time strategy skirmish built with NSGo and game: gather crystals, build barracks, train an army and destroy the opponent's headquarters before it destroys yours. |
|
game/_templates/projects/shmup2d
command
Command mygame is a vertical scrolling shooter built with NSGo and game: enemy waves, bullet patterns, power-ups, a boss with phases, lives and a score.
|
Command mygame is a vertical scrolling shooter built with NSGo and game: enemy waves, bullet patterns, power-ups, a boss with phases, lives and a score. |
|
game/_templates/projects/starter
command
Command mygame is a starter 2D game built with NSGo and game.
|
Command mygame is a starter 2D game built with NSGo and game. |
|
game/_templates/projects/towerdefense2d
command
Command bramblegate is a 2D tower defense game built with NSGo and game: build and upgrade towers beside a road to stop the waves of enemies walking it before they reach the gate.
|
Command bramblegate is a 2D tower defense game built with NSGo and game: build and upgrade towers beside a road to stop the waves of enemies walking it before they reach the gate. |
|
game/_templates/projects/visualnovel
command
Command mygame is a short branching visual novel built with NSGo and game: two characters, backgrounds, choices that change the ending, a backlog, auto and skip modes, save slots and two languages.
|
Command mygame is a short branching visual novel built with NSGo and game: two characters, backgrounds, choices that change the ending, a backlog, auto and skip modes, save slots and two languages. |
|
gameapi
command
Command gameapi writes the exported API of a Go module's packages, read from their source and doc comments, as the JSON of package apiref: the reference the website renders as its API pages and publishes at /api.json for agents.
|
Command gameapi writes the exported API of a Go module's packages, read from their source and doc comments, as the JSON of package apiref: the reference the website renders as its API pages and publishes at /api.json for agents. |
|
gameproject
command
Command gameproject checks, formats and applies a game's project file, game.yaml.
|
Command gameproject checks, formats and applies a game's project file, game.yaml. |
|
gameschema
command
Command gameschema writes the JSON Schema of every YAML format the game packages define, for editors and AI tools to validate and complete the files a game's author writes, and with -check verifies that the committed schemas match the Go types.
|
Command gameschema writes the JSON Schema of every YAML format the game packages define, for editors and AI tools to validate and complete the files a game's author writes, and with -check verifies that the committed schemas match the Go types. |
|
sizecheck
command
|
|
|
wasmprobe
command
Command wasmprobe is a minimal entry point referencing the game packages (game, sprite, sound, tilemap) so the web size budget check can build and measure their combined GOOS=js GOARCH=wasm footprint.
|
Command wasmprobe is a minimal entry point referencing the game packages (game, sprite, sound, tilemap) so the web size budget check can build and measure their combined GOOS=js GOARCH=wasm footprint. |
|
Package cutscene plays video and in-engine timeline cutscenes in a game: in a scene or between scenes, skippable by a press, a key or back, and calling the game back when one ends or is skipped.
|
Package cutscene plays video and in-engine timeline cutscenes in a game: in a scene or between scenes, skippable by a press, a key or back, and calling the game back when one ends or is skipped. |
|
Package debug holds development-only tooling and overlays for NSGo games: a frame-time graph, collision and sprite-bounds wireframes, a live scene inspector, a behavior tree and state machine inspector with steering guides, an interactive dev console with typed tunables, named timing scopes with Chrome/Perfetto trace export, an asset memory tracker with budgets, and a GC/allocation monitor.
|
Package debug holds development-only tooling and overlays for NSGo games: a frame-time graph, collision and sprite-bounds wireframes, a live scene inspector, a behavior tree and state machine inspector with steering guides, an interactive dev console with typed tunables, named timing scopes with Chrome/Perfetto trace export, an asset memory tracker with budgets, and a GC/allocation monitor. |
|
Package editor implements the NSGo Scene Editor over packages/game/sceneformat.
|
Package editor implements the NSGo Scene Editor over packages/game/sceneformat. |
|
editorcmd
Package editorcmd is the scene editor's command line, which `go tool game editor` runs and which a game's own editor command runs with the game's component types and editor plugins built in.
|
Package editorcmd is the scene editor's command line, which `go tool game editor` runs and which a game's own editor command runs with the game's component types and editor plugins built in. |
|
editormcp
Package editormcp is the NSGo Game Editor's MCP server: an agent reads and edits the project open in the editor through it, with the same editor commands the inspector, scene tree and viewport use, so every edit is an undo step the person sees and can take back.
|
Package editormcp is the NSGo Game Editor's MCP server: an agent reads and edits the project open in the editor through it, with the same editor commands the inspector, scene tree and viewport use, so every edit is an undo step the person sees and can take back. |
|
Package effects draws a game's frame through a chain of shader passes, in order, with uniforms animated on the platform's frame clock.
|
Package effects draws a game's frame through a chain of shader passes, in order, with uniforms animated on the platform's frame clock. |
|
Package entities provides a small, zero-reflection entity-component-system (ECS) for NSGo games: generational entities, typed sparse-set components, allocation-free queries, topologically ordered systems, prefabs and JSON world snapshots integrated with game/save.
|
Package entities provides a small, zero-reflection entity-component-system (ECS) for NSGo games: generational entities, typed sparse-set components, allocation-free queries, topologically ordered systems, prefabs and JSON world snapshots integrated with game/save. |
|
Package fighting buffers per-step fighting-game input and recognizes motion inputs (quarter circles, dragon punches, charges, double taps), button presses and combos from YAML move sets.
|
Package fighting buffers per-step fighting-game input and recognizes motion inputs (quarter circles, dragon punches, charges, double taps), button presses and combos from YAML move sets. |
|
Package flow holds gameplay flow primitives driven by a game.Loop's fixed steps: game-clock timers, finite and hierarchical state machines, step sequences, a typed event bus and a branching dialogue runtime.
|
Package flow holds gameplay flow primitives driven by a game.Loop's fixed steps: game-clock timers, finite and hierarchical state machines, step sequences, a typed event bus and a branching dialogue runtime. |
|
Package fog tracks fog of war for strategy games: which cells of an orthogonal, isometric, staggered or hexagonal tile grid each team has explored and which it can see right now.
|
Package fog tracks fog of war for strategy games: which cells of an orthogonal, isometric, staggered or hexagonal tile grid each team has explored and which it can see right now. |
|
Package framedata gives fighting games per-frame hitboxes, hurtboxes and hit properties for their moves, authored as versioned YAML and resolved deterministically once per fixed step.
|
Package framedata gives fighting games per-frame hitboxes, hurtboxes and hit properties for their moves, authored as versioned YAML and resolved deterministically once per fixed step. |
|
Package gametest provides deterministic software rendering of nsgo Canvas draw operations, golden PNG comparison, and visual diff generation for tests.
|
Package gametest provides deterministic software rendering of nsgo Canvas draw operations, golden PNG comparison, and visual diff generation for tests. |
|
Package gameui provides stylized in-canvas menus, spatial focus navigation, virtual-resolution scaling, and world-anchored native NSGo overlays.
|
Package gameui provides stylized in-canvas menus, spatial focus navigation, virtual-resolution scaling, and world-anchored native NSGo overlays. |
|
Package gltf implements a pure-Go glTF 2.0 (.gltf) and binary GLB (.glb) asset loader using only the Go standard library and packages/game/math3d.
|
Package gltf implements a pure-Go glTF 2.0 (.gltf) and binary GLB (.glb) asset loader using only the Go standard library and packages/game/math3d. |
|
internal/draco
Package draco decodes Draco-compressed triangle meshes (bitstream version 2.2, the version KHR_draco_mesh_compression normatively references) in pure Go.
|
Package draco decodes Draco-compressed triangle meshes (bitstream version 2.2, the version KHR_draco_mesh_compression normatively references) in pure Go. |
|
internal/meshopt
Package meshopt decodes the meshoptimizer bitstreams used by the EXT_meshopt_compression and KHR_meshopt_compression glTF extensions in pure Go: the attribute codec (versions 0 and 1), the triangle and index sequence codecs, and the octahedral, quaternion, exponential and color filters.
|
Package meshopt decodes the meshoptimizer bitstreams used by the EXT_meshopt_compression and KHR_meshopt_compression glTF extensions in pure Go: the attribute codec (versions 0 and 1), the triangle and index sequence codecs, and the octahedral, quaternion, exponential and color filters. |
|
Package idle provides the arithmetic idle and incremental games need: a Number that holds values far beyond float64's range, progress earned while the game was closed, and formatting of very large numbers in short (1.23K, 4.5万), letter, scientific (1.23e45), engineering and full forms.
|
Package idle provides the arithmetic idle and incremental games need: a Number that holds values far beyond float64's range, progress earned while the game was closed, and formatting of very large numbers in short (1.23K, 4.5万), letter, scientific (1.23e45), engineering and full forms. |
|
Package input turns touch regions, mouse buttons, relative mouse motion under a pointer lock, keyboard keys, game controller buttons and sticks, and device motion sensors into named actions and axes sampled once per game.Loop step, saves bindings in core.Storage across launches, and plays haptic and rumble feedback.
|
Package input turns touch regions, mouse buttons, relative mouse motion under a pointer lock, keyboard keys, game controller buttons and sticks, and device motion sensors into named actions and axes sampled once per game.Loop step, saves bindings in core.Storage across launches, and plays haptic and rumble feedback. |
|
internal
|
|
|
detmath
Package detmath provides FMA-free deterministic math helpers and canonical state hashing shared by physics, physics3d, and vehicle.
|
Package detmath provides FMA-free deterministic math helpers and canonical state hashing shared by physics, physics3d, and vehicle. |
|
devimage
Package devimage builds the image sources that asset hot reload hands a running game: an image's bytes read from disk in place of where it was loaded from.
|
Package devimage builds the image sources that asset hot reload hands a running game: an image's bytes read from disk in place of where it was loaded from. |
|
formattest
Package formattest checks, in a format package's tests, that a YAML format this repository defines follows the rules in AGENTS.md: it refuses unknown fields and versions it does not support, writes the same bytes every time it saves the same value, and loads and saves each of its testdata files without changing a byte.
|
Package formattest checks, in a format package's tests, that a YAML format this repository defines follows the rules in AGENTS.md: it refuses unknown fields and versions it does not support, writes the same bytes every time it saves the same value, and loads and saves each of its testdata files without changing a byte. |
|
jsonedit
Package jsonedit strictly decodes JSON edits onto live Go values without touching the edited value until the edit has succeeded.
|
Package jsonedit strictly decodes JSON edits onto live Go values without touching the edited value until the edit has succeeded. |
|
loaderrtest
Package loaderrtest checks, in a loader's tests, that its errors are *loaderr.Error values an agent can act on: they name the file, the line and a fix.
|
Package loaderrtest checks, in a loader's tests, that its errors are *loaderr.Error values an agent can act on: they name the file, the line and a fix. |
|
qrcode
Package qrcode implements a deterministic, self-contained pure-Go ISO/IEC 18004 QR Code Model 2 encoder (versions 1–10, byte mode, error correction levels L/M/Q/H).
|
Package qrcode implements a deterministic, self-contained pure-Go ISO/IEC 18004 QR Code Model 2 encoder (versions 1–10, byte mode, error correction levels L/M/Q/H). |
|
releaseplan
Package releaseplan plans and formats `nsgo build` release invocations and credits checks shared by `cmd/game release` and the scene editor's Export panel.
|
Package releaseplan plans and formats `nsgo build` release invocations and credits checks shared by `cmd/game release` and the scene editor's Export panel. |
|
samplegltf
Package samplegltf generates and validates the deterministic glTF 2.0 sample models of the placeholder asset pack (package placeholder's models folder), which the 3D Blender pipeline documentation describes.
|
Package samplegltf generates and validates the deterministic glTF 2.0 sample models of the placeholder asset pack (package placeholder's models folder), which the 3D Blender pipeline documentation describes. |
|
Package inventory holds gameplay items: item definitions read from versioned YAML, slot-based containers of item stacks, typed equipment slots, and snapshots that round-trip through a game/save Store.
|
Package inventory holds gameplay items: item definitions read from versioned YAML, slot-based containers of item stacks, typed equipment slots, and snapshots that round-trip through a game/save Store. |
|
Package l10n provides localization for NSGo games: versioned YAML and JSON string tables with BCP-47 locale fallback, interpolation, and CLDR pluralization; per-language asset resolution, fs.FS discovery, versioned YAML asset manifests, runtime locale switching, and missing-variant auditing; Unicode script detection and per-script/per-locale font selection; and right-to-left text reordering and HUD layout mirroring.
|
Package l10n provides localization for NSGo games: versioned YAML and JSON string tables with BCP-47 locale fallback, interpolation, and CLDR pluralization; per-language asset resolution, fs.FS discovery, versioned YAML asset manifests, runtime locale switching, and missing-variant auditing; Unicode script detection and per-script/per-locale font selection; and right-to-left text reordering and HUD layout mirroring. |
|
Package leaderboard submits scores to and shows the platform's leaderboards, Game Center on Apple platforms and Play Games Services on Android, through NSGo's gameservices package.
|
Package leaderboard submits scores to and shows the platform's leaderboards, Game Center on Apple platforms and Play Games Services on Android, through NSGo's gameservices package. |
|
selfhost
Package selfhost is a self-hostable leaderboard service, for cross-platform games and games on platforms without a game service: one board ranks the scores a player's devices submit from every platform, keyed by the account the accounts package signs in.
|
Package selfhost is a self-hostable leaderboard service, for cross-platform games and games on platforms without a game service: one board ranks the scores a player's devices submit from every platform, keyed by the account the accounts package signs in. |
|
selfhost/cmd/leaderboardd
command
Command leaderboardd runs the self-hosted leaderboard service as a standalone HTTP server, with its scores in a directory of JSON Lines files.
|
Command leaderboardd runs the self-hosted leaderboard service as a standalone HTTP server, with its scores in a directory of JSON Lines files. |
|
Package lights2d implements 2D lighting for NSGo games: point and spot lights composited over ambient darkness, exact 2D visibility-polygon shadows from occluders, and tangent-space normal-mapped sprite shading.
|
Package lights2d implements 2D lighting for NSGo games: point and spot lights composited over ambient darkness, exact 2D visibility-polygon shadows from occluders, and tangent-space normal-mapped sprite shading. |
|
Package liveops holds provider-agnostic live operations primitives for NSGo games: crash reports, consent-gated analytics, a cloud-save sync interface and in-app purchases credited into the save.
|
Package liveops holds provider-agnostic live operations primitives for NSGo games: crash reports, consent-gated analytics, a cloud-save sync interface and in-app purchases credited into the save. |
|
Package loaderr is the error that every loader and validator in this module returns for a file it cannot use: which file, which line and column, which field, what was wrong, what was expected and how to fix it, so a person or an agent reading the message can act on it without opening the loader's source.
|
Package loaderr is the error that every loader and validator in this module returns for a file it cannot use: which file, which line and column, which field, what was wrong, what was expected and how to fix it, so a person or an agent reading the message can act on it without opening the loader's source. |
|
Package loot rolls nested weighted drop tables with guaranteed drops and pity counters on the deterministic streams of package random.
|
Package loot rolls nested weighted drop tables with guaranteed drops and pity counters on the deterministic streams of package random. |
|
Package math2d provides small, zero-allocation 2D value types shared by game packages: vectors (Vec2), axis-aligned rectangles (Rect), circles (Circle), and 3×2 affine transforms (Affine).
|
Package math2d provides small, zero-allocation 2D value types shared by game packages: vectors (Vec2), axis-aligned rectangles (Rect), circles (Circle), and 3×2 affine transforms (Affine). |
|
Package math3d provides 3D linear algebra, rotations, transforms, and spatial primitives for NSGo 3D games using pure Go float32 types with zero external dependencies.
|
Package math3d provides 3D linear algebra, rotations, transforms, and spatial primitives for NSGo 3D games using pure Go float32 types with zero external dependencies. |
|
Package mcp exposes a running NSGo game's state to coding agents over MCP through github.com/nsgo-dev/nsgo/automation.
|
Package mcp exposes a running NSGo game's state to coding agents over MCP through github.com/nsgo-dev/nsgo/automation. |
|
Package modding loads and runs sandboxed TSX/JS game mods on top of NSGo's tsx runtime.
|
Package modding loads and runs sandboxed TSX/JS game mods on top of NSGo's tsx runtime. |
|
Package navbake bakes 2D navigation meshes for game/ai from level geometry: an outline with concave obstacles and holes, or a tilemap's solid cells, shrunk by an agent's radius and divided into the convex polygons ai.NavMesh searches.
|
Package navbake bakes 2D navigation meshes for game/ai from level geometry: an outline with concave obstacles and holes, or a tilemap's solid cells, shrunk by an agent's radius and divided into the convex polygons ai.NavMesh searches. |
|
Package navbake3d bakes 3D navigation meshes from level geometry, as Recast, Godot's NavigationRegion3D and Unity's NavMeshSurface do, so a 3D game no longer authors world3d.NavMesh polygons by hand.
|
Package navbake3d bakes 3D navigation meshes from level geometry, as Recast, Godot's NavigationRegion3D and Unity's NavMeshSurface do, so a 3D game no longer authors world3d.NavMesh polygons by hand. |
|
Package net provides cross-target multiplayer primitives for NSGo games:
|
Package net provides cross-target multiplayer primitives for NSGo games: |
|
Package particles provides a deterministic 2D particle emitter stepped by game.Loop and drawn through sprite.Batch.
|
Package particles provides a deterministic 2D particle emitter stepped by game.Loop and drawn through sprite.Batch. |
|
Package perf provides allocation-free game-loop performance primitives built on NSGo's public core types and the game sprite package:
|
Package perf provides allocation-free game-loop performance primitives built on NSGo's public core types and the game sprite package: |
|
Package physics3d provides compact, deterministic 3D collision detection, raycasting, rigid-body dynamics, and a kinematic character controller in pure Go.
|
Package physics3d provides compact, deterministic 3D collision detection, raycasting, rigid-body dynamics, and a kinematic character controller in pure Go. |
|
Package pixelfx is a Go port of pixelfx (https://github.com/patch-gg/pixelfx), a library of pixel art effects and animations, each a small procedural program: fire, explosions, magic, weather, UI, pickups, transitions, critters, and character moves acted out with wind-up, hit-stop and recovery.
|
Package pixelfx is a Go port of pixelfx (https://github.com/patch-gg/pixelfx), a library of pixel art effects and animations, each a small procedural program: fire, explosions, magic, weather, UI, pickups, transitions, critters, and character moves acted out with wind-up, hit-stop and recovery. |
|
arcane
Package arcane is pixelfx's arcane category: arcane beam, arcane missiles, arcane orb, blink in, blink out, magic circle cast, mana burst, portal, rune circle, spell charge, star fall and time stop, each a pixelfx.Effect registered as "arcane/<name>" when the package is imported.
|
Package arcane is pixelfx's arcane category: arcane beam, arcane missiles, arcane orb, blink in, blink out, magic circle cast, mana burst, portal, rune circle, spell charge, star fall and time stop, each a pixelfx.Effect registered as "arcane/<name>" when the package is imported. |
|
critters
Package critters is pixelfx's critters category: bat, bird, butterfly, eyeball, fish school, flying skull, frog, ghost, jellyfish, slime, snake and wisp, each a pixelfx.Effect registered as "critters/<name>" when the package is imported.
|
Package critters is pixelfx's critters category: bat, bird, butterfly, eyeball, fish school, flying skull, frog, ghost, jellyfish, slime, snake and wisp, each a pixelfx.Effect registered as "critters/<name>" when the package is imported. |
|
explosions
Package explosions is pixelfx's explosions category: barrel explosion, big explosion, cartoon POW, dirt explosion, firework burst, firework rocket, grenade, implosion, nuke, plasma explosion, small explosion and smoke bomb, each a pixelfx.Effect registered as "explosions/<name>" when the package is imported.
|
Package explosions is pixelfx's explosions category: barrel explosion, big explosion, cartoon POW, dirt explosion, firework burst, firework rocket, grenade, implosion, nuke, plasma explosion, small explosion and smoke bomb, each a pixelfx.Effect registered as "explosions/<name>" when the package is imported. |
|
fire
Package fire is pixelfx's fire category: brazier, campfire, candle, fire breath, fire ring, fire tornado, fireball, flame pillar, flamethrower, meteor, spirit flame and torch, each a pixelfx.Effect registered as "fire/<name>" when the package is imported.
|
Package fire is pixelfx's fire category: brazier, campfire, candle, fire breath, fire ring, fire tornado, fireball, flame pillar, flamethrower, meteor, spirit flame and torch, each a pixelfx.Effect registered as "fire/<name>" when the package is imported. |
|
holy
Package holy is pixelfx's holy category: blessings, divine shields, feather bursts, halos, heals and healing rings, holy pillars, resurrections, smites and sunbursts, each a pixelfx.Effect registered as "holy/<name>" when the package is imported.
|
Package holy is pixelfx's holy category: blessings, divine shields, feather bursts, halos, heals and healing rings, holy pillars, resurrections, smites and sunbursts, each a pixelfx.Effect registered as "holy/<name>" when the package is imported. |
|
ice
Package ice is pixelfx's ice category: blizzard vortex, freeze, frost breath, frost nova, ice crystal, ice lance, ice shatter, ice spikes, icicle fall and snowflake burst, each a pixelfx.Effect registered as "ice/<name>" when the package is imported.
|
Package ice is pixelfx's ice category: blizzard vortex, freeze, frost breath, frost nova, ice crystal, ice lance, ice shatter, ice spikes, icicle fall and snowflake burst, each a pixelfx.Effect registered as "ice/<name>" when the package is imported. |
|
impacts
Package impacts is pixelfx's impacts category: blunt hits, bullet impacts, critical hits, ground slams, heavy landings, hit flashes, hit sparks, anime impact frames, parries, ricochets and shield blocks, each a pixelfx.Effect registered as "impacts/<name>" when the package is imported.
|
Package impacts is pixelfx's impacts category: blunt hits, bullet impacts, critical hits, ground slams, heavy landings, hit flashes, hit sparks, anime impact frames, parries, ricochets and shield blocks, each a pixelfx.Effect registered as "impacts/<name>" when the package is imported. |
|
internal/pixelfxtest
Package pixelfxtest checks the Go port of pixelfx against pixelfx itself: it renders an effect the way tools/pixelfxref renders it with pixelfx at the pinned commit, and compares the frames with the reference PNGs that tool wrote.
|
Package pixelfxtest checks the Go port of pixelfx against pixelfx itself: it renders an effect the way tools/pixelfxref renders it with pixelfx at the pinned commit, and compares the frames with the reference PNGs that tool wrote. |
|
lightning
Package lightning is pixelfx's lightning category: ball lightning, chain lightning, charge up, electrified, lightning strike, plasma ball, spark arc, storm cloud, tesla coil, thunderclap and zap hit, each a pixelfx.Effect registered as "lightning/<name>" when the package is imported.
|
Package lightning is pixelfx's lightning category: ball lightning, chain lightning, charge up, electrified, lightning strike, plasma ball, spark arc, storm cloud, tesla coil, thunderclap and zap hit, each a pixelfx.Effect registered as "lightning/<name>" when the package is imported. |
|
melee
Package melee is pixelfx's melee category: claw swipe, dagger flurry, double slash, hammer smash, heavy cleave, scythe reap, spear sweep, spin slash, sword slash, thrust, uppercut and whip crack, each a pixelfx.Effect a character acts out (pixelfx.Perform), registered as "melee/<name>" when the package is imported.
|
Package melee is pixelfx's melee category: claw swipe, dagger flurry, double slash, hammer smash, heavy cleave, scythe reap, spear sweep, spin slash, sword slash, thrust, uppercut and whip crack, each a pixelfx.Effect a character acts out (pixelfx.Perform), registered as "melee/<name>" when the package is imported. |
|
moves
Package moves is pixelfx's moves category: whole attacks, wind-up to recovery, chained from the effects of the other categories and acted out by a character (pixelfx.Perform), each a pixelfx.Effect registered as "moves/<name>" when the package is imported.
|
Package moves is pixelfx's moves category: whole attacks, wind-up to recovery, chained from the effects of the other categories and acted out by a character (pixelfx.Perform), each a pixelfx.Effect registered as "moves/<name>" when the package is imported. |
|
nature
Package nature is pixelfx's nature category: acid splashes, boulders, earth spikes, healing blooms, leaf storms, poison clouds, quakes, root snares, spore bursts, thorns, tornadoes, toxic puddles and vine whips, each a pixelfx.Effect registered as "nature/<name>" when the package is imported.
|
Package nature is pixelfx's nature category: acid splashes, boulders, earth spikes, healing blooms, leaf storms, poison clouds, quakes, root snares, spore bursts, thorns, tornadoes, toxic puddles and vine whips, each a pixelfx.Effect registered as "nature/<name>" when the package is imported. |
|
pickups
Package pickups is pixelfx's pickups category: coins, gems, crystals, hearts, keys, potions, power stars, XP orbs, loot beams, collect bursts and treasure chests, each a pixelfx.Effect registered as "pickups/<name>" when the package is imported.
|
Package pickups is pixelfx's pickups category: coins, gems, crystals, hearts, keys, potions, power stars, XP orbs, loot beams, collect bursts and treasure chests, each a pixelfx.Effect registered as "pickups/<name>" when the package is imported. |
|
projectiles
Package projectiles is pixelfx's projectiles category: arrows, tracers, cannon shots, energy discs, signal flares, homing missiles, laser bolts, magic missiles, muzzle flashes, plasma shots and rockets, each a pixelfx.Effect registered as "projectiles/<name>" when the package is imported.
|
Package projectiles is pixelfx's projectiles category: arrows, tracers, cannon shots, energy discs, signal flares, homing missiles, laser bolts, magic missiles, muzzle flashes, plasma shots and rockets, each a pixelfx.Effect registered as "projectiles/<name>" when the package is imported. |
|
scifi
Package scifi is pixelfx's sci-fi category: EMP blasts, energy cores, force fields, glitches, holograms, jetpacks, laser grids, scanners, teleporter pads, tractor beams and warp beams, each a pixelfx.Effect registered as "scifi/<name>" when the package is imported.
|
Package scifi is pixelfx's sci-fi category: EMP blasts, energy cores, force fields, glitches, holograms, jetpacks, laser grids, scanners, teleporter pads, tractor beams and warp beams, each a pixelfx.Effect registered as "scifi/<name>" when the package is imported. |
|
shadow
Package shadow is pixelfx's shadow category: black holes, curses, dark explosions, eclipses, grasping hands, hex sigils, life steal, necro skulls, shadow flames, shadow tendrils, soul drain and void orbs, each a pixelfx.Effect registered as "shadow/<name>" when the package is imported.
|
Package shadow is pixelfx's shadow category: black holes, curses, dark explosions, eclipses, grasping hands, hex sigils, life steal, necro skulls, shadow flames, shadow tendrils, soul drain and void orbs, each a pixelfx.Effect registered as "shadow/<name>" when the package is imported. |
|
spawn
Package spawn is pixelfx's spawn and death category: coin drops, disintegration, dissolve burn, egg hatching, cartoon poofs, respawn beams, ice shatter deaths, rising souls, spawn portals and summoning rises, each a pixelfx.Effect registered as "spawn/<name>" when the package is imported.
|
Package spawn is pixelfx's spawn and death category: coin drops, disintegration, dissolve burn, egg hatching, cartoon poofs, respawn beams, ice shatter deaths, rising souls, spawn portals and summoning rises, each a pixelfx.Effect registered as "spawn/<name>" when the package is imported. |
|
status
Package status is pixelfx's status category: bleeding, burning, charmed, confused, cursed, frozen, haste, petrified, poisoned, rage, sleep, slowed and stunned, each a pixelfx.Effect registered as "status/<name>" when the package is imported.
|
Package status is pixelfx's status category: bleeding, burning, charmed, confused, cursed, frozen, haste, petrified, poisoned, rage, sleep, slowed and stunned, each a pixelfx.Effect registered as "status/<name>" when the package is imported. |
|
transitions
Package transitions is pixelfx's transitions category: full-screen 320 x 180 wipes, irises, dissolves, blinds, CRT switch, glitch, burn and glass shatter effects, each a pixelfx.Effect registered as "transitions/<name>" when the package is imported.
|
Package transitions is pixelfx's transitions category: full-screen 320 x 180 wipes, irises, dissolves, blinds, CRT switch, glitch, burn and glass shatter effects, each a pixelfx.Effect registered as "transitions/<name>" when the package is imported. |
|
ui
Package ui is pixelfx's UI category: damage and crit numbers, combo counters, countdowns, coin counters, health bars, hearts, alerts, achievements, level-up banners and confetti, each a pixelfx.Effect registered as "ui/<name>" when the package is imported.
|
Package ui is pixelfx's UI category: damage and crit numbers, combo counters, countdowns, coin counters, health bars, hearts, alerts, achievements, level-up banners and confetti, each a pixelfx.Effect registered as "ui/<name>" when the package is imported. |
|
water
Package water is pixelfx's water category: bubbles, drips, fountains, geysers, rain splashes, ripples, splashes, water jets, water orbs, waterfalls, crashing waves and whirlpools, each a pixelfx.Effect registered as "water/<name>" when the package is imported.
|
Package water is pixelfx's water category: bubbles, drips, fountains, geysers, rain splashes, ripples, splashes, water jets, water orbs, waterfalls, crashing waves and whirlpools, each a pixelfx.Effect registered as "water/<name>" when the package is imported. |
|
weather
Package weather is pixelfx's weather category: aurora, blizzard, cherry blossoms, clouds, falling leaves, fireflies, fog, god rays, rain, shooting stars, snow and storm, each a pixelfx.Effect registered as "weather/<name>" when the package is imported.
|
Package weather is pixelfx's weather category: aurora, blizzard, cherry blossoms, clouds, falling leaves, fireflies, fog, god rays, rain, shooting stars, snow and storm, each a pixelfx.Effect registered as "weather/<name>" when the package is imported. |
|
Package placeholder is a small asset pack for prototypes, tutorials and the examples, dedicated to the public domain under CC0 1.0 (License): sprite sheets, a tileset with a Tiled tileset and a sample level, a pixel font, sound effects and a music loop, and three glTF models.
|
Package placeholder is a small asset pack for prototypes, tutorials and the examples, dedicated to the public domain under CC0 1.0 (License): sprite sheets, a tileset with a Tiled tileset and a sample level, a pixel font, sound effects and a music loop, and three glTF models. |
|
internal/gen
Package gen draws every file of the placeholder asset pack in code: sprite strips, a tileset with a Tiled tileset and map, a bitmap font, sounds and models, with the import settings sidecar of each image and sound.
|
Package gen draws every file of the placeholder asset pack in code: sprite strips, a tileset with a Tiled tileset and map, a bitmap font, sounds and models, with the import settings sidecar of each image and sound. |
|
Package platformer provides a platformer character controller on top of physics.CharacterBody: coyote time, jump buffering, variable jump height, wall slides and wall jumps, each with its own tunable timing.
|
Package platformer provides a platformer character controller on top of physics.CharacterBody: coyote time, jump buffering, variable jump height, wall slides and wall jumps, each with its own tunable timing. |
|
Package playtest defines playtest.yaml (bots, seeded headless runs, metrics and goals), a metrics collection API for games, a deterministic headless playtest runner with replay recordings and YAML reports, and built-in bot profiles (platformer-runner, topdown-explorer, shooter, puzzle-solver, and card-ai).
|
Package playtest defines playtest.yaml (bots, seeded headless runs, metrics and goals), a metrics collection API for games, a deterministic headless playtest runner with replay recordings and YAML reports, and built-in bot profiles (platformer-runner, topdown-explorer, shooter, puzzle-solver, and card-ai). |
|
Package presence reports what the player is doing (level, game mode, party size, timestamps, artwork, and custom localization tokens) to Steam and Discord friend lists through a single provider-neutral API.
|
Package presence reports what the player is doing (level, game mode, party size, timestamps, artwork, and custom localization tokens) to Steam and Discord friend lists through a single provider-neutral API. |
|
Package procgen generates seeded, deterministic 2D levels on a tile grid: BSP rooms joined by corridors, cellular-automata caves, wave function collapse over a YAML rule set, and hand-made room templates placed on a dungeon layout graph.
|
Package procgen generates seeded, deterministic 2D levels on a tile grid: BSP rooms joined by corridors, cellular-automata caves, wave function collapse over a YAML rule set, and hand-made room templates placed on a dungeon layout graph. |
|
Package project reads, validates, writes and applies game.yaml, the one project file at the root of a game that holds its settings.
|
Package project reads, validates, writes and applies game.yaml, the one project file at the root of a game that holds its settings. |
|
Package quality picks a game's low, medium or high quality preset (resolution scale, particle budget, effects and shadows) from the device it runs on and the frame times it measures, and lets the player override the choice in settings.
|
Package quality picks a game's low, medium or high quality preset (resolution scale, particle budget, effects and shadows) from the device it runs on and the frame times it measures, and lets the player override the choice in settings. |
|
Package quest runs quests with objectives (collect, reach, defeat, talk), quest states and rewards, defined in a versioned YAML Book and advanced by game events.
|
Package quest runs quests with objectives (collect, reach, defeat, talk), quest states and rewards, defined in a versioned YAML Book and advanced by game events. |
|
Package random provides deterministic, cross-platform pseudo-random streams, procedural noise generators, and helpers for verifying simulation determinism.
|
Package random provides deterministic, cross-platform pseudo-random streams, procedural noise generators, and helpers for verifying simulation determinism. |
|
Package refs keeps the references between a game project's files working when files are renamed or moved: it finds every reference, rewrites the ones a move breaks, and finds a file again after it was moved without the tools.
|
Package refs keeps the references between a game project's files working when files are renamed or moved: it finds every reference, rewrites the ones a move breaks, and finds a file again after it was moved without the tools. |
|
Package render3d provides the GPU-agnostic pure-Go 3D render-queue pipeline and developer tools for NSGo 3D games.
|
Package render3d provides the GPU-agnostic pure-Go 3D render-queue pipeline and developer tools for NSGo 3D games. |
|
Package replay records per-step game input to versioned YAML text files and plays it back deterministically for debugging and automated tests.
|
Package replay records per-step game input to versioned YAML text files and plays it back deterministically for debugging and automated tests. |
|
Package resource reads, validates and writes shared resource files: reusable data that scenes and code reference by path instead of repeating it, as Godot's .tres files are.
|
Package resource reads, validates and writes shared resource files: reusable data that scenes and code reference by path instead of repeating it, as Godot's .tres files are. |
|
Package rhythm keeps a rhythm game in time with its music: a beat map read from YAML, a music clock that reads the track's position and beat at any engine time, and a calibration of each device's audio and video latency.
|
Package rhythm keeps a rhythm game in time with its music: a beat map read from YAML, a music clock that reads the track's position and beat at any engine time, and a calibration of each device's audio and video latency. |
|
Package rooms splits a 2D world into rooms with their own camera bounds and moves a tilemap.Camera between them with a cut, slide or fade transition, as metroidvania platformers do.
|
Package rooms splits a 2D world into rooms with their own camera bounds and moves a tilemap.Camera between them with a cut, slide or fade transition, as metroidvania platformers do. |
|
Package rts provides the unit-control layer of a real-time strategy game: whole-grid and HPA* sector-limited flow fields that steer many units toward a goal over an ai.Grid, a Crowd that moves those units with push-apart separation or ORCA local avoidance and wall sliding, formations defined in versioned YAML, box and click selection, and numbered control groups.
|
Package rts provides the unit-control layer of a real-time strategy game: whole-grid and HPA* sector-limited flow fields that steer many units toward a goal over an ai.Grid, a Crowd that moves those units with push-apart separation or ORCA local avoidance and wall sliding, formations defined in versioned YAML, box and click selection, and numbered control groups. |
|
Package save stores a game's save slots as versioned JSON in either the app's key-value storage (core.Storage) or files in a directory such as cx.DataDir.
|
Package save stores a game's save slots as versioned JSON in either the app's key-value storage (core.Storage) or files in a directory such as cx.DataDir. |
|
Package scene organizes a game into ordered world- and screen-space layers, hit-tests sprites and custom shapes in view coordinates, and manages scene lifecycles, stacks, and transitions.
|
Package scene organizes a game into ordered world- and screen-space layers, hit-tests sprites and custom shapes in view coordinates, and manages scene lifecycles, stacks, and transitions. |
|
Package scene3d provides a 3D scene graph, named socket attachments, a dynamic AABB Bounding Volume Hierarchy (BVH), BVH-accelerated spatial queries, perspective and orthographic cameras, camera controllers (orbit, first-person, third-person follow), screen-space picking, and box-projected 3D decals (Decal, DecalPool, GPUDecalRenderer) built on math3d.
|
Package scene3d provides a 3D scene graph, named socket attachments, a dynamic AABB Bounding Volume Hierarchy (BVH), BVH-accelerated spatial queries, perspective and orthographic cameras, camera controllers (orbit, first-person, third-person follow), screen-space picking, and box-projected 3D decals (Decal, DecalPool, GPUDecalRenderer) built on math3d. |
|
Package sceneformat reads, validates, encodes and builds versioned YAML scene documents for NSGo games.
|
Package sceneformat reads, validates, encodes and builds versioned YAML scene documents for NSGo games. |
|
Package scenemodel gives the objects of a scene file their 3D look: the built-in primitive an object names in mesh, or the glTF 2.0 model it names in model, optionally narrowed to one node (modelNode) or one mesh (modelMesh), with the material file it names in material replacing the model's materials (sceneformat.ObjectDoc).
|
Package scenemodel gives the objects of a scene file their 3D look: the built-in primitive an object names in mesh, or the glTF 2.0 model it names in model, optionally narrowed to one node (modelNode) or one mesh (modelMesh), with the material file it names in material replacing the model's materials (sceneformat.ObjectDoc). |
|
Package screen maps a game's virtual canvas onto any window size, converts pointer input between view and virtual coordinates, keeps HUD layers inside the platform's safe area, and applies a player's video settings (full screen, display and frame cap) with Video.
|
Package screen maps a game's virtual canvas onto any window size, converts pointer input between view and virtual coordinates, keeps HUD layers inside the platform's safe area, and applies a player's video settings (full screen, display and frame cap) with Video. |
|
Package server runs one or more matches of a game at fixed tick rates in a plain Go process, without an NSGo app, window or core.Scope.
|
Package server runs one or more matches of a game at fixed tick rates in a plain Go process, without an NSGo app, window or core.Scope. |
|
cmd/dedicatedserver
command
Command dedicatedserver runs one fixed-step match in a plain Go process.
|
Command dedicatedserver runs one fixed-step match in a plain Go process. |
|
Package skeletal loads, saves and animates 2D skeletal rigs drawn through sprite.Batch.
|
Package skeletal loads, saves and animates 2D skeletal rigs drawn through sprite.Batch. |
|
Package statedump runs a game headless for a fixed number of steps and writes its entities, components and scene state as deterministic YAML, so an agent or a test can diff one run against another.
|
Package statedump runs a game headless for a fixed number of steps and writes its entities, components and scene state as deterministic YAML, so an agent or a test can diff one run against another. |
|
Package stats holds gameplay stats: named base values changed by additive, multiplicative and override modifiers that come from sources such as equipment and buffs, with timed modifiers counted in fixed steps.
|
Package stats holds gameplay stats: named base values changed by additive, multiplicative and override modifiers that come from sources such as equipment and buffs, with timed modifiers counted in fixed steps. |
|
Package text draws bitmap fonts (AngelCode BMFont) through sprite batches, signed-distance-field fonts that stay sharp at any size on the screen or in 3D world space (SDFFont, WorldText), and platform-rendered text through core.Drawing.
|
Package text draws bitmap fonts (AngelCode BMFont) through sprite batches, signed-distance-field fonts that stay sharp at any size on the screen or in 3D world space (SDFFont, WorldText), and platform-rendered text through core.Drawing. |
|
Package tilemap draws tiled worlds, queries tile flags and rays against them, loads Tiled maps, and moves a 2D camera over the world.
|
Package tilemap draws tiled worlds, queries tile flags and rays against them, loads Tiled maps, and moves a 2D camera over the world. |
|
Package tileshape derives collision and lighting geometry from a tilemap: a View that physics.MoveAndSlide, physics.CharacterBody, the platformer controller and physics.World take as their physics.TileGrid, the physics.Slope segments of slanted and partial tiles, the merged outline of solid cells and tile shapes, static boxes, and lights2d occluders.
|
Package tileshape derives collision and lighting geometry from a tilemap: a View that physics.MoveAndSlide, physics.CharacterBody, the platformer controller and physics.World take as their physics.TileGrid, the physics.Slope segments of slanted and partial tiles, the merged outline of solid cells and tile shapes, static boxes, and lights2d occluders. |
|
tooling
|
|
|
apiref
Package apiref reads the exported API of a Go module's packages from their source and doc comments, as go doc shows it, into a Reference: the JSON the website renders as its API pages and publishes for agents.
|
Package apiref reads the exported API of a Go module's packages from their source and doc comments, as go doc shows it, into a Reference: the JSON the website renders as its API pages and publishes for agents. |
|
assetbuild
Package assetbuild builds a game's assets from the assets section of its game.yaml, which package project defines: it packs sprite atlases, encodes KTX2 textures, converts audio, bakes TrueType and OpenType fonts into AngelCode BMFonts, packs glTF models into single GLB files and generates the Go asset manifest, applying the import settings sidecar beside each image, sound, font or model that package importsettings reads, and keeps a text cache of what each output was built from so a later run rebuilds only the targets whose inputs, sidecars or settings changed.
|
Package assetbuild builds a game's assets from the assets section of its game.yaml, which package project defines: it packs sprite atlases, encodes KTX2 textures, converts audio, bakes TrueType and OpenType fonts into AngelCode BMFonts, packs glTF models into single GLB files and generates the Go asset manifest, applying the import settings sidecar beside each image, sound, font or model that package importsettings reads, and keeps a text cache of what each output was built from so a later run rebuilds only the targets whose inputs, sidecars or settings changed. |
|
assetcheck
Package assetcheck checks a game's scene files, Tiled and LDtk maps and sprite atlases, and the references between them, and reports each problem with the file and line that holds it.
|
Package assetcheck checks a game's scene files, Tiled and LDtk maps and sprite atlases, and the references between them, and reports each problem with the file and line that holds it. |
|
audioconv
Package audioconv decodes, processes, and encodes game audio assets in pure Go, with optional AAC and MP3 conversion via ffmpeg or macOS afconvert when present on PATH.
|
Package audioconv decodes, processes, and encodes game audio assets in pure Go, with optional AAC and MP3 conversion via ffmpeg or macOS afconvert when present on PATH. |
|
bench
Package bench keeps Go benchmark baselines in a versioned YAML text file, reads the results `go test -bench` and `nsgo test -bench` print, and reports the benchmarks that regressed past the baseline's limits.
|
Package bench keeps Go benchmark baselines in a versioned YAML text file, reads the results `go test -bench` and `nsgo test -bench` print, and reports the benchmarks that regressed past the baseline's limits. |
|
credits
Package credits lists who made each of a game's assets and under what license, from the credit section of the import settings sidecar beside each one (package importsettings), and writes the list as the credits file a release ships with.
|
Package credits lists who made each of a game's assets and under what license, from the credit section of the import settings sidecar beside each one (package importsettings), and writes the list as the credits file a release ships with. |
|
datatable
Package datatable loads typed game data tables (enemies, items, levels, quests) from CSV, JSON, and YAML with rich per-cell error reporting and live hot reload.
|
Package datatable loads typed game data tables (enemies, items, levels, quests) from CSV, JSON, and YAML with rich per-cell error reporting and live hot reload. |
|
devstate
Package devstate saves and restores the running game scene, fixed-step loop clock, and serialized state across Go rebuilds during development.
|
Package devstate saves and restores the running game scene, fixed-step loop clock, and serialized state across Go rebuilds during development. |
|
hotreload
Package hotreload watches game assets on disk during development and delivers reloads on the NSGo engine goroutine without restarting the app.
|
Package hotreload watches game assets on disk during development and delivers reloads on the NSGo engine goroutine without restarting the app. |
|
importsettings
Package importsettings reads and writes import settings sidecars: a small YAML file beside an image, a sound, a font or a model, named after it with ".import.yaml" appended (Path), that says how game assets imports it, as Godot's .import files do.
|
Package importsettings reads and writes import settings sidecars: a small YAML file beside an image, a sound, a font or a model, named after it with ".import.yaml" appended (Path), that says how game assets imports it, as Godot's .import files do. |
|
jsonschema
Package jsonschema builds JSON Schemas (draft-07) from Go types and checks decoded YAML or JSON values against them, so editors and AI tools can complete and validate the YAML files a game's author writes.
|
Package jsonschema builds JSON Schemas (draft-07) from Go types and checks decoded YAML or JSON values against them, so editors and AI tools can complete and validate the YAML files a game's author writes. |
|
ktx2
Package ktx2 provides a pure-Go KTX2 v2.0 texture container encoder, decoder, supercompression decoder (BasisLZ, Zstandard, ZLIB), mipmap chain generator, Basis Universal ETC1S and UASTC 4x4 codecs, and block texture transcoder (BC1, BC3, BC7, ETC2 RGB8/RGBA8, ASTC 4x4, RGBA8).
|
Package ktx2 provides a pure-Go KTX2 v2.0 texture container encoder, decoder, supercompression decoder (BasisLZ, Zstandard, ZLIB), mipmap chain generator, Basis Universal ETC1S and UASTC 4x4 codecs, and block texture transcoder (BC1, BC3, BC7, ETC2 RGB8/RGBA8, ASTC 4x4, RGBA8). |
|
library
Package library finds shared asset packs, editor plugin packs and templates in a library and installs them into a game project.
|
Package library finds shared asset packs, editor plugin packs and templates in a library and installs them into a game project. |
|
manifest
Package manifest walks an assets directory and generates a typed Go source file referencing every asset, so missing or removed assets fail the build at compile time.
|
Package manifest walks an assets directory and generates a typed Go source file referencing every asset, so missing or removed assets fail the build at compile time. |
|
pack
Package pack packs a folder of PNG images into sprite atlas pages and TexturePacker JSON-hash metadata that sprite.LoadAtlas reads directly.
|
Package pack packs a folder of PNG images into sprite atlas pages and TexturePacker JSON-hash metadata that sprite.LoadAtlas reads directly. |
|
Package tween animates values, timelines, and tilemap cameras deterministically on fixed game.Loop steps using NSGo easing curves.
|
Package tween animates values, timelines, and tilemap cameras deterministically on fixed game.Loop steps using NSGo easing curves. |
|
Package undo records the reversible moves of puzzle and turn-based games, with unlimited undo and redo.
|
Package undo records the reversible moves of puzzle and turn-based games, with unlimited undo and redo. |
|
Package vehicle simulates raycast cars on a physics3d.World: wheel colliders cast from the chassis, spring-damper suspension, longitudinal and lateral tire friction inside a friction circle, and engine, brake, steering and handbrake input.
|
Package vehicle simulates raycast cars on a physics3d.World: wheel colliders cast from the chassis, spring-damper suspension, longitudinal and lateral tire friction inside a friction circle, and engine, brake, steering and handbrake input. |
|
Package vn presents dialogue scripts as a visual novel: character portraits with expressions standing in stage slots, a text box with name plates and a typewriter, choices, a backlog, auto and skip modes, and voice lines.
|
Package vn presents dialogue scripts as a visual novel: character portraits with expressions standing in stage slots, a text box with name plates and a typewriter, choices, a backlog, auto and skip modes, and voice lines. |
|
cmd/vnsample
command
Command vnsample plays a short visual novel scene with the vn package: two characters' portraits with expressions, a text box with name plates, voice lines, a choice, a backlog, and auto and skip modes.
|
Command vnsample plays a short visual novel scene with the vn package: two characters' portraits with expressions, a text box with name plates, voice lines, a choice, a backlog, and auto and skip modes. |
|
Package voxel provides chunked 3D voxel worlds with greedy meshing, cross-chunk face culling, incremental per-voxel sky and block light propagation, incremental dirty-chunk remeshing, DDA voxel raycasting, and deterministic versioned YAML persistence.
|
Package voxel provides chunked 3D voxel worlds with greedy meshing, cross-chunk face culling, incremental per-voxel sky and block light propagation, incremental dirty-chunk remeshing, DDA voxel raycasting, and deterministic versioned YAML persistence. |
|
Package world3d provides 3D world-building primitives for NSGo 3D games: heightmap terrain, 3D navigation meshes and path-corridor navigation agents, 3D GridMaps of modular mesh tiles, procedural foliage/scattered instance fields, and large-world chunk streaming with floating-origin rebasing.
|
Package world3d provides 3D world-building primitives for NSGo 3D games: heightmap terrain, 3D navigation meshes and path-corridor navigation agents, 3D GridMaps of modular mesh tiles, procedural foliage/scattered instance fields, and large-world chunk streaming with floating-origin rebasing. |
|
Package worldmap keeps track of which rooms of a game world the player has discovered and draws them as a minimap of the current area and a world map, with markers.
|
Package worldmap keeps track of which rooms of a game world the player has discovered and draws them as a minimap of the current area and a world map, with markers. |