[tutorial] Modular character what is it and how to asemble it inside unreal engine
hello, ladies and gentlemans!!!, i'm here again with one more of mine boring and no to so liked/wanted tutorials , i know how i'm wasting some peoples time... playing violin..., however i don't care and gonna do it anyway, because i like it!!! and maybe even if is a single soul which i can be helpfull then i'm happy!!!!
now it's time for "modularity or modular characters, what is it?? why i must use and how i can do that???, now let's answer the questions!!!!
modularity or being modular in game dev or even maybe 3d space means being flexible or something which you can "modify or customize, normally they come "in parts" instead of a single regular mesh they come cut into small meshs to be assembled be in game or even outside games like in pograms like even daz, yeah!!!! daz character are "modular characters" because you have a base mesh which in this case is the body mesh and you can assemble into it stuffs like outfits, hairs, and other things, inside daz making the character very customizable even adding "extra parts" or it.
modular character are character where you can change parts of it to generate many types of characters a good exemple is the new epic meta human, here some others exemples
https://unrealengine.com/marketplace/en-US/product/ghost-lady-s4-the-hunters
they are parts to be assembled in a single skeleton inside unreal, now which i better understand about what it is now let's go to "why i must use?
well modular characters works better when you are planning to create "customization" systems to your character making the same character wearing multiple costumes without have to model it over and over for each outfit, you have 2 ways to do it, one is creating the base character like in daz then just model outfits, hairs and others extras and rigging it to the character, this is the "most simple" and possible most realistic way to do, however this one is also one of the most troublesome ones and less used in market for 2 reasons:
1 - polycount: as we know the more polygons and textures to load the more heavy is to load too which means for exemple you have the genesis 8 character base it alone have 34k tris(let's use triangles for now), alone it's not that much, but let's add a shirt with 20k tris, well still 54k tirs, so far soo good, let's now add more 30k from the jeans it's go 84k, don't forget the hair then let's throw more 50k tris for the hairs, now it's 134k tris, well don't forget the shows, let's throw here more 40k going to a total of 174k however if we are going for realism don't forget the underwear like if a woman a bra and a pantie, let's ending this play and say which the character ending being like 220k tris, which on quads would be around 120k and for vertices also would be around that, well a character with only 120k don't look so bad, ok let's start to throw "multiple 120k characters in the scene and remember it's 120k if all were wearing the same stuff now imagine each one have they own outfits, ofcourse some will have less others more, but the idea is which you are adding "more polygons overtime and the worst part "some of those polygons are techincally "hidden" like underwear and even the character skin, you are forcing the engine to render something which no one is seeying at real time, while again for still render many peoples would ignore it, even daz will engine will "not ignore it" he will not act as if those polygons don't exist if you don't tell him to do it (by editing mesh and hidden the not visible polygons) and make the render timer a little big than if those "extra polygons where not there or where invisible.
when you are using a full body and only exporting outfits and not cuting the body in pieces you have only one way to deal with it which is creating a texture mask to hidden the texture where the polygons are not being visible and making some configuration in the master material to use this mask texture whenever the character is using this outfit, then it will "hidden those parts" but still not a perfect fix but better than nothing
2 - is the "poke-through" away is when the mesh inside appear over the mesh outside, or like when for exemple you enlarge the breast of a female character and the outfits don't have enough polygons or form to cover it then her breast start to appear throught the outfit, some outfits in daz come with some "fix" like morphs will try to cover for it or the character itself can be edited to fix it well, you also have others ways like increasing the poly count of the outfit with a smooth" inside unreal however while can work in most of the times inside unreal and in a "still frame" render" in game or to be more precise "in animation" most of the timesit don't work perfect, let's get for exemple a single walk animation in many cases it's have like 15 or 30 frames or something like that, then imagine for each frame for each deforme the character mesh get it have a chance to generate a poke" issue, then again while daz provides some tools to try to fix or band aid it and it can work in some animations probably you gonna reach a point where it not gonna work, specially if the character have "too mcuh" layers of stuffs like outfit, like using a jacket with a shirt with a bra + character itself skin, now imagine you have to deal with each piece of cloth to make sure it proper work, imagine the nightmare, the poke also can be "band-aid by the "mask fix by creating "opacity masks where the parts which are normally not visible to be "invisible inside the unreal which will be some annoying work but the results are better than nothing.
now the second way to go modular and the most common is breaking the characfer in multiple parts as the exemples i showed early or even here:
https://www.daz3d.com/forums/discussion/comment/5174496/#Comment_5174496
normally you break the character into 5 pieces: head, torso, hands legs and feets since daz character uv is split in a different way all of those pieces if not all will ending having more than 1 material not just head, for exemple torso is torso plus arms but its not a deal and it's not any deal in the end, now in case you want to make the number of materials more accurace with daz then you will use daz way to break the uvs which honestly will not be good because daz torso goes from up to down(hip, butt and croach) it's bad because you not gonna be able to split shirts and shorts in 2 pieces since the body will be full unless you use the trick of opacity to fix it which will be a even more troublesome job, then stick just with the original idea.
by spliting the character in pieces is more easy to export the character, because now you are able to work "piece to piece of cloth when exporting to unreal, you just have to do teh same proces as i did the post i linked early and remove the "parts which will be "inside" the outfit and export that "torso with the outfit direct to daz, it will make the poke-through never happens and reduce the poly count, making this more "light" a alternative would be if you don't want to "remove the skin" is use the opacity mask trick", it will make it invisible without break the original mesh, the only issue is which the "mesh still there" and any render issue your game could have as a bug would have a chance to make it appear even if for few seconds, when rendering or when loading and render times are too big.
the only issue of delete meshs or make then "invisible" is which "some outfits having a "transparence effect" where you can see the skin throught it, then on those cases you would really need to have it to not be removed or invisible and be inside of the outfit or in some extreme cases you could want to "paint the skin" on the outfit uv however it would lead to another more complex issues which i don't want to dea and neither be the focus here.
now which we learn about the modular and why we would want to use it now it's time to see how to work with it inside unreal, ok to make things more easy and fast and since this is not a video and a post i will split it into 2 the main post and a reply in the reply we will learn how to assemble the character in the character bp, well before that, this tutorial is taking in account which you already know how to setup or at last edit the base character BP which come with unreal or know how to create your own, if you have 0 knowledge about character blueprint then go to youtube and look for some tutorial about character bp, don't need to be a complex one, at last one which teach you the base to create or at last edit the already existing character bp to add your own character, some steps here really already need you to have this base of knowledge, i will post a little later the second part.
see you later.
any question feel free to ask.
Comments
hello let's finish this, now let's go to the fun, we already know enough about modular now is time to apply. to make things fast and simple as possible i will be using the full body and exporting just the outftis, since i've already showed a exemple of how to export in pieces in another topic and how to "remove the skin under the outfit to make things goes fast here let's just do the basic, then again i will be using the full body and "cloths as pieces of the body, don't really matter how you want to do for the assemble in the end the way to assemble is the same then let's go, i will use genesis 8 female clay body, i also to avoid complicated matter will be using the most simple and easy outfits no high heels!!!!
no brows nothing more i will export her as she is currently, and to make stuffs more fast no morphs or high resolution or texture it will make the export process much more fast.
here the character in unreal
let's do the "retarget:
https://www.daz3d.com/forums/discussion/491596/tutorial-retargeting-animations-inside-unreal-to-daz-characters
now let's export some outfits
go back to daz and choose the outfits you want to export and load it
now instead of click again in the character then export, we gonna in the scene panel be clicking on each piece of the outfit alone, first boots
then with boots selected we gonna use the bridge to send it, it will only export the boot with the proper skeletal mesh
here the boot exported
now we gonna do the same for all the others parts, after all the parts are exported it's finally time... finally i can say that!!!!
it's time for "avenges assemble!!!!!!!!!!!!!!!!!!!
and to make things more fast let's just create a copy of the third person character bp, just select the character bp right click and duplicate as here:
ok this is not the third person character bp, because i've created a top down template then this one is the top down, however don't worry about it, it don't matter for what we are doing, now open the character bp
in case you are not seeying the character here click in the viewport it will show the character in the idle animation, now let's start first you gonna look at components look at mesh then click on it
after that you gonna notice on the other side of the widow which the options changed, those are the options for the mesh component, then in those options in the "mesh tab you will see skeletal mesh and the image of the mannequin mesh you gonna click in the SK_mannequin then it will appear for you choose others skeletal meshs looks for the mesh you just exported and and choose it
then you will notice which some stuffs happened here, not only the character in the viewport changed but he is not animated it's because we need to setup the animation bluprint here for it to use, then you gonna look to the "animation" in the same side where the skeletal mesh was then you gonna look for Anim Class, it will be none, then you will click and choose the animation BP you created/duplicated with all the animations in previos steps
after that you gonna see the character moving again
now let's go to the trick step by step
1 - while the mesh in component still selected in the left panel now we gonna click on the +add componenent buttom, then in search you gonna type "skeletal mesh" it will appear for you to choose then choose it(choose the rendering one in case appear more than one) then a "new skeletal mesh under the main mesh will be created you can rename it, i will do rename it to shirt is really important make sure it follow the hierarchy here, in case it is not under the skeletal mesh as part of it then you gonna click on it and drag/move to the main mesh to make it under the hierarchy like that:
, now after that we gonna go back to the right side and add a "mesh" for this new skeletal mesh then go to the skeletal mesh in the right side and now let's choose the top/shirt of the outfit and apply it
you will notice the top appeared but it's not moving(for some weird reason the top texture not got exported but we gonna ignore it because it don't matter here), don't worry about we gonna fix it later, now basically do the same for the remain aways make sure they are under the main mesh, they don't need be under each other like a ladder but they do need to be attached to the main skeleton for sure, also they don't need to follow a "specific order here, you can add in any order you want again the only thing which matter is they being under the main mesh
now after you apply all the parts you want it's gonna looks something like that:
2 - now you gonna change from the viewport to the contruction script, it also can be done on the event graph but i see peoples using more the construction then use the construction, clikc on it with the mesh still selected on the components, the widow of view will change to that
i would advice you click on compile and sabe buttoms, and constantly save and compile or whenver you do something or after do few things, we never know when something bad can happen and you don't want to restart from the 0
3 - in the contruction script you gonna again do a single click on the main mesh in the mesh component in the left side of the panel you gonna click and drag it to this construction script like this:
now you gonna select all the others remains meshes, you can select and drag all together if you want
now finally the final step you goona click on the blue main mesh then you gonna click on the "pin", you will click and hold and move around as you move you notice a line going from it then after move a little until a empty area you gonna release the buttom then a little window will appear then in the "search you gonna type "master then will appear for you to choose a "f or function saying f set master pose component you will click on it then a new component will appear in the blue print
now while holding alt buttom you gonna left click in one of the pins in the link between the mesh and the master pose, it will "break it like that:
now you gonna link all the "outftis to the same pin as the main mesh was linked before and will link the mesh to the "new master bone component just like that:
now to finish it you gonna pin the construction script pin in purple to the "white pin in the master pose component like that:
now compile and save all the go back to the viewport and
tadah the outfit is proper following the character in the animation, in case it still not proper following you will go back the the script and will mark the option "force update" in red, mark here and compile and save.
now you can drop the character bp in the game
and whenever you want or need to change a part just select the mesh in the component you want to change and the right side on the skeletal mesh choose the "new part you want do add", it only work as long all the parts share the same skeletal mesh it don't work with different skeletons, it's also the base to create a character customization (which i do not know how to do), you use this master component and those "meshes" to create the system which again is another very complicated story.
srry for the long delay and hope peoples enjoy this tutorial and can learn to do more stuffs and maybe how to make a customization and be a nice soul to share it .
have a nice week and have fun.