Post not yet marked as solved
I am aware that this question has been asked before, but the answer seems to have changed over the years, and other answers online are still not clear to me. Currently (May 2022), it seems like Apple will allow Lua scripts to be run from inside an iOS app, but I am hoping someone can provide a definitive answer.
I am planning on building a Lua scripting engine into my iOS game engine to allow AI designers to control the game's AI.
The game engine is written in Swift and SpriteKit and targets iOS on iPhone and iPad. I am including the Lua scripts bundled with my application bundle, which are interpreted at runtime by a Lua interpreter that I am also including inside the application bundle.
I believe section 3.3.2 of the Apple Developer Program License Agreement is the pertinent section, and it sounds like using Lua scripts that are interpreted at runtime by an iOS app is fine. If anyone can offer any further confirmation or guidance to my interpretation, it would be much appreciated. My Lua scripts are directly related to the primary purpose of my app (AI scripts for a game).
I posted this question on StackOverflow, but it was closed because I was told the question seeks legal advice rather than technical advice, so if that will be true here as well, can anyone tell me where I should go to ask this question?
Post not yet marked as solved
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.