Help us shape the future of Go! Take the 2026 Go Developer Survey

levelbuild

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package levelbuild discovers author-owned level manifests and produces deterministic, passive .kld cartridges.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrManifest      = errors.New("level manifest is invalid")
	ErrDuplicateName = errors.New("level logical name is duplicated")
	ErrSource        = errors.New("level data source is invalid")
)
View Source
var ErrSchemaOutput = errors.New("invalid level schema output")

Functions

func GenerateSchemas added in v0.0.2

func GenerateSchemas(directory string, validate bool) (int, error)

GenerateSchemas refreshes the base and per-level editor schemas. When validate is true, schema checks run before SDK installation or asset work. Only level manifests and authored YAML are read; texture bytes are not needed.

func GenerateSchemasContext added in v0.0.2

func GenerateSchemasContext(ctx context.Context, directory string, validate bool) (int, error)

func GenerateSchemasWithPackages added in v0.0.2

func GenerateSchemasWithPackages(ctx context.Context, directory string, validate bool, set *packages.Set) (int, error)

Types

type Artifact

type Artifact struct {
	// AuthoredActors lists all compiled content identities instantiated as actors.
	AuthoredActors  []string
	Name            string
	Kind            string
	SourceDirectory string
	Bytes           []byte
	ContentSHA256   string
	EnvelopeVersion uint16
	// Textures describes processed cache artifacts included in this level.
	Textures []assetpipeline.Texture
	// Features is the sorted runtime capability set required by this level.
	// The game manifest must include the union for every packaged level.
	Features []string
	// Chunks are render resources belonging to this logical level, never mounted
	// as additional game levels or authored actor instances.
	Chunks []ChunkArtifact
}

Artifact is a complete generated level-data cartridge.

func BuildAllWithAssets added in v0.0.2

func BuildAllWithAssets(
	ctx context.Context,
	projectDirectory string,
	uiSchema uint32,
	themeSource string,
	manifest sdk.Manifest,
) ([]Artifact, error)

BuildAllWithAssets processes level textures with the selected SDK before packaging them. Its artifacts report runtime features for the game manifest.

func BuildAllWithOptions added in v0.0.2

func BuildAllWithOptions(
	ctx context.Context,
	projectDirectory string,
	uiSchema uint32,
	themeSource string,
	manifest sdk.Manifest,
	options Options,
) ([]Artifact, error)

BuildAllWithOptions processes assets while honoring the development policy. Development consumes a complete matching bake or builds mesh-only chunks.

func BuildNamedForScreenshot added in v0.0.2

func BuildNamedForScreenshot(
	ctx context.Context,
	root, name string,
	uiSchema uint32,
	themeSource string,
	selected sdk.Manifest,
) (Artifact, error)

BuildNamedForScreenshot reuses a valid bake or creates a four-sample, one-bounce bake for the selected world before packaging its resources.

func BuildNamedWithAssets added in v0.0.2

func BuildNamedWithAssets(
	ctx context.Context,
	root, name string,
	uiSchema uint32,
	themeSource string,
	selected sdk.Manifest,
) (Artifact, error)

BuildNamedWithAssets builds only the selected level, without compiling a game client or unrelated level assets. Names may be logical names or folder names.

type BakeOptions added in v0.0.2

type BakeOptions struct {
	Level   string
	Samples *int
	Bounces *int
	Denoise *string
	Workers int
	// Incremental reuses only complete prebakes matching current inputs/options.
	Incremental bool
}

BakeOptions controls an explicit offline invocation, without compiling game code or installing a host, SDK bundle, material generator or GPU toolchain.

type BakeReport added in v0.0.2

type BakeReport struct {
	Name      string
	Manifest  string
	Image     string
	Duration  time.Duration
	Stats     worldlightmapbake.Stats
	Automatic bool
	Reused    bool
	// OutputBytes counts the manifest and image published by this bake, excluding older cache entries.
	OutputBytes int64
}

BakeReport describes one completed level. Artifacts remain generated cache files until a normal build packages a current pair.

func BakeAll added in v0.0.2

func BakeAll(ctx context.Context, projectDirectory string, options BakeOptions, completed func(BakeReport)) ([]BakeReport, error)

BakeAll bakes enabled directional recipes. Level accepts a logical name or directory name; an empty selector means all enabled world levels.

func BakeDevelopment added in v0.0.2

func BakeDevelopment(ctx context.Context, projectDirectory string, completed func(BakeReport)) ([]BakeReport, error)

BakeDevelopment refreshes enabled automatic whole-level bakes before a live development snapshot is published. Matching complete bakes are reused. Chunk and environment lighting is produced by the ordinary level builder instead. Projects without automatic lightmaps need no preparation and succeed.

type ChunkArtifact added in v0.0.2

type ChunkArtifact struct {
	ID              int
	Bytes           []byte
	ContentSHA256   string
	EnvelopeVersion uint16
}

ChunkArtifact is a content-addressed passive child cartridge. Its identity and exact byte length are bound by the parent level's chunk catalog.

type Options added in v0.0.2

type Options struct {
	Development bool
}

Options controls whether a build may produce new chunk lighting.

Jump to

Keyboard shortcuts

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