Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Possible Duplicate:
Which is the best approach to make a 2D character to be able to use tons of different equipments when in action?

I'm developing a 2d isometric game (typical Tolkien RPG) and wondering how to handle character/equipment combinations. So for example, the player wears leather boots with chain-mail and a wooden shield and a sword - but then picks up plate-armour instead of chain-mail.

I'm using Blender3D to create objects, environments and characters in 3D, then a script runs to render all 3D meshes into 2D orthographic tile maps. So I can use this script to create all the combinations of character equipment for me, but there would be an explosion in terms of the combinations required.

share|improve this question
    
As you are pre-rendering everything... why worry how many combinations there are? If you do them in sets, you won't have to re-render everything every time, only subsets. This is dev-time stuff, I wouldn't sweat it. Just pick up a cheap second-hand PC or two to act as a little render farm, if you're solo. –  Nick Wiggill Oct 28 '12 at 14:18
add comment

marked as duplicate by Byte56, Tetrad Oct 29 '12 at 15:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 3 down vote accepted

Most 2d games solve this problem with the "paperdoll" technique.

You create a spriteset for the "naked" player character (you might want to add underwear to avoid nudity), and you create separate spritesets for all boots, shirts, pants, headgears etc. These equipment spritesets only contains the item itself, nothing else. When the player character is drawn, all the sprites are drawn on top of each other in a predetermined order.

So you first draw the naked character, then its boots over the naked sprite, then its pants, then its shirt and then its helmet.

When performance is a concern, you can optimize it by caching the appearance of all the sprites over each other until the equipment changes.

share|improve this answer
    
A good example is Hack, Slash, Crawl on Kongregate. –  Nick Wiggill Oct 28 '12 at 14:12
    
Doesn't Diablo 2 use this technique? –  Markus von Broady Oct 28 '12 at 14:28
    
@Markus Yep, the game I mentioned is just a cheap Diablo clone :) –  Nick Wiggill Oct 28 '12 at 14:47
    
Some good answers here thanks. Can't quite get my head around the ordering though when it comes to the weapon rendering. If the character swings their weapon in such a way that their body obscures part of the weapon, the paperdoll technique would break wouldn't it? –  JimFing Oct 28 '12 at 14:53
    
@JimFing You'd need to use multiple layers -- probably easiest to model as multiple paperdolls. –  dhasenan Oct 28 '12 at 15:12
show 1 more comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.