Search Unity

Low-poly, but unique animations?

Discussion in 'Animation' started by MetalSutton, Feb 14, 2015.

  1. MetalSutton

    MetalSutton

    Joined:
    Sep 22, 2014
    Posts:
    26
    I am kicking around a concept i am working on which is a game quite like rollercoaster tycoon, there can potentially be many,many, actors on the screen at once in an rts view, and I would like to crowds of people to have various animations trigger. and in order to make it not look odd, have them trigger at different times.

    So for example, a jumping animation, or a dancing animation, spread across about 1000 actors, and triggered in a way so that it doesn't look synchronous.

    What i would like to know is how Animations work when it comes to loading from memory etc. So by keeping the models loy-poly, i hope to have a large crowd count, however I am not sure how much of a toll the animations may have on the whole scene. Would it treat the scene as 2 animations loaded and played, or since many are playing at diffrent times, its treating it as many, many more animations and therefore a greater resource hog.
     
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    If you're using a few different animations spread across a theme park, it should be fine. I'm assuming most of the actors will be walking around, and occasional ones stop to think, scream, cry, buy, poop etc.? I've only had the need for a few hundred rotating and moving things as of yet, but it didn't seem like Unity struggled with it.

    What could possibly slow things down is having a lot of scripts attached to actors, but you'd have to try. Those Update() calls can be expensive in volume, but it's not entirely that bad. Using Mecanim shouldn't be a huge overhead, but adding an event script for each machine might still take its toll :)

    I'd make 5 example animations and spawn 200 of each in a loop, or have them appear many at a time when clicking a button to watch how it performs. The FPS counter in the editor isn't exactly perfect, but relative drops in frame rate should give you an idea of the capabilities. Optimise by having any repeating scripts control many actors.
     
    theANMATOR2b likes this.
  3. MetalSutton

    MetalSutton

    Joined:
    Sep 22, 2014
    Posts:
    26
    I have the AI scripts all sorted and its not much of an overhead. What I am concerned about is the animation, and what I am trying to achieve is not quite what you imagine, its not actors wandering everywhere but more like an actual concert crowd where everyone is packed and condensed into a moshpit like scenario. I figure I wont need any sudden events to trigger all the time, but instead to have a script cycle though people in a certain area and make changes 1 at a time so to keep the update cycle not putting pressure on the CPU.
     
  4. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Animation clip is a shared asset. If you have two different animator referencing the same clip they will use the same data.
    The Animator controller asset is also shared so if all your character are sharing the same controller they will all share the same data.

    Animation clip current time is kept in the animator internal memory.

    Depending which platform you are targeting and how complex you rig is your performance may vary greatly.

    With the mac standalone on a Macbook pro with a 20 bone rig with optimize game object hierarchy ON we could get a steady 60fps with 2 000 character running around.
    Take a look