Create a free account to remove all ad content.

Author Topic:  Will avatar have to be altered for animation  (Read 2390 times)

0 Members and 1 Guest are viewing this topic.

TRex

  • Elite Member
  • *
  • Posts: 930
  • Old dog of the Forums
    • View Profile
  • Xbox: SpindlierT Rex
Will avatar have to be altered for animation
« on: May 17, 2013, 08:42:14 PM »
As it stands there are tons of avatars using different demensions and each one has to generate few thousand blocks to load each one.  I really think for the future of the game we are going to need proper models for the avatars. 

What i think would be best would be make several male female modles of each race.  In addition have several types of torsos and leg modles for each sex that would be enterchangleable arcross race not sex.  The bodies and legs would use coding to change the skin color of these modles to that of the corresponding race to reduce memory and speed up production of animation while giving players the ability to customize there avatars.

Yes this would be simalar to the minecraft model but there would be far more types of them and they would not have the boxy minecraft feel.

If any one else has an idea on how to implement animation other than this please tell.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Will avatar have to be altered for animation
« Reply #1 on: May 17, 2013, 09:28:12 PM »
Yes, for animation we cannot use the current voxel based avatars.

They will have to be made of cuboids, similar to minecraft. The cuboids can be differently textured and of different sizes and each character can have a variable number of cuboids (like it won't be fixed to 1-head, 1-torso-2 x arms, 2 x legs), but there can be no voxel based models.

It's unfortunate but just a performance related necessity. Using bone animated cuboids I will be able to render every instance of every different character model in the game with a single draw call to the GPU which is a huge performance gain.

James

  • Guest
Re: Will avatar have to be altered for animation
« Reply #2 on: May 18, 2013, 12:51:41 PM »
Yes, for animation we cannot use the current voxel based avatars.

They will have to be made of cuboids, similar to minecraft. The cuboids can be differently textured and of different sizes and each character can have a variable number of cuboids (like it won't be fixed to 1-head, 1-torso-2 x arms, 2 x legs), but there can be no voxel based models.

It's unfortunate but just a performance related necessity. Using bone animated cuboids I will be able to render every instance of every different character model in the game with a single draw call to the GPU which is a huge performance gain.
I am not sure but how is bone animation good for the performance? wouldn't the increase of movement with the players (especialy when there are many players in a game) cause much more lag due to all the limbs moving around?

TRex

  • Elite Member
  • *
  • Posts: 930
  • Old dog of the Forums
    • View Profile
  • Xbox: SpindlierT Rex
Re: Will avatar have to be altered for animation
« Reply #3 on: May 18, 2013, 09:19:13 PM »
I do hope that there will be double jointed limbs(arms and legs), waist, torso and neck, head and later capes/cloaks.  I also hope that female models look much the way they do know having a slimer body with definition that it is a female without texturing it.

Craig I know that you are busy but I would like you to sometime take a look at my avatar map.  I made it last summer but due to the update was not able to show you and you said you would take a look at it after the 1.8 release.  Originaly the models where desined to allow customization of avatar as they still are but could also be used as a archatype to the new models just by the way i did them.  I wounder if i gave them to baldygargole he could give them to you.  I also have a few ideas for lighting and furniture that could be made into models.  It would be nice to hear back from you on this.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Will avatar have to be altered for animation
« Reply #4 on: May 18, 2013, 09:53:18 PM »
I am not sure but how is bone animation good for the performance? wouldn't the increase of movement with the players (especialy when there are many players in a game) cause much more lag due to all the limbs moving around?
It's not that bone animation is good for performance, it's more a matter of what part of the computer is doing the work. There is a CPU and a GPU, both of which work in parallel. The GPU is the tricky one. GPU's are designed to do their work in large batches. Sending many small batches to the GPU is terribly inefficient and costly for performance as opposed to sending a few large batches.

The trick to good performance is making sure both are working at near maximum, without having to interrupt or wait on each other.

For the following description there are 2 key words: Model and Instance.

1. Model refers to the Avatar itself. For each Avatar there is one Model.

2. Instance refers to each instance of the same avatar. e.g. if there are currently 12 Zombies active in the game, the Zombie Model has 12 instances. There are usually multiple instances per model.

With the current voxel models, the game has to do three things every frame (60 x a second).

1. Setup the transformation data for each Instance of each Model. The transformation data is assembled on the CPU, and then sent to the GPU. Having to send the data separately for each Model is inefficient (many small batches).

2. Execute one Draw call for each Model. The Draw call is executed on the CPU. It sets up the GPU data and states needed for the GPU to do the rendering. Just like step 1, having to execute a separate Draw call for each model is inefficient (many small batches).

3. The GPU renders all the instances for each Model (in parallel with the CPU, so the CPU can be getting on with other work while the GPU does the rendering).

The fact that steps 1 and 2 must be executed separately for each model is the problem. If there are 30 avatars currently used in the game, it must be done 30 times. There is a performance cost for each setup and draw call.

If you add Bone animation to this system, you no longer have one Model per Avatar, you will have at least 4 (head, torso, arm, leg), and more for more complex creatures, like dragons, etc.

So now if there are 30 Avatars in the game, steps 1 and 2 would have to be done at least 120 times, instead of 30. On top of that, the bones transformations themselves must also be calculated. The performance of Avatars now is already bad enough, this would just bring the game to it's knees.

Cuboid System:

Step 1: All the data for all instances of all the models can now be assembled and sent to the GPU as one batch (one big batch, rather than many small batches as before). This is because there is now actually only one model, a single cuboid (bone). Multiple cuboids are used to make up an avatar, but as far as the CPU and GPU are concerned, the model is now the cuboid, not the avatar.

Step 2 only requires one draw call for all instances of all models (again one big batch, rather than many small). For the same reason as step 1. The GPU is now just rendering a single batch of cuboids, rather than separate batches of different voxel models.

With bone animation, Step 1 now has an extra thing to do that it didn't have to do before, that is calculate the bone animation transformations. But the savings on being able to do Step 1 and Step 2 as one large batch are typically greater than the cost of the bone animation transformation calculation.

So if cuboids are used, bone animation is actually cheaper to do than the currently unanimated voxel models. And because the GPU jobs are a few large batches rather than many small batches, there is much less interaction between CPU and GPU resulting in better parallel performance.

Also, because cuboid models are typically only 6 - 10 cuboids per instance, compared to hundreds or thousands per instance as in the current voxel models, that's a massive reduction in the number of vertices shaded by the GPU (vertex shader). There are also savings for the pixel shader (GPU), although not as great as the vertex shader.

So with cuboid based bone animation, both the CPU and the GPU are doing less work than with the current unanimated voxel models, and they are also working together in parallel better, meaning less downtime (waiting) and less potential GPU stalls (which are very bad for performance).

There are several other smaller performance gains the cuboid models give. Once is to do with draw culling. With the existing models, it's too expensive to do draw culling on the instances, so the game just draws every instance, even if it's out of view of the player. That means the GPU is doing work it shouldn't need to. With the cuboid models, the draw culling will have virtually no performance cost, so it will be implemented and the GPU will have even less work to do.
« Last Edit: May 19, 2013, 03:46:00 AM by Craig »

James

  • Guest
Re: Will avatar have to be altered for animation
« Reply #5 on: May 18, 2013, 11:56:28 PM »
Wow, now this is why I want to be a developer myself of a game haha! :D but thanks for the explanation! ;D
« Last Edit: May 19, 2013, 12:44:01 AM by Craig »

Pride

  • Legendary Member
  • *
  • Posts: 1106
  • A new begining
    • View Profile
  • Xbox: Denied Pride
Re: Will avatar have to be altered for animation
« Reply #6 on: May 19, 2013, 01:22:24 AM »
Question:
Will all the avatars we already have unlocked be replaced...

Not Actually Atlas

  • Extreme Member
  • *
  • Posts: 5777
  • Atlas Telamon
    • View Profile
  • Xbox: atlh3
  • Steam: The_Green_Condom
Re: Will avatar have to be altered for animation
« Reply #7 on: May 19, 2013, 02:22:27 AM »
Yes, for animation we cannot use the current voxel based avatars.

They will have to be made of cuboids, similar to minecraft. The cuboids can be differently textured and of different sizes and each character can have a variable number of cuboids (like it won't be fixed to 1-head, 1-torso-2 x arms, 2 x legs), but there can be no voxel based models.

It's unfortunate but just a performance related necessity. Using bone animated cuboids I will be able to render every instance of every different character model in the game with a single draw call to the GPU which is a huge performance gain.
will you use the current avatars, just make them out of cubiods? i really like the unlockables and npc's total miner uses, and it would suck to lose them


Miner of the Month for January 2014
But you can call me the salaminizer!
#BanAtlas

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Will avatar have to be altered for animation
« Reply #8 on: May 19, 2013, 03:38:56 AM »
All the existing avatars will remain, but they will need to be converted to the cuboid based models.

Using the existing voxel model avatars, I'm reluctant to add any new NPC's to the game (that includes mobs). This is because each new model added has a performance cost, and the game is actually already past the number of different avatars it can currently handle without lag.

With the cuboid based avatars, it doesn't matter how many different models there are, it's irrelevant, all that matters is the total number of cuboids that have to be drawn at any one time. So with the cuboid avatars, I will be happy to add many many more avatars and mobs.
« Last Edit: May 19, 2013, 03:41:27 AM by Craig »

BeardedSHROOMS

  • Sr. Member
  • *
  • Posts: 421
    • View Profile
  • Xbox: BeardedSHROOMS
Re: Will avatar have to be altered for animation
« Reply #9 on: May 19, 2013, 04:10:40 AM »
How big of a change will this be as far as time and difficulty?