Questions tagged [gameplay-kit]

Apple's GameplayKit framework provides pathfinding, goal-based movement, rulesystems, entity-component systems, finite state machines and random distribution classes for game developers. Also included is a class and related protocols for building turn-based AIs based on minmax tree search. Available for iOS 9 and OS X 10.11.

190 questions
3
votes
2 answers

GKBehaviour in xcode 8 beta 4 makes gkagent position crazy

So I'm creating a game where I want to add some GKGoal for my GKAgent behaviour. So after hours of fighting, I've downloaded next project this time is from Apple Agents Catalog, and in Xcode 7.3 it works. I rewrite it to Swift and create basic…
Michal Rogowski
  • 431
  • 3
  • 18
3
votes
2 answers

Procedural Map Generation - SpriteKit and GameplayKit

I have the following code to generate noise using the new GameplayKit's GKNoise. I am not sure how I can use that with the SKTileMapNode. Has anyone tried this ? At the moment the noise is applied to each tile but not to the overall TileMap. Is…
Deepak
  • 6,684
  • 18
  • 69
  • 121
3
votes
1 answer

Can I combine GameplayKit's pathfinding features with SceneKit?

The documentation states GameplayKit also works well for 3D games built with the SceneKit framework However, there seems to be no mention of using SceneKit's pathfinding features such as GKGraph with SCNNodes that exist in 3d space. Are…
gargantuan
  • 8,888
  • 16
  • 67
  • 108
2
votes
0 answers

How to get seamless noise textures from GKNoiseMap

According to Apple's docs the seamless parameter in GKNoiseMap is: A Boolean value that when true indicates the system adjusts samples from the noise object so that generated texture images can tile without visible seams. But I've been unable to…
2
votes
1 answer

Color "not valid for the NSColor Generic Gray Gamma" when creating SKTexture from GKNoise with gradientColors

This basic code works until I try to add gradientColors: let noise = GKNoise(src) noise.gradientColors = [ 0.0: NSColor.blue, 0.5: NSColor.green, 0.75: NSColor.white] let map = GKNoiseMap(noise, size: vector_double2(x:…
Rick
  • 3,298
  • 3
  • 29
  • 47
2
votes
0 answers

SKTextureAtlas EXC_BAD_ACCESS

I am trying to create an animation with the use of SKTextureAtlas. However I get an EXC_BAD_ACCESS error when I try to construct the SKTextureAtlas, with a dictionary of [String: NSString]. My code looks as following: func…
ARR
  • 2,074
  • 1
  • 19
  • 28
2
votes
0 answers

SpriteKit bad FPS performance with really simple scene

I'm new to SpriteKit and I'm trying to simulate a population of 1000 moving individuals each being represented by a simple circle. I have an awful frame rate (around 6/7 fps) so I reduced to 100 and reached 35 fps... My nodes are the simplest in…
Zaphod
  • 6,758
  • 3
  • 40
  • 60
2
votes
2 answers

Does Xcode 11.2 scene editor allow adding components?

Using Xcode 11.2 I can create a new project using the "Game" template. I can include for "Game Technology" SpriteKit and check "Integrate GameplayKit". If I run the code at this point on an iPhone 11 Pro iOS 13.2 simulator I see the "Hello,…
Gerard
  • 689
  • 5
  • 15
2
votes
1 answer

Swift 4 - GKMinmaxStrategist Modifying Actual Game Model

Before I start, this question has already been asked a while ago but I don't believe the answer is satisfactory (GKMinmaxStrategist modifies model after return of best move) I am trying to build a straightforward board game with two player types…
SanMu
  • 645
  • 1
  • 6
  • 19
2
votes
1 answer

GKAgent won't update position of SCNNodes registered as entities on teams in an ARKit/SCNScene/GamplayKit game

I am using a GKAgent to move SCNNodes registered as entities, assigned a team component, and a move component. The agentWillUpdate and agentDidUpdate methods are being triggered but the position of entities added to the scene refuse to update their…
2
votes
1 answer

Trying to use GKComponent subclass in SpriteKit editor silently crashes Xcode on save

I am trying to work with GameplayKit and SpriteKit using the scene editor in Xcode. I am new to SpriteKit and also have not used NSSecureEncoding before. Pretty new at swift to be honest. I have a basic GKComponent subclass with one integer one…
Mike Beaumont
  • 91
  • 1
  • 3
2
votes
0 answers

GKMinmaxStrategist not exploring required positions

Imagine a very simple game, where in any non-final position, the active player can make either move 1 or move 2. Let's say if player 1 starts with move 1, he wins the game immediately. If he starts with move 2, he can still win if player 2 plays…
2
votes
0 answers

How to create a non-spherical 3D GKAgent or GKObstacle?

The title is my direct question, but I will elaborate to provide context, or detail what is needed for a helpful workaround if the answer is: You can't, log Radar with Apple Use case is simple: Have a behavior driven GKAgent3D avoid a plane in my…
Swany
  • 615
  • 8
  • 14
2
votes
0 answers

Advice on using DispatchQueue on global and main with a while loop

I've built a strategy game and implemented a Gameplay kit AI for it. The AI can potentially take several moves per turn. Since the GKMinMaxStrategist gives one best move per call, I have put the method bestMoveForPlayer() inside tileForAIMove() in a…
2
votes
1 answer

moving platform with gameplay kit

Creating a 2d game, and want to add moving platforms where I can control the pattern and rotation of the platform. Example: I want this platform to move in a clockwise motion, also when it reaches the top and bottom I want it to rotate accordingly…
Discoveringmypath
  • 1,049
  • 9
  • 23
1 2
3
12 13