Customizing Game Characters

  • I want to preface this post saying, the following post is less about creating the assets and artwork in blender, maya, max, etc and adding them into a jme3 scene.… and more about the techniques of organizing and programming the assets for the intended effect*

    I began looking for information on in-game configurable game characters such as avatars. To start with, I’d really like to just be able to change the color/texture of my character’s clothes. I’ve found some prior posts referencing the following links, but they seem to be out of date. Did they get moved/rewritten?

    In thinking through the problem (configurable characters, that is) I’ve come up with 2 general techniques:

  1. Create one mesh with fragmented texture images and swap the textures as if the character had different clothes
  2. Create many meshes (body parts) with specific textures mapped and swap out the meshes on demand.

    Are there other ways to go about doing this? Is there a preferred or recommended way?

    As an aside, I’ve tried googling and stackoverflowing this topic to no avail. Perhaps I’m entering the wrong keywords, but I’m feeling like each developer makes it up as they go along or there is a technique that is so common knowledge that it is silly to document it online. Have others had better luck?

SHADERS is a keyword for you :wink:

you know basic of fragment shader = you know how to do it.

then just change texture in material → it will recompile shader and change texture / fragment of color on texture or other blending / etc.

there is other way, using TexturePainter or similar class, but it work slooower.

about cashing, after load asset, AssetManager Cashe this asset :wink: so you can prepare “parts” and just replace them.

anyway, i have done what you want to do, so it is possible.

This is a huge subject, and one that many AAA games studios are still refining their approach too.

This is all just off the top of my head but essentially you have 4 possibilities, with vary level of difficulty/work involved. From easiest to hardest these are:

  1. Use a custom shader to change the colour of clothes etc.
  2. Swap in custom textures for various parts of the model.
  3. Have 3 or 4 models with different clothes combinations combined with 1 and/or 2.
  4. Have the person + the various items all be separate geometries and combine them

    4.a Rigid geometry (sword/shield/hat/some armour) is easy

    4.b Non-rigid geometry is much harder

    Start to think about the complexity of for example putting a robe over a character and having them walk and the robe deforming naturally around their legs as they move…without the leg ever sticking through the robe or vica versa.

    You then put boots on the characters feet and now the complexity gets one step worse as you need to have the feet inside the boots, boots outside feet, but inside robe…now add some baggy trousers as well and it just gets horrible.