Hi,
I want to use A* Project to allow my AI players to determine paths that maximize going across valuable areas. A way to do this would be creating a semi-physical ‘space’ where traversal cost is a combination of both normal physical and the value-measure (i.e. paths of least ‘value’ would be least likely chosen). However, I also wish to navigate by regular physical space.
I seek advice on the best way to achieve this.
I think my ‘value space’ would be best done as an optionally-used addition to the physical data. More details…
My world is partially procedurally generated with resources smoothly varying over the ground. Resources don’t affect traversability … well, kind’a. (Maybe I can explain: it’s snow, they’re snowmen that roll over sufficiently flat snow for health. The snow is an unmoving but modifiable voxel space atop static world geometry.)
(Wha?!.. just realized I seem to have no video clip of this!? How can this be?! Will fix for ScreenShotSaturday!) Anyway, back to the question…
I’d like to have my AI be able to determine nearest/etc ‘usable’ resources. (usable = sufficient smooth snow. They need this when low on health!)
In case it makes a difference, I’m currently using a GridGraph though I’ll likely need Layered pretty soon.
My first impulse was to avoid needing to modify the A* project source. Perhaps somehow including this info in the existing A* info – perhaps as a … um, varying tag? I’m not convinced by this approach. Thoughts? Otherwise, next!
I next allowed myself to poke around in the code (beautiful, I’m sure you know) and wondered if I could add some custom user data to a GridNode (e.g. hang a System.Object reference off GridNode and populate in UpdateNodePositionCollision() with an optionally null delegate). Then perhaps some optionally null cost evaluation delegate could override cost determinations for Graph consumers that ask in a certain way. My intent here being a patch to A* Pathinding Project that can be pushed and be useful to others so as not to fork myself painfully
Any thoughts, etc are obviously not only most welcome but keenly sought!
Thanks, Rupert.
p.s. I’m using latest A* Pro with Unity 5.1.3 (soon to upgrade) on Windows 8.1 in case it’s relevant.