GameplayKit

RSS for tag

Architect and organize your game logic and incorporate common gameplay behaviors in your app using GameplayKit.

Posts under GameplayKit tag

50 Posts

Post

Replies

Boosts

Views

Activity

GKAgent3d wander goal to stop agent from flying around
I am trying to learn GameplayKit and am using it with SceneKit so I am using a GKAgent3d for my agent to set behaviours on. I have got behaviours working but I am trying to have the agent wander around a plane that I have representing ground but when the agent is wandering it seems to be wandering on all axis so it just ends up flying around. Is there any way to have the agent stick to the ground when it is wandering?
2
1
996
Jul ’22
Struggling Amateur: GKGridGraph implementation.
Hello! I'm very new to coding and am exploring a basic proof of concept which I can then work off. What I would like to do is a create a grid over a tilemap that can be navigated by a player piece. A simple piece, and my input on the grid would tell the piece to walk toward and stop on the clicked tile. Not bothered with graphics yet. I have dug into the documentation for Xcode, reading the Pathfinding via GameplayKit and SceneKit structures. I have identified that I believe I will need to work with the GKGridGraph, for an integer based grid. I will also obviously need a player controller, utilising touch controls. The first thing I am trying to work out... is how to actually create and implement the GKGridGraph. If anyone could.. explain it like I'm an absolute... dummy, or has some tutorials that will help me with this, it would be greatly appreciated.
1
1
998
Jul ’22
video error
Hello, I hope you are well. I am developing a hybrid application, the application as such is web, the problem I have is that iOS does not display videos in safari, in Google Chrome yes, when I take out the application for iOS it does not display the videos either, I do not know if It would be due to the same problem that happens with safari. to hybridize the application I am using capacitor / core
0
0
1k
Apr ’22
How to construct GKGridGraph using only traversable nodes
I am trying to use GameplayKit's GKGridGraph for a turn-based strategy game. A typical way of using this data structure seems to be to initialize a new GKGridGraph by passing it the grid dimensions, plus a few other params. This results in a fully constructed and connected grid graph of nodes. Then the technique I have seen is to manually remove the nodes that you don't want your agent to be able to traverse, for later usage of findPath(). However, I have found the remove() method to be really bad on performance, for example it takes around 100x longer to call the remove() method than to add a node to the grid graph. I do not know if this is a bug in the framework or not. That performance is going to be a show-stopper for me, so using that technique is not going to be an option for me. I can post all requisite code if there is anyone out there who knows anything about how to use GKGridGraph. Does anyone know how to construct a grid-aware, fully connected GKGridGraph correctly using only the nodes that you want to be in the graph? Also, if there are any Apple support/engineers out there reading this, wow it is hard to get started with GameplayKit due to lack of documentation/tutorials/project samples that are anything more than just the most basic simple use cases. I do believe that GameplayKit is a very well designed framework, but any examples beyond the basics seem to be non-existent anywhere on the internet (March 2022), and the API docs are woefully too little information to get started beyond a Flappy Bird clone. I am attempting to build a professional game. For example, I was not able to find a single example anywhere of how to use a GKGridGraph with a sub-classed GKGridGraphNode class, and then to prep the grid for traversal and usage of findPath(). This technique is only vaguely hinted at in the Apple-supplied Pathfinding sample project at Pathfinding Sample Project. Any help would be greatly appreciated. I am considering abandoning GameplayKit simply due to lack of documentation at this point, but I do believe underneath it is a really good framework, if you know things about it beyond what the API docs tell you.
3
0
1.1k
Mar ’22
GKComponentSystem memory leaking
All GKComponents, registered in some GKComponentSystem, become indestructible after destroying the GKComponentSystem. To avoid that GKComponentSystem must explicitly remove all owned components before being destroyed. Looks like GKComponentSystem has some problem with strong references.
2
0
1.2k
Feb ’22
How to test achievements in 2021
Hello I'm reading a lot about people talking about "sandbox" accounts (that from my understanding actually is no longer available starting from iOS9) or development builds... but I can't find a comprehensive documentation that explain what to do to test achievements. This is the flow that I'm following to add achievements to my game. It is not fully working since I can't see the popup "completed" when I set the achievement as accomplished but other items are working as expected (I can set an achievement as done and I can retrieve the list of completed achievements). Description of my current situation Added all the achievements via AppStoreConnect Created a new version of my App and added the Achievements to this new version (This version has not been submitted yet, but the App is already on the App Store with another version) via AppStoreConnect My App is written in Unity. So I've added all the needed code there. I see that I can unlock achievements and I can retrieve a list of all the unlocked achievements. So the code seems to work as expected. I'm running the App directly from Xcode... it is not uploaded to Testflight. Problems and Doubts When I unlock an achievement the "completed" popup is not shown If I open GameCenter, under my game, I do not see a list of available Achievements. I suppose this is the correct behaviour since the version with the achievements has not been submitted and approved. I'm wondering... which is the right way to test achievements? Someone is talking about using "development" builds... other say to use sandbox accounts... is there a documentation out there that explains the right flow?!
1
1
1.2k
Dec ’21
How to test GameCenter Achievements before publishing?
I'm adding GameCenter Achievements to my game:           let a = GKAchievement(identifier: "levelcomplete2"); a.percentComplete = 100; GKAchievement.resetAchievements() { (e) in 	 print("ERRORA: \(e)") } GKAchievement.report([a]) { (e) in 	 print("ERROR: \(e)");  }; The error shows "nil" but because the Achievement isn't live yet (the App is not published), there's no success-banner showing in the app. How can I test if it's working?
1
0
1.5k
Dec ’21
GKAgent3d wander goal to stop agent from flying around
I am trying to learn GameplayKit and am using it with SceneKit so I am using a GKAgent3d for my agent to set behaviours on. I have got behaviours working but I am trying to have the agent wander around a plane that I have representing ground but when the agent is wandering it seems to be wandering on all axis so it just ends up flying around. Is there any way to have the agent stick to the ground when it is wandering?
Replies
2
Boosts
1
Views
996
Activity
Jul ’22
Struggling Amateur: GKGridGraph implementation.
Hello! I'm very new to coding and am exploring a basic proof of concept which I can then work off. What I would like to do is a create a grid over a tilemap that can be navigated by a player piece. A simple piece, and my input on the grid would tell the piece to walk toward and stop on the clicked tile. Not bothered with graphics yet. I have dug into the documentation for Xcode, reading the Pathfinding via GameplayKit and SceneKit structures. I have identified that I believe I will need to work with the GKGridGraph, for an integer based grid. I will also obviously need a player controller, utilising touch controls. The first thing I am trying to work out... is how to actually create and implement the GKGridGraph. If anyone could.. explain it like I'm an absolute... dummy, or has some tutorials that will help me with this, it would be greatly appreciated.
Replies
1
Boosts
1
Views
998
Activity
Jul ’22
video error
Hello, I hope you are well. I am developing a hybrid application, the application as such is web, the problem I have is that iOS does not display videos in safari, in Google Chrome yes, when I take out the application for iOS it does not display the videos either, I do not know if It would be due to the same problem that happens with safari. to hybridize the application I am using capacitor / core
Replies
0
Boosts
0
Views
1k
Activity
Apr ’22
How to construct GKGridGraph using only traversable nodes
I am trying to use GameplayKit's GKGridGraph for a turn-based strategy game. A typical way of using this data structure seems to be to initialize a new GKGridGraph by passing it the grid dimensions, plus a few other params. This results in a fully constructed and connected grid graph of nodes. Then the technique I have seen is to manually remove the nodes that you don't want your agent to be able to traverse, for later usage of findPath(). However, I have found the remove() method to be really bad on performance, for example it takes around 100x longer to call the remove() method than to add a node to the grid graph. I do not know if this is a bug in the framework or not. That performance is going to be a show-stopper for me, so using that technique is not going to be an option for me. I can post all requisite code if there is anyone out there who knows anything about how to use GKGridGraph. Does anyone know how to construct a grid-aware, fully connected GKGridGraph correctly using only the nodes that you want to be in the graph? Also, if there are any Apple support/engineers out there reading this, wow it is hard to get started with GameplayKit due to lack of documentation/tutorials/project samples that are anything more than just the most basic simple use cases. I do believe that GameplayKit is a very well designed framework, but any examples beyond the basics seem to be non-existent anywhere on the internet (March 2022), and the API docs are woefully too little information to get started beyond a Flappy Bird clone. I am attempting to build a professional game. For example, I was not able to find a single example anywhere of how to use a GKGridGraph with a sub-classed GKGridGraphNode class, and then to prep the grid for traversal and usage of findPath(). This technique is only vaguely hinted at in the Apple-supplied Pathfinding sample project at Pathfinding Sample Project. Any help would be greatly appreciated. I am considering abandoning GameplayKit simply due to lack of documentation at this point, but I do believe underneath it is a really good framework, if you know things about it beyond what the API docs tell you.
Replies
3
Boosts
0
Views
1.1k
Activity
Mar ’22
GKComponentSystem memory leaking
All GKComponents, registered in some GKComponentSystem, become indestructible after destroying the GKComponentSystem. To avoid that GKComponentSystem must explicitly remove all owned components before being destroyed. Looks like GKComponentSystem has some problem with strong references.
Replies
2
Boosts
0
Views
1.2k
Activity
Feb ’22
How to test achievements in 2021
Hello I'm reading a lot about people talking about "sandbox" accounts (that from my understanding actually is no longer available starting from iOS9) or development builds... but I can't find a comprehensive documentation that explain what to do to test achievements. This is the flow that I'm following to add achievements to my game. It is not fully working since I can't see the popup "completed" when I set the achievement as accomplished but other items are working as expected (I can set an achievement as done and I can retrieve the list of completed achievements). Description of my current situation Added all the achievements via AppStoreConnect Created a new version of my App and added the Achievements to this new version (This version has not been submitted yet, but the App is already on the App Store with another version) via AppStoreConnect My App is written in Unity. So I've added all the needed code there. I see that I can unlock achievements and I can retrieve a list of all the unlocked achievements. So the code seems to work as expected. I'm running the App directly from Xcode... it is not uploaded to Testflight. Problems and Doubts When I unlock an achievement the "completed" popup is not shown If I open GameCenter, under my game, I do not see a list of available Achievements. I suppose this is the correct behaviour since the version with the achievements has not been submitted and approved. I'm wondering... which is the right way to test achievements? Someone is talking about using "development" builds... other say to use sandbox accounts... is there a documentation out there that explains the right flow?!
Replies
1
Boosts
1
Views
1.2k
Activity
Dec ’21
How to test GameCenter Achievements before publishing?
I'm adding GameCenter Achievements to my game:           let a = GKAchievement(identifier: "levelcomplete2"); a.percentComplete = 100; GKAchievement.resetAchievements() { (e) in 	 print("ERRORA: \(e)") } GKAchievement.report([a]) { (e) in 	 print("ERROR: \(e)");  }; The error shows "nil" but because the Achievement isn't live yet (the App is not published), there's no success-banner showing in the app. How can I test if it's working?
Replies
1
Boosts
0
Views
1.5k
Activity
Dec ’21