I’m planning on making a few car racing games for PC/Consoles & I’m not sure which route to go regarding all the different vehicle colours/Liveries.
I’m thinking my options are to make new texture sets for each vehicle or make a shader and mask areas of the texture so i can recolour them at runtime to any combination I’d like, but then for racing number and other decals, I’d still need to add another unique texture per car wouldn’t i?
Ideally I’d like the player to be able to choose colour combinations and decal/sponsor layouts. Am i best using texture masks for the colours or maybe vertex colours?
I’ve tried to find info on what the AAA studios do, but I can’t seem to find much info.
Basically, you can make multi-channel masks, sims 3 style.
See, for example here:
To get the idea of sims 3 system.
In this scenario, each channel will be treated as blend value for 3 (or 4) colors the texture supports.
For example, red will denote “Color #1”, green will denote “COlor #2”, blue will denote “Color #3”, the last one can be used for transparency or for color four.
This way the user will be able to recolor parts of the decal. If you go further, you could blend pbr materials, and not just colors.
The most flexible possible appraoch, however, is to assign a render texture to a car, as it will allow you to to projectile-paint anything you want on the car. I think “Redline” racing game used that, but it is fairly common, and I vaguelly recall something similar in Dirt.
Beware of players using that to paint obscenities, though.
One other thing about render texture is that this sort of data can be very compactly transferred during network play. Basically for a customized car you only need to store base color and position for every livery projector user utilized.
It depends on the game that you’re dealing with but believe it or not I’d almost accuse the AAA studios of being lazy when it comes to the customisation in their games. The reason you can’t find much info on what they do I suspect, is because there isn’t that much to it.
What you’re looking at for most customisation options offered by big companies is fancy art or models blended together, games like Rainbow Six Siege for example with the fancy looking skins are really just standard textures anyone can make and they’ve vomited over the standard gun models. @neginfinity has already gone into detail with how the textures are applied to the models but when it comes to the UI they literally just put a ton of colour buttons for you to click through and change the model with, nothing fancy whatsoever. Don’t be fooled by the glitsy art they try to distract you with, this is more game dev trickery.
It’s worth noting too that for Unity there is the decal system, it might be the perfect thing if you want to put spray tags or logos etc. on your in game vehicles and things like that. This is just a theory, but another thing they do I suspect to trick gamers is they don’t even really ‘apply’ new textures to the model they probably have multiple variants of the same model with different colour scemes and so on which they activate and then they load up that variant for when you’re in the game world. Now this will likely vary from game to game as maybe some of them might be a bit more advanced but there isn’t really much of an incentive for them to go beyond that. Hope this helps you get an idea of what is likely behind these systems, I kind of look down on them to be honest because of how much they hype these features up. I was talking off site with some people about it as well and they reckoned that a lot of customisation libraries are third party APIs on top of it. So they’re not even really coding these menus themselves.
Just because big games companies have done something first, doesn’t mean it’s necessarily a good idea to take inspiration from their mechanics or game features. This is one of the great freedoms that indie developers have compared to them.
“Team Colour” shaders or similar (allowing you to have 4 masks) will be the usual way to vary a lot of things on a mobile device. For a modern PC or console you will just use decals and new materials per car, layer it up like that. Much higher quality, easier and not particularly any bottleneck.
Cars are very optimisable creatures owing to the fact they aren’t skinned meshes.