Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Building city with pedestrians

Discussion in 'Getting Started' started by monsterrungame, Jun 12, 2020.

  1. monsterrungame

    monsterrungame

    Joined:
    Sep 27, 2019
    Posts:
    15
    Hello, I'm building a city with bunch of pedestrians wandering. This is project for mobile devices.
    I've just started with Unity and I've a question about creating pedestrians objects. I consider two options:

    1. Create all pedestrians on scene in whole city and designate them waypoints for wandering
    2. Create spawners for pedestrians and spawn them depending on currently hero position and view

    Of corse first option is the quickest and simplest one but I'm wonder about optimisation... Is Unity rendering an object that is out of Camera view?
     
  2. DaDonik

    DaDonik

    Joined:
    Jun 17, 2013
    Posts:
    258
    If you are targeting mobile devices, you have to save all the performance you can.
    Even for a highend desktop game, i would not even consider version 1, depending on how large your city is.

    Go with version 2 and make sure that you pool your pedestrians, so you are not triggering the garbage collector all the time.
     
  3. monsterrungame

    monsterrungame

    Joined:
    Sep 27, 2019
    Posts:
    15
    Thanks for your feedback.
     
  4. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    391
    Note that pedesdrians (i assume humanoid people) are likely to be relatively expensive to render than static city building objects. Normally this would require a skinned articulated model etc. Of course this does depend on your art style and visual fidelity.
     
  5. monsterrungame

    monsterrungame

    Joined:
    Sep 27, 2019
    Posts:
    15
    I've bought animated low-poly people from polyperfect on asset store. This will be good?
     
  6. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    391
    Sorry, i don't know. Probably the best thing to do is set up a simple test scene to see how many you can animate at the same time on your target hardware. To do this obviously you will need to build and deploy to a mobile device of the minimum spec you want to support. Good luck with your project.
     
  7. monsterrungame

    monsterrungame

    Joined:
    Sep 27, 2019
    Posts:
    15