SpatialGG
Objects have the ability to execute queries against their graph, storing the results to a set of PCGGraphQueryBuffer
arrays.
These queries can either be a read or an update, and will execute against the regions stored within a provided buffer.
Use InitialiseBuffersAndRegisters
to create a given number of buffers with a provided Random seed. The buffer length
will be the size of the graph in the SpatialGG
zone, so do this after Initialising the zone within its hull.
Whenever a non-buffer integer is used, it can be substituted for a tag with a preceding $
. For example:
Select 0 near SpatialGG.Region.Centre above $World.Separation.Min below $World.Separation.Max
Will use the register to find the values for World.Separation.Min. This can be used to set up global parameter sets within procedures before starting to control sizes easily.
Whenever a tag parameter is used, it can be substituted for an int with a preceding $
. This will use the tag
map of the corresponding index for the currently executing procedure. For example:
Execute World.Build.All tags A.B,C.D,E.F
...
inside World.Build.All
...
Select 0 near $1 above 0 below 3
Will execute the World.Build.All
procedure with three tags in its TagMap
, which we can then reference within the
procedure using $0
$1
and $2
. In this case, it will select all regions within range 3 of C.D
.
Sort {BufferIdx} by Index
Sort the given buffer by region index using standard quicksort
Sort {BufferIdx} by distance from {ReferenceRegion}
Sort the given buffer by distance from a registered region. This uses spatial distance, not graph distance
Sort {BufferIdx} by Random
Shuffle the given buffer
Select {BufferIdx} near {RegionTag} [above {MinRange}] [below {MaxRange}]
Find regions within a given graph distance of a registered region and put them into the given buffer. Use SpatiallGG.Region.All to get the entire graph.
Path {OutBuffer} src {StartRegion} dest {EndRegion} [disallow {InBuffer}]
Find a path through the graph from StartRegion to EndRegion without going through any region in InBuffer and place it in OutBuffer
Register from {SourceBuffer} to {RegisterTag} [index {Index}]
Register copy {SourceTag} to {DestTag}
Register buffer {SourceBuffer} from {SrcTag}
Register value {Integer} to {DestTag}
Add a single region from SourceBuffer to the QueryRegister
using RegisterTag. Will add the first region by default but can use others using Index. Can also copy a register to a new tag, or add a registered region to a buffer.
Filter {Bufferindex} {A.B,X.Y} using HasAll
Filter {Bufferindex} {A.B,X.Y} using HasAllExact
Filter {Bufferindex} {A.B,X.Y} using HasAny
Filter {Bufferindex} {A.B,X.Y} using HasAnyExact
Filter {Bufferindex} {A.B,X.Y} using HasOnly
Filter {Bufferindex} {A.B,X.Y} using HasOnlyExact
Filter {Bufferindex} {A.B,X.Y} using HasNone
Filter {Bufferindex} {A.B,X.Y} using HasNoneExact
Filter {Bufferindex} using Empty
Filter {Bufferindex} using NotEmpty
Remove regions from the given buffer that do not match the specified Tag Container Query.
Set SymDifference from {InBuffer} to {OutBuffer}
Set Difference from {InBuffer} to {OutBuffer}
Set Union from {InBuffer} to {OutBuffer}
Set Intersection from {InBuffer} to {OutBuffer}
Perform the given set operation: OutBuffer = InBuffer [operation] OutBuffer
Truncate {BufferIdx} max {MaxCount} [min {MinCount}]
Reduce the size of given buffer to be between minimum and maximum. Will use randomstream if minimum != maximum.
BorderFilter {BufferIdx} {Border}
Remove regions from the buffer that match the given border index.
-1
Remove all regions that sit on a border of the parent convex hull>=0
Remove all regions that sit on the specified border
Add Tag {BufferIdx} {Tag}
Add a single tag to all regions in the buffer
Remove Tag {BufferIdx} {Tag}
Remove a single tag from all regions in the buffer
Add Tags {BufferIdx} {A.B,X.Y}
Add a set of tags to all regions in the buffer
Remove Tags {BufferIdx} {A.B,X.Y}
Remove a set of tags from all regions in the buffer
Remove AllTags {BufferIdx}
Remove all tags from all regions in the buffer
Execute {ProcedureTag} with {2,5}
Execute a stored procedure with the given tag, with the procedure's buffer 0 set to the current buffer 2, and the procedure's buffer 1 set to the current buffer 5. So if we have a top level procedure that has placed things we need in buffers 2 and 5, the procedure will reference them with 0 and 1.
Duplicate {InBufferIdx} to {OutBufferIdx}
Copy the contents of InBuffer to OutBuffer
Grow {InBufferIdx} to {OutBufferIdx} count {MaxCount} [minimum {MinCount}] [static || uniform] [require {A.B,X.Y}] [deny {A.B,X.Y}]
Add a neighbour of InBuffer to OutBuffer and repeat between MaxCount and MinCount times.
- If static is not set, neighbours of the regions added will be included in the set of neighbours to choose from.
- If require or deny are provided, only neighbours that HaveAllExact or HaveNoneExact will be selected.
- If Uniform is set, the entire neighbour set will be added for each count.