HeroEngine Forums

HeroEngine Support => Scripting & Programming => Topic started by: feredfn on Sep 07, 14, 12:57:53 AM

Title: What are best methods to make character's height adjustable
Post by: feredfn on Sep 07, 14, 12:57:53 AM
Hey guys,
I wanted to know what methods are best to make character's height adjustable by player on character creation..
The scale.y can do it, but I'm sure it's not the proper way,..  Let's say i want to let players be able to adjust their character's height from x minimum to y maximum amount.
Title: Re: What are best methods to make character's height adjustable
Post by: keeperofstars on Sep 07, 14, 06:38:46 PM
well you really have two options that work well.

Option 1.) Facegen
in this option you use the facegen technology. To so so you make 3 versions of the models, a min version, a default, and a max version. So for height lets say you make it .5m, 1m, and 1.5m
The Facegen technology then lets the player use sliders to pick the height. They have total control so you get things like .598m height. This is the most flexible but comes at a cost. To allow this to happen the character model for each variation has to get loaded. So if you had 100 players and all had some small height tweak you would have 100 unique character meshes having to be loaded into memory. This can get really expensive and cause GPU lag as you fill the GPU memory up.

Option 2.) Different height meshes / parts setup.
in this option you create a few set heights, for players to choose from. So you have lets say short, semi short, normal, tall. The players then toggle between them as their "base character" Then that drives what parts are available for them, when piecing together their mesh. So tall players will have "tall leg" options.
Overall this isn't much more modeling work than with facegen(morphing) as you still have to create the parts min, mid, and max. You just lose a small amount of in between variance. The big difference though is you can get lots of model in memory.

So if you have 100 people and 25 picked short, 25 picked normal, 25 picked tall, and 25 picked semi short. You only have 4 meshes loaded instead of 100. Since they are all the same and aren't unique. Now that would be some difference as which parts they pick etc could cause extra texture banks to be loaded, etc but the base mesh would get only shoved in 4 times. As you can see that could be a huge savings in GPU memory requirements. And the more memory you save here the better. Especially if you going for lots of players together.

So you say well I want to allow as many customizations as possible. That is a good wish / thought but it's not practical and players don't really care. A great case study is Guild Wars 2. They went full on part system and didn't provide facegen but did provide a few dozen parts / setting options that gave the appearance. But it gave them a set max value of models rendered. They then took it farther and limited the armor visibility / to all be done via about 7 sets. So no matter what armor words or such was they were of a certain "style" and that style cut the possible visible part types down drastically. At launch there was about 50 different possibilities at max. This meant limited base meshes loaded, limited texture banks loaded, and in most cases limited parts (more than usual as they were using tons of parts to build the customization) but parts in the same texture bank where all grouped, and guess what limited texture banks. Bam super efficient GPU memory loads. The appearance of lots of customizations even if little in the end. It was a great magic trick really. Cause player customizations where usually covered up with the stylized armor.

That is the 2nd part to remember. Most players going to cover their player up with gear. This means most customizations get covered up by the armor parts. So really bulk and height are your two main differences.

And both of them have another challenge, "hit box detection" if you have any hit box driven attack. aka not tab / auto target. Then players gravitate to picking the smallest thinnest options available. As they are hoping for a smaller hit box. Some games compete against this by building a set hit box that is the same shape for all players. This is easy to do with option 2, but becomes a much harder issue to deal with when using Facegen.

Well that is probably more information than needed, but wanted to know why I was going to say to pick option 2.

make a few set height variances, and have players pick from the set options.

Title: Re: What are best methods to make character's height adjustable
Post by: FI-ScottZ on Sep 07, 14, 07:45:41 PM
Fered, another option is that you can do what you suggested: adjust the character node scale.  What you would need to do is store with the character what the desired scale is, and then when the character is created on the client you can then set the scale of that node.

That approach would be the least complicated to work out, though you would still need to create a good interface for players to design the character height.
Title: Re: What are best methods to make character's height adjustable
Post by: feredfn on Sep 08, 14, 01:23:12 AM
Thank you for full answers :)

Dear Keeperofstars:
I also agree i don't really need to go with facegen tech just for this. i don't even want players can be able to slide their character height to get 4.23m etc.. instead i want to offer some more practical slots.. so I think i also pick the 2nd option.. while the scale.y is still another approach as well.. but things i want to know..

in Part system option :  what will happen to the bones?  let's say i have parts for tall version and short version of head,body, legs.. they require the skeleton also get scaled related to if it's now tall or now short.. is this possible? am i correct?
Or i basically need entire different dynamic characters for each single height slots?  and must consider them as new race.. like dwarves, humans and elves in many games where dwarves are smaller, humans are normal and elves are taller..

Dear Scott
in scale.y option : I have played with it, really easy to implement and save and load it.. but the reason is why i think it's not the proper way, is.. it shrink and stretch the mesh,.  if even we say the minimum and maximum amount will not be too much, but from artists views it looks odd.

Ty for helping me.
Title: Re: What are best methods to make character's height adjustable
Post by: WorldWideZ on Sep 08, 14, 01:47:51 AM
if you want it look right , i would scale the entire model not just Y axis.

Title: Re: What are best methods to make character's height adjustable
Post by: feredfn on Sep 08, 14, 09:05:47 AM
yep ty for reply, but you know that way i will have just bigger or smaller characters, but it's not the way i want to implement it:)
Title: Re: What are best methods to make character's height adjustable
Post by: keeperofstars on Sep 08, 14, 09:31:21 PM
You can scale the skeletal bones to match, which is something similar to the facegen piece. If there are drastic changes, remember you can get a lot of skeletal reuse via good skinning methods. Or just scale the skeletal mesh. Remember you can reuse the skeletal setup for multiple variations, etc. So it's not as big of a task as you might expect. Just some good technical art planning.

The only challenge you might get with the scale Y is skin stretching against bone weights during certain animations.

If the change is minimal then you should be ok.

Now the other aspect is the data load though, since each player will need to have the scale value assigned and maintained that means you are having to deal with passing that data and having the gpu process that before rendering on the other clients. I will admit I haven't dug into this in enough detail to put to much input, but from personal just thinking. It could add GPU load you might not want. But couldn't state that for sure.

Maybe a HE dev can be summonsed on that aspect.

*now where did i put that summons scroll" I know I had one around here some where.

Title: Re: What are best methods to make character's height adjustable
Post by: feredfn on Sep 09, 14, 12:28:42 AM
these information is valuable for me,.  but i must step into this process and find more clue in try and catch method.. plus i must see what adjustment range satisfy me, maybe it be a little amount and then it required less works ;)

If anytime i stepped into this, i will update here.