How do video games render different equipment on players?

Started by
3 comments, last by NEXUSKill 11 years, 9 months ago
how do games such as RPG games show the characters wearing different equipment? do they have a separate image for a character wearing all the different combinations of equipment or is the equipment just an overlay that's stuck on to the character and moves along with him?
Advertisement
There are different methods and often a combination of them is used.
1. Simple: change the texture color of different equipment (gold chainmail, iron chainmail etc.)
2. More adv.: change the whole texture to represent different materials.
3. Model: link new model to the character, often used for weapons, it can be expanded for most hard equipment like helms, breastplate etc. The original model have often special bones to which the additional equipment are attached to.
4. Diff. Models: overlaying models often introduce artifacts (intersecting models, animation artifacts etc.), therefore different body parts, wearing different armor can be modelled seperatly and combined in the engine. This is quite limited and expensive, but have the best quality.
It would help if you specified whether you are refering to 2d or 3d games. Ashaman has already given a basic explaination of how different equipment is done in 3d games (which I know nothing about), so I will attempt to offer some insight on the 2d way of doing it. Keeping seperate images of for each character with each equipment variation would require a rediculous number of files and hard drive space, not to mention managing them all in your code. I would say overlays are the way to go. However, if you are going to be rendering a lot of characters with variable equipment, especially at higher resolution, it could start to slow down your game. I think the solution in this case is to perfrom the overlays only at load time or when equipment is changed then store the resulting image so that it can be drawn at render time without dealing with the overlays. Idealy you would have an entire sprite sheet for the character and for each item you would have a sprite sheet that would overlay onto the character's. After overlaying all of the equipment and storing the resulting image, your game would only have to draw the character's sprite like it normally would.
I have a few different main character models that I use. 1) Entire nude body 2) Head, neck, hands 3) entire torso 4) etc

I overlay the different items and load up the new mesh that is appropriate. As Ashaman stated above, if you overlay with the complete nude body, you will have the mesh underneath poking through. (It also saves on resources as the head, neck, hands mesh has way fewer vertices.)

Each item of clothing I have has a property that tells the game which character mesh to load when it is equipped.
Usually the goal is to render the least stuff possible, regardless of whether you are in 2D or 3D.
If gear is by slot and free to combine, lets say like Skyrim or diablo, the the usual way to do it is to cut your avatar in parts that will be occupied by the main gear pieces, say (to keep it simple) head, torso, legs and arms. If the player puts on a chestpiece, you completely replace the avatar's torso with another model that reprecents that chestpiece.
If the item doesn't cover the entire body, thats still part of the Item's model (keeping in mind that if you can have different skin colors, the revealed parts of the item must also be properly colored)

In the case of the head, some helmets reveal the face partially, others cover it completely, hair is most usually covered, so you may find it usefull to have a full head model, a full helmet model and a combination of face model with a partially covering helmet.

Same works for 2D
Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


This topic is closed to new replies.

Advertisement