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.