I have a couple of questions surround the generation of unique characters in engine. At the moment I need to understand the high concept processes.
How would I go about spawning randomly generated characters in engine? I understand the concept but I don’t know how to perform it in engine.
For example how would I set up masks to randomize the colour of certain pieces?
How could I set up modular pieces like the torso, head ect then attach those back to something like a bone system?
For customizable colors, you could do something like this: (this is for each model)
Create a texture that define the area where color can be changed. Since a texture has 4 channels, you can have upto 4 custom colorable parts per model. The values range between 0 to 255 for each channel (I usually use 255 for colorable area and 0 for masked area).
Create a material like usual. Create 4 Vector4 params (1 for each colorable part).
Add the texture we created for this model into the material. Multiply each channel with the corresponding Vector4 param.
Add the results of these multiplication togethor (you can have weights and other fancy stuff instead of simple addition).
Calculate the diffuse. emissive…as usual.
Add the result we got from the addittion to the calculated diffuse.
Feed it as the diffuse input for the material.
Go ahead a create a material instance from this materil and apply it to your mesh. Now you can change the 4 params from within c++ or blueprint to change the custom color of the parts.
The above method is very basic, but you can extend upton it (for instance custom emissive). I usually use the first 3 channels for custom colors and Alpha channel for emissive.