Total Miner Forums

General => General Discussion => Topic started by: TRex on May 17, 2013, 08:42:14 PM

Title: Will avatar have to be altered for animation
Post by: TRex 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.
Title: Re: Will avatar have to be altered for animation
Post by: Craig 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.
Title: Re: Will avatar have to be altered for animation
Post by: James 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?
Title: Re: Will avatar have to be altered for animation
Post by: TRex 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.
Title: Re: Will avatar have to be altered for animation
Post by: Craig 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.
Title: Re: Will avatar have to be altered for animation
Post by: James 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
Title: Re: Will avatar have to be altered for animation
Post by: Pride on May 19, 2013, 01:22:24 AM
Question:
Will all the avatars we already have unlocked be replaced...
Title: Re: Will avatar have to be altered for animation
Post by: Not Actually Atlas 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
Title: Re: Will avatar have to be altered for animation
Post by: Craig 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.
Title: Re: Will avatar have to be altered for animation
Post by: BeardedSHROOMS on May 19, 2013, 04:10:40 AM
How big of a change will this be as far as time and difficulty?
Title: Re: Will avatar have to be altered for animation
Post by: Craig on May 19, 2013, 04:51:02 AM
How big of a change will this be as far as time and difficulty?
I don't think the difficulty will be high. I've never programmed bone animated models before but from what code I have seen, it's not what I would call a serious challenge. I expect it will be around 2 weeks for all the programming, and probably 1 - 2 weeks to create the animations which an animator can do while I do the programming (I'm not going to do the animation, me and 3D modelling software don't work well together which is another reason I love making this game, because I don't have to use modelling software).
Title: Re: Will avatar have to be altered for animation
Post by: Silver on May 19, 2013, 06:13:45 AM
Wow, Craig, this sounds great! So what you're saying is that if we use animation for characters, it'll have better performance than voxel built characters?
Title: Re: Will avatar have to be altered for animation
Post by: TRex on May 20, 2013, 08:24:25 PM
Yeah sound about right.  Ever played a game and droped a 1000 or so objects and they started rolling around casting there own shadows and such.  Bet it lagged the game up pretty bad.  That is how it would be if animation is added now as it is.

I just hope to get my avatars into the game they would provide the customization that the game needs as well as being easy to convert into the new style of avatars.
Title: Re: Will avatar have to be altered for animation
Post by: Craig on May 20, 2013, 08:27:23 PM
I just hope to get my avatars into the game they would provide the customization that the game needs as well as being easy to convert into the new style of avatars.
I suspect you haven't properly understood what I've posted. I can't use models, they're too demanding for the 360. Everything will be built from a simple textured cuboid.
Title: Re: Will avatar have to be altered for animation
Post by: Not Actually Atlas on May 20, 2013, 08:57:37 PM
I just hope to get my avatars into the game they would provide the customization that the game needs as well as being easy to convert into the new style of avatars.
I suspect you haven't properly understood what I've posted. I can't use models, they're too demanding for the 360. Everything will be built from a simple textured cuboid.
will the cuboid look like the blocks currently in the game, or will they be basic colors?
Title: Re: Will avatar have to be altered for animation
Post by: TRex on May 23, 2013, 04:13:17 AM
Later will players be able to customize the cuboids for personal touch to their maps.

Cuboids sound a bit like the idea of models in my head.  From what I understand a cuboid is a single object such as a (arm, leg, torso or a head) as compared to the arms, legs, torso and head that we have know that use hundreds of objects or cubes to make each one.
The cuboid method sounds a bit like the minecraft models which is kinda what I was thinking of that several large objects would make up the avatar reducing memory cost.
Title: Re: Will avatar have to be altered for animation
Post by: Clerical on May 23, 2013, 04:37:00 AM
Later will players be able to customize the cuboids for personal touch to their maps.
Doubt it, adding a hole customization avatar wouldn't be something that would/could be implemented into the game, i doubt the bone animation will change how the avatars work, you will still probably unlock them and if you wan't you'res to be in the game you must follow some guidelines and submit it personally to Craig.

Thats how id imagine it work, be interesting to see what craig himslef says.
Title: Re: Will avatar have to be altered for animation
Post by: Craig on May 23, 2013, 06:44:38 AM
will the cuboid look like the blocks currently in the game, or will they be basic colors?
They will be textured with skins.
Title: Re: Will avatar have to be altered for animation
Post by: Craig on May 23, 2013, 06:47:15 AM
Later will players be able to customize the cuboids for personal touch to their maps.
It would be possible to allow players to customize the thickness of the cuboids, and possibly the length to a small degree.

The cuboid method sounds a bit like the minecraft models
Pretty much. It's absolutely the most efficient way to have bone animated avatars. Which is why MC can handle hundreds of animals running around, and mods like toy soldiers.
Title: Re: Will avatar have to be altered for animation
Post by: TRex on May 23, 2013, 06:59:21 PM
Sorry for the misunderstanding Craig I guess I should have talked about turning them into cuboids instead of models. 

I was mixing cuboids with models based on my idea of 3d software models of objects made for games.
Title: Re: Will avatar have to be altered for animation
Post by: Celtic on May 30, 2013, 10:42:32 PM
This sounds fantastic! just the direction that TM needs to go in. Once this step is completed we will be closer to adding more mobs to this wonderful game!
Title: Re: Will avatar have to be altered for animation
Post by: RXZ x REPLAYZz on November 27, 2013, 10:26:33 AM
It would be possible to allow players to customize the thickness of the cuboids, and possibly the length to a small degree.
Pretty much. It's absolutely the most efficient way to have bone animated avatars. Which is why MC can handle hundreds of animals running around, and mods like toy soldiers.
off topic but will we ever be able to make our own avatars?
Title: Re: Will avatar have to be altered for animation
Post by: Not Actually Atlas on November 27, 2013, 11:46:27 AM
Will the avatars retain their shape? Or will they be a collection of blocks like mc?
Title: Re: Will avatar have to be altered for animation
Post by: Clerical on November 28, 2013, 07:11:10 AM
Will the avatars retain their shape? Or will they be a collection of blocks like mc?
Been mentioned above, we'll have MC style avatars because how efficient they are, means we can have a lot more of them including mobs.
Title: Re: Will avatar have to be altered for animation
Post by: Clerical on November 28, 2013, 07:14:16 AM
off topic but will we ever be able to make our own avatars?
expect it will be like how it is now, make a model in game/ on a computer and send craig details on it, if he likes it can get added, but has a lot of rules, i doubt we can have in-game editor to customize them, also they would kinda defeat the purpose of unlockables if you can make them all XD.
Title: Re: Will avatar have to be altered for animation
Post by: Not Actually Atlas on November 28, 2013, 12:07:48 PM
Been mentioned above, we'll have MC style avatars because how efficient they are, means we can have a lot more of them including mobs.
I just we don't end up having skins like those. Look at how bad the ones on the 360 edition are. 3/4 of them you can't tell who or what they are supposed to be.