Quadtrees could potentially be an option (I'd have to research those more to know for sure), thanks for that idea. But I thought that what I was trying to do with GameplayKit was pretty much the exact use case for why the GKGridGraph is provided by Apple, to construct a grid-aware graph of nodes that can be walked by A*, which is I am assuming what is used behind GKGraph.findPath(). So...to some extent, if GKGridGraph cannot efficiently do what I've described above, I really don't know what the purpose is of the GKGraph classes other than to build very simple games, ones that have very small grids. In my tests it took 2,000 milliseconds to remove 20% of the nodes in a 50x50 grid, which is a couple orders of magnitude too slow for my purposes.
I am fine coding my own data structures from scratch to power my game engine, but I really thought that GKGridGraph was supposed to provide the exact functionality that I'm trying to use it for, so I am very reluctant to just start coding my own data structures. Really I would just love to get some sample code from Apple/anyone showing how to add a specific array of subclassed GKGridGraphNodes to a GKGridGraph and have the resulting graph be self-aware of the underlying grid structure that resulted from adding the nodes.
This page: jonathanfischer.net/lets-build-gameplaykit-grid-pathfinding shows a close example to what I am trying to do, but Apple's GK API docs suggest that their GKGridGraph implementation should be able to do what I'm wanting to do. What am I missing?
Topic:
Graphics & Games
SubTopic:
General
Tags: