categories

package
v0.4.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ability

func Ability(lookup func(entity string) *ability.Caster) gamedebug.Category

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(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(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

func Stats(lookup func(entity string) *stats.Sheet) gamedebug.Category

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL