Jump to content
  • Advertisement
Sign in to follow this  
endless11111

How do video games render different equipment on players?

This topic is 2345 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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. Edited by RedBaron5

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!