- Home /
Best way to format characters/models in game?
Hi all
I just have a few questions on the best practices to employ while making characters and models for a game. Mainly one that would be RPG type.
How is the best way to make them? Lets imagine for the sake of the example that there are 3 separate races in the game.
EXAMPLE: 3 separate bodies- One for each race, and say, 5 different heads for each race, then you would just pick and choose to make characters and NPCs individual. Choose from different skin textures. Armor and clothing is also made separate and can just be placed with the character model.
Would this be too CPU intensive, loading all these different models and textures??
Before I start modelling characters and NPCs for the game, I need to know the best way to do it. How do modern game companies go about this without slowing down the game too much?
Thanks guys!
EDIT: By the way I am not the programmer for this project, only the 3D modeller and texturer. I have no experience with scripting - So please be gentle and try to keep it simple if you need to mention it :) Thank you
Answer by whydoidoit · Oct 06, 2012 at 05:16 PM
The number of textures used has an significant impact on the performance as what would normally happen would be that you would combine together all of the active meshes that use a single material reducing the number of draw calls that are needed to render out the model. So even though you have 20 pieces, once configured your programmer might be able to combine them into much fewer pieces that share the same material.
It might be worth looking at these videos for an asset store asset that does some of this combining for its purpose.
It might be possible to automatically atlas (combine) the textures from multiple parts into one but you will always have problems if you are using a shader property to affect the color(s) of something and those colors differ from part to part.
Really the loading isn't the problem - it's the number of different ones on the screen at the same time. Unity will hopefully dynamically batch calls to draw the same meshes and materials so it's hard to exactly predict.
This script from the Wiki could be used to combine together the multiple parts after configuration.
Hi, Thanks for your response. So if I understand correctly, you are saying that I should create each part individually and then the programmer will combine all the parts sharing the same material when it comes to rendering them on the screen? Consider a game such as Skyrim- It appears that they have separate head and body meshes, heads are interchangeable for differently shaped heads, and they use color and texture overlays for skin color and details, with a separate mesh for hair. So would they be combining all the texture overlays (scars, marks and skin color overlay) to the main skin texture, and combining the head and the body, at rendering? Is this a good way to go about it?
Yes, build bits, combine at runtime.
So yes - multiple heads is a good idea (those videos show an interesting point about hair BTW, making the top/sides/front/back different meshes gives a lot of variety).
As for scars etc - this is where it gets more tricky. You could use a shader that has multiple textures (and hence multiple UVs) so you can modify the scar textures differently from the skin textures etc.
Combining all of those things into 1 texture at runtime is almost definitely going to be bad for performance because it will probably be different for every character, lots of draw calls and lots of loading things to the graphics card - you need to $$anonymous$$imise the number of textures at runtime too. Now here we are at the edge of my knowledge really - I don't know whether the multiple texture shader is going to be bad for performance because I've never done that. If you are going to have lots of these details then I imagine multiple texture shaders is the way to go.
You should also consider making multiple LOD levels - I'm guessing skin details don't matter much for a character that isn't right in the middle of the screen. You can basically make multiple LOD models and name them xxx_lod_0 etc and then the programmer can create a LOD group and that will certainly improve performance.
$$anonymous$$ost of this makes sense but you lost me at multiple texture shaders and LOD levels ;) The videos you linked certainly were interesting. Very ugly, $$anonymous$$d you, but interesting nonetheless. I'll pass on this info to the programmer and see what he thinks... However I can't imagine how that would work with rigging and animation. If I didn't combine the head and body it would be easy enough to just have the full character rig and parent the head to the head bone at runtime. But if these were combined that would make things complicated, would it not? Thoughts?
Agreed - they aren't the prettiest models in the world :) But the tech is sound.
O$$anonymous$$ so multiple Levels Of Detail (LOD) basically you make more than one version of the model at decreasing numbers of quads/detail - then Unity moves between them as the camera approaches or moves away from each of the models in the world. The performance gets better because you don't need all of those polygons when the thing is 30 pixels high in the distance.
$$anonymous$$ultiple textures - so you build your models, unwrap the UVs and paint the character for the base as normal. Then you might make a texture that contained a whole bunch of scars, marks, tattoos or whatever and you map those onto the model using a different set of UVs.
Aaahhh... Gotcha. Both of these things sound like great ideas. I'll check out how multiple texture shaders go performance-wise.
Thanks for your help, I appreciate it a lot (a lot a lot). I am still trying to understand how all these things work inside a game engine as I've only ever created 3D models for purely artistic purposes. Any thoughts on the rigging?
Your answer
Follow this Question
Related Questions
Third Person type Rpg movement 0 Answers
multiple models same animation 1 Answer
animating a character model 0 Answers
Basic Movement on a Plane without Character Controller 2 Answers
Best program for 3D characters? 1 Answer