Documentation
¶
Overview ¶
Package levelbuild discovers author-owned level manifests and produces deterministic, passive .kld cartridges.
Index ¶
- Variables
- func GenerateSchemas(directory string, validate bool) (int, error)
- func GenerateSchemasContext(ctx context.Context, directory string, validate bool) (int, error)
- func GenerateSchemasWithPackages(ctx context.Context, directory string, validate bool, set *packages.Set) (int, error)
- type Artifact
- func BuildAllWithAssets(ctx context.Context, projectDirectory string, uiSchema uint32, ...) ([]Artifact, error)
- func BuildAllWithOptions(ctx context.Context, projectDirectory string, uiSchema uint32, ...) ([]Artifact, error)
- func BuildNamedForScreenshot(ctx context.Context, root, name string, uiSchema uint32, themeSource string, ...) (Artifact, error)
- func BuildNamedWithAssets(ctx context.Context, root, name string, uiSchema uint32, themeSource string, ...) (Artifact, error)
- type BakeOptions
- type BakeReport
- type ChunkArtifact
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( ErrManifest = errors.New("level manifest is invalid") ErrDuplicateName = errors.New("level logical name is duplicated") ErrSource = errors.New("level data source is invalid") )
var ErrSchemaOutput = errors.New("invalid level schema output")
Functions ¶
func GenerateSchemas ¶ added in v0.0.2
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
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
ChunkArtifact is a content-addressed passive child cartridge. Its identity and exact byte length are bound by the parent level's chunk catalog.
Source Files
¶
- development_bake.go
- levelbuild.go
- metadata_source.go
- named.go
- packages.go
- processor_assets.go
- schemas.go
- screenshot_bake.go
- texture_atlas.go
- world_animations.go
- world_band_coverage.go
- world_chunk_areas.go
- world_chunks.go
- world_chunks_cache.go
- world_chunks_cache_validation.go
- world_chunks_pixels.go
- world_emission.go
- world_environment.go
- world_environment_lightmaps.go
- world_lighting.go
- world_lightmaps.go
- world_lightmaps_bake.go
- world_mapping.go
- world_material.go
- world_material_sources.go
- world_material_strengths.go
- world_materialize.go
- world_particles.go
- world_sky.go
- world_solids.go
- world_sprite_density.go
- world_terrain.go
- world_vegetation.go