Documentation
¶
Overview ¶
Package categories is experimental: its API and documented formats may change in a minor release; see https://nsgo.games/docs/stability/.
Package categories provides built-in gamedebug.Category implementations for NSGo Game's core gameplay systems: ability.Caster, stats.Sheet, ai.Perception, perception3d.Perception, pathfind.NavAgent, and pathfind3d.NavAgent.
Keeping these adapters in a separate subpackage lets games register built-in gameplay debugger categories with gamedebug.Overlay or snapshot them into gamedebug.VLog without forcing pkg/tooling/gamedebug itself to import ability, stats, or navigation packages. Under -tags release, every constructor returns a zero-cost no-op stub that never invokes its lookup callback.
Index ¶
- func Ability(lookup func(entity string) *ability.Caster) gamedebug.Category
- func NavAgent(lookup func(entity string) *pathfind.NavAgent) gamedebug.CategoryDrawer
- func NavAgent3D(lookup func(entity string) *pathfind3d.NavAgent) gamedebug.Category
- func Perception(lookup func(entity string) *ai.Perception) gamedebug.CategoryDrawer
- func Perception3D(lookup func(entity string) *perception3d.Perception) gamedebug.Category
- func Stats(lookup func(entity string) *stats.Sheet) gamedebug.Category
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ability ¶
Ability returns a gamedebug.Category ("ability") that snapshots the picked entity's *ability.Caster: active cast/channel phase, elapsed steps, charges, cooldowns and recharge timers.
func NavAgent ¶
func NavAgent(lookup func(entity string) *pathfind.NavAgent) gamedebug.CategoryDrawer
NavAgent returns a gamedebug.CategoryDrawer ("nav") that snapshots a 2D *pathfind.NavAgent's state, corridor, velocity and replans, and draws its position, velocity vector, target reticle, and active path polyline.
func NavAgent3D ¶
func NavAgent3D(lookup func(entity string) *pathfind3d.NavAgent) gamedebug.Category
NavAgent3D returns a gamedebug.Category ("nav3d") that snapshots a 3D *pathfind3d.NavAgent's state, position, target, velocity, path, corridor, and replans.
func Perception ¶
func Perception(lookup func(entity string) *ai.Perception) gamedebug.CategoryDrawer
Perception returns a gamedebug.CategoryDrawer ("perception") that snapshots a 2D *ai.Perception's senses and memories and draws its sight cone, hearing radius, and remembered stimuli into a core.Drawing.
func Perception3D ¶
func Perception3D(lookup func(entity string) *perception3d.Perception) gamedebug.Category
Perception3D returns a gamedebug.Category ("perception3d") that snapshots a 3D *perception3d.Perception's senses and memories.
func Stats ¶
Stats returns a gamedebug.Category ("stats") that snapshots the picked entity's *stats.Sheet: current and base values, active modifiers, active gameplay effects, and active tags.
Example ¶
package main
import (
"fmt"
"github.com/nsgo-dev/game/pkg/stats"
"github.com/nsgo-dev/game/pkg/tooling/gamedebug/categories"
)
func main() {
sheet, _ := stats.NewSheet(stats.Def{Name: "hp", Base: 100})
cat := categories.Stats(func(entity string) *stats.Sheet {
if entity == "hero" {
return sheet
}
return nil
})
for _, f := range cat.Snapshot("hero") {
fmt.Printf("%s=%s\n", f.Name, f.Value)
}
}
Output: hp=100
Types ¶
This section is empty.