Expand description
§Bindings to the GameplayKit framework
See Apple’s docs and the general docs on framework crates for more information.
Structs§
- GKAR
C4Random Source GKRandomSource - A deterministic pseudo-random source that generates random numbers based on an arc4 algorithm. This is a deterministic random source suitable for creating reliable gameplay mechanics.
- GKAgent
GKAgentandGKComponent - An agent is a point mass whose local coordinate system is aligned to its velocity. Agents have a variety of steering functions that can be used to simulate vehicles or entities with agency. The units of mass, velocity and radius are dimensionless but related. The visual representation of these values are specific to each game’s own situation.
- GKAgent2D
GKAgentandGKComponent - A 2D specalization of an agent that moves on a 2-axis logical coordinate system. This coordinate system does not need to match the visual coordinate system of the delegate. One simple case of that is isometric 2D content where the game model is on a flat 2D plane but the visuals are displayed on an angle where one of the logical axes are used for simulated depth as well as some translation in the display plane.
- GKAgent3D
GKAgentandGKComponent - A 3D specialization of an agent that moves on a 3-axis logical coordinate system.
- GKBehavior
GKBehavior - A collection of GKGoals or GKBehaviors with weights that can be applied to a GKAgent The sub-goals or sub-behaviors are summed to produce a total force to be applied to an agent
- GKBillow
Noise Source GKNoiseSource - Billow noise is similar to Perlin noise, with more rounded shapes and clearly-defined transitions beween values.
- GKCheckerboard
Noise Source GKNoiseSource - Produces noise in a checkerboard pattern.
- GKCircle
Obstacle GKObstacle - An obstacle with an impassible radius
- GKCoherent
Noise Source GKNoiseSource - Coherent noise is smoothly-changing, semi-random noise. A given input always produces the same output. A small change in input produces a small change in output. A large change in input produces a random change in output. This class is not intended to be instantiated.
- GKComponent
GKComponent - A component is the data and logic for one part of an object in an entity-component system. Entities have many components but components are associated with only a single entity.
- GKComponent
System GKComponent - A component system is a homogeneous collection of components that are intended to be called at the same time. The system is homogeneous, meaning it only allows members of the same class into the system.
- GKComposite
Behavior GKBehaviorandGKCompositeBehavior - Apple’s documentation
- GKConstant
Noise Source GKNoiseSource - Produces a single, constant value at all positions in the space.
- GKCylinders
Noise Source GKNoiseSource - Produces 3D cylindrical noise with an infinite number of cylinders-within-cyliners of constantly-increasing radius.
- GKDecision
Node GKDecisionTree - Apple’s documentation
- GKDecision
Tree GKDecisionTree - Apple’s documentation
- GKEntity
GKEntity - An entity is the general purpose object in an entity-component system. Entites have many components but components are associated with only a single entity.
- GKGaussian
Distribution GKRandomDistribution - A gaussian distribution is biased towards the mean value, the possible outcomes are spread out from the mean with decreasing probability. Values within 1 deviation of the mean make up 68.27% of the distribution, values within 2 deviations make up 95% and values within 3 deviations make up 99.7%.
- GKGoal
GKGoal - Defines a spatial directive. The various goals cause force to be applied to agents to try to achieve said goal.
- GKGraph
GKGraph - Representation of a directed graph of GKGraphNodes
- GKGraph
Node GKGraphNode - A node in a directed graph. Edges are directed and can have variable costs.
- GKGraph
Node2D GKGraphNode - GKGraphNode coupled with a 2D position
- GKGraph
Node3D GKGraphNode - GKGraphNode coupled with a 3D position
- GKGrid
Graph GKGraphandGKGraphNodeandGKGridGraph - Apple’s documentation
- GKGrid
Graph Node GKGraphNode - GKGraphNode coupled with a position on a 2D grid
- GKLinear
Congruential Random Source GKRandomSource - A deterministic pseudo-random source that generates random numbers based on a linear congruential algorithm. This is a deterministic random source suitable for creating reliable gameplay mechanics. It is slightly faster than an Arc4 source, but less random. In particular the lower bits of the generated values are less random than the higher bits.
- GKMersenne
Twister Random Source GKRandomSource - A deterministic pseudo-random source that generates random numbers based on a mersenne twister algorithm. This is a deterministic random source suitable for creating reliable gameplay mechanics. It is slightly slower than an Arc4 source, but more random, in that it has a longer period until repeating sequences.
- GKMesh
Graph GKGraphandGKGraphNodeandGKMeshGraph - A collection of GKGraphNodes that are governed by a mesh formed by the space between a set of GKPolygonObstacles
- GKMesh
Graph Triangulation Mode GKMeshGraph - Adjusts how graph nodes are created when you triangulate a GKMeshGrapk
- GKMinmax
Strategist GKMinmaxStrategist - The Minmax Strategist is a generic AI that selects a game model update for a given player that maximises potential gain, while minimising potential loss. It does this by examining all of the updates available to the player in question, extrapolating the potential moves opposing players may take, projecting out maxLookAheadDepth number of turns. The selected update will result in the greatest potential gain, balanced against the potential gain of other players.
- GKMonte
Carlo Strategist GKMonteCarloStrategist - The Monte Carlo Strategist is a generic AI that selects a game model update for a given player that results in the highest likelihood for that player to eventually win the game. It does this by sampling the updates available to the player in question. In doing this it will select the update it knows to produce the best result so far, expanding on this selection, simulating the rest of the game from that expansion, and then propogating the results (win or loss) upwards. It will do this until the budget has been reached, then returning the choice it has deemed best suited for the player in question.
- GKNS
Predicate Rule GKRuleSystem - A convenient subclass of GKRule that leverages existing NSPRedicate functionality for evaluating the predicate of the rule.
- GKNoise
GKNoise - GKNoise is the object used to manipulate and combine noise in continuous 3D space. It takes a GKNoiseSource as input. To extract and use a portion of the noise within the 3D space use the GKNoiseMap class.
- GKNoise
Map GKNoiseMap - GKNoiseMap represents an extracted portion of sampled points from continuous 3D noise. Extracted values are useful for 2D and 3D games. Noise values may be queried, set to explicit values or used as input for other uses, including textures and tile maps.
- GKNoise
Source GKNoiseSource - A GKNoiseSource instance is a description of procedural noise in 3D space. Noise sources generate values between -1.0 and 1.0, inclusive, for any position in continuous 3D space. Subclasses represent specific types of noise, each with their own parameters that affect the nature of the noise. Noise sources are the starting point for generating and using procedural noise. The 3D noise values may be manipulated and combined with the GKNoise class. Portions of this 3D noise can be extracted and utilized via the GKNoiseMap class. Extracted portions of noise are useful in both 2D and 3D games. Applications include creating realistic textures, height maps for 2D and 3D game world terrain, tile maps for 2D games, and intentionally imperfect game object and camera movements in 2D and 3D games. This class is not intended to be instantiated.
- GKObstacle
GKObstacle - Represents an impassible area in 2D space. Able to be avoided by GKAgent’s steering functions GKGraph can generate navigation graphs from a list of obstacles
- GKObstacle
Graph GKGraphandGKGraphNodeandGKObstacleGraph - A collection of GKGraphNodes that are governed by a set of extruded GKPolygonObstacles
- GKOctree
GKOctree - A tree data structure where each level has 8 children that subdivide a given space into the eight octants. Stores arbitrary NSObject elements via points and boxes.
- GKOctree
Node GKOctree - The individual node(s) that make up a GKOctree. Used as a hint for faster removal via [GKOctree removeData:WithNode:]
- GKPath
GKPath - Apple’s documentation
- GKPerlin
Noise Source GKNoiseSource - Perlin noise is useful for creating natural-looking textures and realistic-looking terrain.
- GKPolygon
Obstacle GKObstacle - An obstacle with an impassible closed polygon
- GKQuadtree
GKQuadtree - A tree data structure where each level has 4 children that subdivide a given space into the four quadrants. Stores arbitrary NSObject data via points and quads.
- GKQuadtree
Node GKQuadtree - The individual node(s) that make up a GKQuadtree. Used as a hint for faster removal via [GKQuadtree removeData:WithNode:]
- GKRTree
GKRTree - An R-tree is a data structure that partitions axis aligned bounding rectangles into groups spatially. When a group goes to large, it is split according to its split strategy into two new groups. Fast queries can be made on these partition bounding rectangles.
- GKRTree
Split Strategy GKRTree - Used to adjust the way in which RTree nodes are split when they grow too large.
- GKRandom
Distribution GKRandomDistribution - A random distribution is a random source itself with a specific mapping from the input source to the output values. The distribution is uniform, meaning there is no bias towards any of the possible outcomes.
- GKRandom
Source GKRandomSource - A concrete random source that can generate random numbers. The implementation details are up to the system and if a particular algorithm is needed then use one of the provided subclasses.
- GKRidged
Noise Source GKNoiseSource - Ridged noise is similar to Perlin noise, with sharply-defined, relatively thin peaks.
- GKRule
GKRuleSystem - The concrete class that the GKRuleSystem uses to evaluate the current state and facts with predicated rules. These are sharable between systems, so don’t retain any state in the rules themselves. Use the system-provided state storage.
- GKRule
System GKRuleSystem - A rule system consists of 3 things:
- GKSCN
Node Component GKComponentandGKSCNNodeComponent - A component that encapsulates a SceneKit node.
- GKSK
Node Component GKComponentandGKSKNodeComponent - A component that encapsulates a SpriteKit node.
- GKScene
GKScene - A scene stores and handles loading of data related to a particular scene.
- GKShuffled
Distribution GKRandomDistribution - A shuffled distribution tries to make sure individual samples are not clustered whilst retaining a uniform distribution of values over time. This is often referred to as fair or less random, as the predicatability of the outcomes in a series is vastly increased, yet the distribution of values is uniform.
- GKSphere
Obstacle GKObstacle - An obstacle with an impassible radius in 3D space For use with GKAgent3D. Using this with a GKAgent2D is no different than using GKCircleObstacle.
- GKSpheres
Noise Source GKNoiseSource - Produces 3D spherical noise with an infinite number of spheres-within-spheres of constantly-increasing radius.
- GKState
GKState - Represents a single state in a state machine. By default, states allow transitions freely to and from the states in the machine.
- GKState
Machine GKStateMachine - Models a finite state machine that has a single current state.
- GKVoronoi
Noise Source GKNoiseSource - Voronoi noise partitions the space into angular, polygonal “cells”, which are reminiscent of stained glass or crystal-like structures.
Constants§
- GK_
VERSION GKVersion - Apple’s documentation
Statics§
- GKGame
Model MaxScore GKGameModel - Maximum / minimum values for GKGameModel scoreForPlayer. Values must be within these ranges.
- GKGame
Model MinScore GKGameModel - Apple’s documentation
Traits§
- GKAgent
Delegate GKAgent - Delegate that will receive messages regarding GKAgent updates.
- GKGame
Model GKGameModel - A protocol for abstracting a game model for use with the GKMinmaxStrategist class. The minmax strategist uses the game model class, along with GKGameModelPlayer and GKGameModelUpdate to find optimal moves in an adversarial, turn-based game.
- GKGame
Model Player GKGameModel - A protocol used to represent an individual player within a game model.
- GKGame
Model Update GKGameModel - A protocol used to encapsulate the data needed to affect an update to a game model. Typically represents an action or move performed by a player.
- GKRandom
GKRandomSource - A protocol for random sources that can generate random numbers. This is the minimal interface needed to consume random values from a source; concrete subclasses should be used for configuring the production of random values. The availability of deterministic random sources is critical to creating reliable gameplay mechanics. Ensure that systems that should not influence each other have unique random sources and avoid sharing sources unless absolutely needed.
- GKScene
Root Node Type GKScene - Protocol that specifies the type of objects that can be used as root nodes of a GKScene.
- GKStrategist
GKStrategist - Apple’s documentation
- NSArray
Gameplay Kit GKRandomSource - Category “GameplayKit” on
NSArray. - SCNNode
Gameplay Kit SceneKit_Additions - Category “GameplayKit” on
SCNNode. - SKNode
Gameplay Kit SpriteKit_Additions - Category “GameplayKit” on
SKNode. - SKTexture
Gameplay Kit SpriteKit_Additions - Category “GameplayKit” on
SKTexture. - SKTile
MapNode Gameplay Kit SpriteKit_Additions - Category “GameplayKit” on
SKTileMapNode.