Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Influence map

Discussion in 'AI & Navigation Previews' started by laurentlavigne, Dec 13, 2016.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
  2. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    I've yet to get my mind around the 5.6 beta, but you can't do it in 5.5.

    It's possible to access the geometry through the navmesh class, but you would need to build your own navmeshagent and navmesh. It would be a nice feature to have weights per-vertices/nodes instead of perlayer. I can imagine that it would be easy to expose that. <- Feature Request There
     
    Last edited: Dec 13, 2016
    laurentlavigne likes this.
  3. marcV2g

    marcV2g

    Joined:
    Jan 11, 2016
    Posts:
    115
    Are there any tutorials on how to access navmesh data to generate a map for ai use?
     
  4. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    It's really a niche thing, so no, there're no tutorials. I used the documentation and intellisense: UnityEngine.AI.
     
    laurentlavigne likes this.
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    Like Damon says, and from what I'm seeing, AI in general is niche.
    Someone already did what you're looking for and you can glean some info from reading his twitter https://twitter.com/OskSta. He uses the vertices of a nav mesh to build a vector flow which is the end step of an influence map where you propagate the target. navmesh.NavmeshTriangulation() gives you everything you need. It's not as easy as arrays because you don't have the implicit connectedness of a grid but with "indices" you get your connection back at low cost, it's just that you need to do some preprocessing to get array of the distances between those indices and use the reverse as weight to influence the propagation.
    I'd totally share my stuff but at the moment I'm still busy with grids.
     
    Mycroft likes this.