Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Question] AI and procedural terrain

Discussion in 'Navigation' started by vanLiere, Jul 16, 2017.

  1. vanLiere

    vanLiere

    Joined:
    Jul 11, 2017
    Posts:
    7
    Hello, I'm playing around in unity with infinite procedural terrain (voxel based with chunks)
    But i would like to make enemy AI also, i've done one before with Navmesh but since this terrain would be generated randomly how would you do this since you can't bake the Navmesh?

    Aslo how would i make the enemy AI randomly patrol and spawn if you can't place manual waypoints?
    (I think i can despawn them with a sphere on the player with a radius when the enemy gets outside it will despawn, would i create a random spawner attached to the player aswel? with a min/max radius)

    Goal im achieving is kind of the "openworld survival" games with enemy AI such as: 7 Days to die, The forest etc.

    Thanks in advance
     
    Last edited: Jul 16, 2017
  2. Miggi124

    Miggi124

    Joined:
    Jul 31, 2017
    Posts:
    69
    Hi - I think that what you're trying to achieve might be WAY too complicated - and the completely procedural approach you're going for will not only take far too long, it's results will be... less than stellar. However, if you make a set of modular bases, then save them as prefabs, and place them randomly across the map, your AI could follow placed markers, but they would still be able to manoeuvre on the procedural terrain.

    I'm 99% asleep right now so apologies if this isn't the answer you're looking for.

    Regards,

    Miggi124