Path Finding
First attempt at using the GamePlayKit
path finding GKGridGraph
. Unfortunately, the playground currently crashes (because of some internal XCode bug maybe?), so it can’t be tested.
The idea is that an actor can move if there is something present on the layer directly below them, but can’t move through layers they occupy themselves. Currently hardcoded as requirement for tiles on region.layers[0]
but this environment evaluation should probably be a method of the actor, as e.g. flying or swimming actors might have other ideas. Also, the graph generation should be restricted to what an actor has actually see, so they can’t figure out a perfect path through unknown terrain.
Next related
Xcode Bug Report
Two days lost in air travel, and today’s session was all about troubleshooting the crashing Swift Playground in Xcode, so nothing useful got done today. Some cosmetic code readability fixes was commited during re-reading everything to try and figure out what could possibly cause the crashes.
Previous related
GameplayKit A*?
Let’s try to use the builtin [A](https://en.wikipedia.org/wiki/A_search_algorithm) in GameplayKit, and see if it works for our current demands.
Directional Navigation
Prereq work for implementing path finding: eight direction navigation. A tile can find its neighbours within its layer exit(direction:). Currently only within a single map region, because we haven’t implemented interregion links yet.
Caching?
Spent at huge part of the hour today troubleshooting why my API change to an init method was not being seen by the playground. Weird caching bugs? No; it turns out that XCode was building for target instead of simulator, so the playground didn’t get a rebuilt version of the framework when I hit build. Still don’t know why that changed since last time, but oh well.