Search Unity

Is it worth to spawn specific number of npcs at a time?

Discussion in 'Navigation' started by prince564813, Oct 7, 2019.

  1. prince564813

    prince564813

    Joined:
    Jun 8, 2017
    Posts:
    2
    Hello devs, I'm making a game for android and want ideas from you. Maybe this question is off point but I really need answer to it.
    I want to know if spawning a limited number (100) of npc in my game (target platform: Android) is really good to be implemented considering the latest android devices or should I just pause the AI if the player is far away from the npc. I was also wondering abiut spawning them at random points but concerning my peoject, it isnt perfect to do that. I'm actually not noew to unity but new in game development. Thanks
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    There's no silver bullet answer for this since it's all about optimization, but pooling and repooling your agents and carefully managing their pathing quality based on distance/visibility are generally good ideas yes.
    Make sure to be very conservative in setting destinations on your agents, and if you can group up agents under a single path then definitely do so.