Sign in to follow this  
SerhiyOtroshchenko

[Isometric RPG] plit body to pieces and display shield, boots, head and weapon independently

Recommended Posts

Hi,

I'd have next equipment in isometric game:<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">[list][*]20 boots[*]20 hats[*]20 shields[*]30 weapons[/list]

And if I'll generate all possible combinations for character it will take VERY MUCH size.

What do you think if to split body to pieces and display shield, boots, head and weapon independently.

Do you know such technique?
If yes please provide more info or URL how to do it correctly.

Thank you in advance.

Share this post


Link to post
Share on other sites
JTippetts    12949
This task is dead easy if your characters are 3D, and fairly difficult if they are 2D. In 3D, you just model each component separately, then attach the components to different bones in the skeleton. Doing the job in 2D requires a complex layering system, wherein each little piece needs to be assigned a layer in the drawing order so that they are drawn correctly. Now, to add a wrinkle, you can't assign this depth based on the component type alone. You also have to take into account player orientation. For example, a sword; when the player is walking to the left with his sword in his right hand, the sword is partly obscured by the body. But when the player is walking to the right, the sword is fully visible. I believe it was sticky little issues like this that prompted Blizzard, in their Diablo 2 [url="http://www.gamasutra.com/view/feature/3124/postmortem_blizzards_diablo_ii.php"]post-mortem[/url], to say that Diablo 2 would probably be their last 2D game.

If you want to increase your graphics requirements, you could implement it as a shader-based system, where each component of the final sprite stores a depth map for itself usable by the shader to draw the sprite. However, this does drastically increase the minimum spec of the graphics card, and might baffle and annoy users with older hardware who wonder why a simple 2D game won't run on their machine.

Share this post


Link to post
Share on other sites
Thanks for reply.
The problem is that graphics style in the game should be as in dofus: www.dofus.com

Here is an example how should looks a character: [url="http://staticns.ankama.com/comm/misc/NEWS/dofus/turns_feca.jpg"]http://staticns.anka.../turns_feca.jpg[/url]

Share this post


Link to post
Share on other sites
NetGnome    773
Like J said, you can just assign a depth value to each piece... well.. since its isometric, you would need maybe 2 values (1 front-back, 1 left-right). Then depending on perspective, you change your sort paremeters to read front-back or back-front or left-right or right-left. Through a min-max calc and possibly a draw "stack" array, you can make this somewhat efficient and have this done in the viewport update change cycle or character rotate update cycle so its not done every frame but only when the depth info would need to be modified. The draw part is easy, as you just loop through the "stack" array drawing the items in their determined order.

This also allows you to apply additional motion "jitter" to each piece without affecting their view-oriented depth sort to give it some cool idle motion like Breath of Fire 4 or some of the newer Japanese Sprite games like Islands of Wakfu.

Share this post


Link to post
Share on other sites
Katie    2244
Does your platform conveniently support a depth buffer?

(I'm thinking if you're doing 2D rendering in OpenGL say)

If so you could paint depth onto the image parts (in one of the channels, say) and your rendering (although 2D) could use the depth information to do pixel culling. That way you don't have to worry which order you display the images in and it doesn't matter if they overlap in depth.

Share this post


Link to post
Share on other sites
Konidias    214
For my game I'm using 2D sprites created with 3D renders. The characters are comprised of many layers for clothing and weapons, etc... My technique is to render the clothing pieces using the character's body as a matte object. Which means all of the clothing should appear exactly as it should, and only the visible parts of the clothing will be rendered to the image. There are still issues with this method, where certain pieces need to be moved behind others, but this can be done just setting these to different layers when needed.

One of the bigger issues with 2D sprites and layering happens when you need the character to raise their hands over their head, or anything extreme like that... Because it can really mess with the layering of things. Typically you would draw the head over the hands in most situations, but if the hands are brought over the face, the hands need to draw over the head. So that's why you'd need to have custom script that will resort the layers during runtime.

Share this post


Link to post
Share on other sites
O-san    1898
I've tried updating my characters equipment only when its needed. That is when the player changes gear or something gets broken. I'll bake the different pieces together so I only have one sheet. I tried doing it using freeimage but it proved that the library was not capable of the operation. Now I am instead going to try to render the pieces in the correct order. What am I saying? Be sure you have the right tools when doing pre-baking, it helps ;)

Share this post


Link to post
Share on other sites
evillive2    779
Think of it like Mr. Potato Head - the pieces have a tab and the body has slots for the tabs in different positions. In 2d gamespace it takes some effort but essentially you define anchor points on the character sprites for each "class" or type of item and each item has an anchor point or "tab" and a specific "slot" it belongs in on the character. Drawing order is key but essentially keeping it simple is the idea however the amount of art required to do this can be staggering considering each item needs at least (if not more) 1 image per direction the character is facing. In many old NES games (Final Fantasy and other RPGs were big on this) the same art was used but different pallets allowed for the same art to be shown in up to 8 different colors - today similar concepts can be achieved with colorkeys and alpha masks to update characters when needed.

Take a look at the [url="http://charas-project.net/"]charas project[/url] which does the Mr. Potato Head technique in a fashion to generate character sprite sheets.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this