Crate objc2_gameplay_kit

Crate objc2_gameplay_kit 

Source
Expand description

§Bindings to the GameplayKit framework

See Apple’s docs and the general docs on framework crates for more information.

Structs§

GKARC4RandomSourceGKRandomSource
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.
GKAgentGKAgent and GKComponent
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.
GKAgent2DGKAgent and GKComponent
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.
GKAgent3DGKAgent and GKComponent
A 3D specialization of an agent that moves on a 3-axis logical coordinate system.
GKBehaviorGKBehavior
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
GKBillowNoiseSourceGKNoiseSource
Billow noise is similar to Perlin noise, with more rounded shapes and clearly-defined transitions beween values.
GKCheckerboardNoiseSourceGKNoiseSource
Produces noise in a checkerboard pattern.
GKCircleObstacleGKObstacle
An obstacle with an impassible radius
GKCoherentNoiseSourceGKNoiseSource
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.
GKComponentGKComponent
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.
GKComponentSystemGKComponent
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.
GKCompositeBehaviorGKBehavior and GKCompositeBehavior
Apple’s documentation
GKConstantNoiseSourceGKNoiseSource
Produces a single, constant value at all positions in the space.
GKCylindersNoiseSourceGKNoiseSource
Produces 3D cylindrical noise with an infinite number of cylinders-within-cyliners of constantly-increasing radius.
GKDecisionNodeGKDecisionTree
Apple’s documentation
GKDecisionTreeGKDecisionTree
Apple’s documentation
GKEntityGKEntity
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.
GKGaussianDistributionGKRandomDistribution
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%.
GKGoalGKGoal
Defines a spatial directive. The various goals cause force to be applied to agents to try to achieve said goal.
GKGraphGKGraph
Representation of a directed graph of GKGraphNodes
GKGraphNodeGKGraphNode
A node in a directed graph. Edges are directed and can have variable costs.
GKGraphNode2DGKGraphNode
GKGraphNode coupled with a 2D position
GKGraphNode3DGKGraphNode
GKGraphNode coupled with a 3D position
GKGridGraphGKGraph and GKGraphNode and GKGridGraph
Apple’s documentation
GKGridGraphNodeGKGraphNode
GKGraphNode coupled with a position on a 2D grid
GKLinearCongruentialRandomSourceGKRandomSource
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.
GKMersenneTwisterRandomSourceGKRandomSource
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.
GKMeshGraphGKGraph and GKGraphNode and GKMeshGraph
A collection of GKGraphNodes that are governed by a mesh formed by the space between a set of GKPolygonObstacles
GKMeshGraphTriangulationModeGKMeshGraph
Adjusts how graph nodes are created when you triangulate a GKMeshGrapk
GKMinmaxStrategistGKMinmaxStrategist
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.
GKMonteCarloStrategistGKMonteCarloStrategist
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.
GKNSPredicateRuleGKRuleSystem
A convenient subclass of GKRule that leverages existing NSPRedicate functionality for evaluating the predicate of the rule.
GKNoiseGKNoise
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.
GKNoiseMapGKNoiseMap
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.
GKNoiseSourceGKNoiseSource
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.
GKObstacleGKObstacle
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
GKObstacleGraphGKGraph and GKGraphNode and GKObstacleGraph
A collection of GKGraphNodes that are governed by a set of extruded GKPolygonObstacles
GKOctreeGKOctree
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.
GKOctreeNodeGKOctree
The individual node(s) that make up a GKOctree. Used as a hint for faster removal via [GKOctree removeData:WithNode:]
GKPathGKPath
Apple’s documentation
GKPerlinNoiseSourceGKNoiseSource
Perlin noise is useful for creating natural-looking textures and realistic-looking terrain.
GKPolygonObstacleGKObstacle
An obstacle with an impassible closed polygon
GKQuadtreeGKQuadtree
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.
GKQuadtreeNodeGKQuadtree
The individual node(s) that make up a GKQuadtree. Used as a hint for faster removal via [GKQuadtree removeData:WithNode:]
GKRTreeGKRTree
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.
GKRTreeSplitStrategyGKRTree
Used to adjust the way in which RTree nodes are split when they grow too large.
GKRandomDistributionGKRandomDistribution
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.
GKRandomSourceGKRandomSource
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.
GKRidgedNoiseSourceGKNoiseSource
Ridged noise is similar to Perlin noise, with sharply-defined, relatively thin peaks.
GKRuleGKRuleSystem
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.
GKRuleSystemGKRuleSystem
A rule system consists of 3 things:
GKSCNNodeComponentGKComponent and GKSCNNodeComponent
A component that encapsulates a SceneKit node.
GKSKNodeComponentGKComponent and GKSKNodeComponent
A component that encapsulates a SpriteKit node.
GKSceneGKScene
A scene stores and handles loading of data related to a particular scene.
GKShuffledDistributionGKRandomDistribution
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.
GKSphereObstacleGKObstacle
An obstacle with an impassible radius in 3D space For use with GKAgent3D. Using this with a GKAgent2D is no different than using GKCircleObstacle.
GKSpheresNoiseSourceGKNoiseSource
Produces 3D spherical noise with an infinite number of spheres-within-spheres of constantly-increasing radius.
GKStateGKState
Represents a single state in a state machine. By default, states allow transitions freely to and from the states in the machine.
GKStateMachineGKStateMachine
Models a finite state machine that has a single current state.
GKVoronoiNoiseSourceGKNoiseSource
Voronoi noise partitions the space into angular, polygonal “cells”, which are reminiscent of stained glass or crystal-like structures.

Constants§

GK_VERSIONGKVersion
Apple’s documentation

Statics§

GKGameModelMaxScoreGKGameModel
Maximum / minimum values for GKGameModel scoreForPlayer. Values must be within these ranges.
GKGameModelMinScoreGKGameModel
Apple’s documentation

Traits§

GKAgentDelegateGKAgent
Delegate that will receive messages regarding GKAgent updates.
GKGameModelGKGameModel
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.
GKGameModelPlayerGKGameModel
A protocol used to represent an individual player within a game model.
GKGameModelUpdateGKGameModel
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.
GKRandomGKRandomSource
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.
GKSceneRootNodeTypeGKScene
Protocol that specifies the type of objects that can be used as root nodes of a GKScene.
GKStrategistGKStrategist
Apple’s documentation
NSArrayGameplayKitGKRandomSource
Category “GameplayKit” on NSArray.
SCNNodeGameplayKitSceneKit_Additions
Category “GameplayKit” on SCNNode.
SKNodeGameplayKitSpriteKit_Additions
Category “GameplayKit” on SKNode.
SKTextureGameplayKitSpriteKit_Additions
Category “GameplayKit” on SKTexture.
SKTileMapNodeGameplayKitSpriteKit_Additions
Category “GameplayKit” on SKTileMapNode.