Scheduling Policies | Essentials | PCGEx
Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Scheduling Policies

A composable runtime scheduling policy for PCG, channels so a generation source only wakes the components meant for it, and graph nodes that read those channels.

Runtime generation is a scheduling question: which grid cells should exist right now, in what order, and when should they go away. Vanilla PCG answers it one way, with a distance check around each generation source biased by view direction. This plugin makes the answer composable, and adds something vanilla PCG has no notion of: which generation sources a component reacts to at all.


Scheduling Policies on FABGitHub repo


The pieces

A policy that stacks constraints, channels that decide who triggers what, and nodes that read channels from inside a graph.

Piece
What it does
Page

PCGEx Scheduling Policy

A replacement for the stock PCGSchedulingPolicyDistanceAndDirection. It hosts a stack of constraints, shapes around the source, source signals, world targets, that decide which cells generate, in what order, and when they clean up.

Channels

Named layers, defined once in Project Settings. Generation sources broadcast on channels and policies listen to them, so a source only triggers the components meant for it. Vanilla PCG has no equivalent: every source in range triggers everything.

Channel-aware nodes

Channel Gate, Channel Switch and Get Active Channels gate and route data inside a runtime graph, based on which channels are active around the executing cell.

The pieces stand alone. The policy is useful with channel filtering off, a policy with an empty constraint stack is a valid channel-only policy, and the graph nodes work under any scheduling policy as long as channels are defined.

The envelope comes first

The generation radii are the outer limit. Constraints choose within it and never extend it.

Every runtime-generated component carries generation radii, one per grid size, on the component or on its graph. The engine uses them as a broadphase: a cell beyond a source's radius is never submitted to any policy. Call the region they define around a source the envelope. Constraints answer the narrower question of which cells inside the envelope generate, and in what order.

Two rows of one grid of cells around one generation source. In the first, a Shape : Sphere ring reaches past the dashed generation radius ring, and only the cells inside the generation radius are filled as generating. In the second, a target actor's padded region straddles the generation radius, and only the cells where the region and the radius overlap are filled.
Same source, same envelope; the constraint only ever removes cells from it.

Two consequences follow, and both read as a constraint failing:

  • A Shape : Sphere with a Radius larger than the generation radius changes nothing. The envelope clips it.

  • A target constraint pointing at an actor across the map does nothing until a generation source's envelope reaches that actor. The gate ignores the source; the engine does not.

When a cell refuses to generate, check the envelope first, then the constraints.

Setup

Runtime generation on, radii that fit the content, and the world actor flags for testing.

  1. On the PCG component, set Generation Trigger to Generate at Runtime. That reveals Scheduling Policy Class and Override Generation Radii.

  2. Make sure the generation radii fit the content: on the component when overriding, otherwise on the graph.

Two settings on the PCG World Actor matter while testing:

  • Treat Player Controllers as Generation Sources, on by default. Player controllers act as generation sources in game.

  • Treat Editor Viewport as Generation Source, off by default. Turn it on to preview runtime generation by moving the editor camera, with no play session.

Quick start

Pick the policy, add one shape, move a source.

Set Scheduling Policy Class to PCGExSchedulingPolicy, add one entry to Constraints and pick Shape : Sphere. Cells generate inside the sphere, nearest first, and clean up once the sphere has moved on. Everything else on these pages is a variation: other shapes, world regions in place of source proximity, and channels deciding who triggers what.

An empty constraint stack is valid: it passes every cell with equal priority. It is the right stack when the policy is only there for its channel filtering.

Debugging

One console variable draws every constraint of every runtime-generated component in the world.

pcgex.Scheduling.DebugDraw takes three values:

Value
Draws

0

Nothing. The default.

1

Each enabled constraint's generate region, for every runtime-generated component using the policy.

2

The same, plus the cleanup variant of each region.

Colors: green is a gate region, cyan an inverted one, red a hollow interior, orange a cleanup variant. Shapes draw around every generation source the policy reacts to, so a channel-filtered policy only draws for sources whose channels match. Targets draw once, since their regions do not depend on the source: the padded box per target, and the polyline of each spline. Source : View Frustum draws the frustum of any source that has one, and Source : Direction Alignment draws an arrow the way it favors.

To see it in the editor you need all of the following: a build with debug drawing compiled in (any editor build, and any packaged build short of Test and Shipping), a PCG World Actor in the level, a component set to Generate at Runtime with the PCGEx policy assigned, Treat Editor Viewport as Generation Source on the world actor when the stack holds shapes (a target draws with no source at all), and a viewport in realtime, because the lines last one frame. It pairs with the engine's pcg.GraphExecution.DebugDrawGeneratedCells, which boxes every generating cell colored by grid level, so the two together show the regions and what came out of them.

Last updated

Logo

© 2026 Timothé Lapetite