Jump to content
  • Advertisement
Sign in to follow this  
sminded

Using 3D models in a 2D-game. Rigging/Equipping/Lighting

This topic is 3771 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

I'm working on a framework for 2d character animation/movement for a 2D rpg game. After some research I've come up with the following procedure to create content for this framework: * Use Poser with an out-of-the-box model (currently I'm using Apollo Maximus) * Import mocap files (modded using bvhacker) into Poser to get decent motions * Export the animation as a movie with Poser to separate png-files (one for each frame) * Create a spritesheet for the animation using the exported png:s and WindAnimator Next problem is that I want to be able to equip my characters in-game with different weapons, boots, pants, shirts etc etc. It would be too much work and take up to much space to have all possible combination's of animations so I have to come up with some way to rig/equip my characters in-game. This is true for both the Hero and the NPC:s, as I want to use one NPC class for many different opponents, with variance in skin color, weapons etc. So my idea is to make animations for walking with a "nude" character, this will be one animation for each walking directions, in my case 4. Then I will create similar animations for each prop/item that can be equipped, including the body itself (different skin colors). One problem that I have not solved yet is that each class of prop will have different Z-ordering depending on which direction the character is facing, and for many props like the necklace for example there will be no exact z-ordering. Is this kind of equipping not used normally in 2D-games? I can guess it would be much easier to accomplish in a 3D-environment. I would appreciate any thoughts on my way of tackling this or 2D character animation / rigging in general. Another problem I have not yet to tackle is lighting. If anyone have ideas/ pointers on this area feel free to include them in this thread as well.

Share this post


Link to post
Share on other sites
Advertisement
One problem you'll be hit with is edges. If the layers edges don't use a form of blending and transparency, you'll have color problems with the layer below. If you do use transparency along the rims in order to get a good color-- you're probably going to use 3D rendering for the performance gain. If you wanted good 2D gains, you'll need to either:
1 - Prerender every combination of equipment or
2 - Render those sprites 'on the fly' every time there's a change in character appearance.

If you're at this point and didn't pick #2 above, it's my opinion that there's no real gain to using '2D'. Restricting everything to a 2D plane, but render 3D w/fixed camera seems like it would 'look better'.

______

Lighting can be tough if you go the actual 2D way and you want dynamic. One trick you may be able to do is create grey-scale masks for 4 or 8 directions per silhouette sprite frame, and use that to determine the amount of 'lighting' depending the lightsource direction (since most lightsources will be at about the same height.

Can use an additive version for between-maps too (say you only have one for up and right, but light is to the up-right. Combine the two on the fly and use that for the degree of light effect.

Maybe even have different masks depending on material light (so that metal would shine brighter and more 'focused' at the peaks, for example)

Share this post


Link to post
Share on other sites
Thanks for your post necreia.

Do you mean that my 2d textures making up the character animations will not blend well with the sprite tiles making up the ground etc? Or the items not blending well with the rest of the body when combined in-game?

My plan is to pre-render everything in Poser, so what I have is pre-rendered spritesheets, one for each animation.
Using this route I would end up with the following example for animations:

hero-pale-male-attack-sword-north
hero-pale-male-attack-sword-east
hero-pale-male-attack-sword-south
hero-pale-male-attack-sword-west

The above would be a male with pale-colored skin doing his attacking stance for weapon class sword, which would be used for short-sword and some other weapons. But he has no clothes, and no weapon in hand.

Then there will be:

weapon-rustyshortsword-attack-north
...
clothing-scalemail-attack-north
...

So I have to make/render animations for each type of skin and action (walk, attack, block, pick up etc) and weapon type (axe, dagger, shortsword, sword, shield).
And for each prop/item/clothing/weapon I would make animations for each action, but these animations will only have the actual prop/item/clothing or weapon visible.
This way I'm hoping I can combine the different animations (2d Textures) in-game (or maybe at startup if needed to save time).
But I'm hoping I don't have to make all combinations of animations - in that case it would probably be better to either not have so many different combinations (so it would be feasible to pre-render all together) or have the character framework using a 3d-engine.

How is this done generally in 2D RPG:s? Isn't NWN a 2d-game (iso) with 3d-characters? And still you could equip your characters with different weapons etc.

Share this post


Link to post
Share on other sites
Quote:
Original post by sminded
Do you mean that my 2d textures making up the character animations will not blend well with the sprite tiles making up the ground etc? Or the items not blending well with the rest of the body when combined in-game?
...



Both. If you pre-render all equipment combinations as I think you suggest you'll be fine, but that's a limited approach as it requires large pre-generated resources. If you don't outline all layers with a thick neutral color (black or grey), you'll have to do some additive operations to the descendant layer. Looks like you've throught about all this though so it's not of much concern.

From what I've seen, true 2D RPG's based on 3D renders use two methods:
- Armor's have types (think Diablo2, where the Sorc may have "Heavy Armor Gold Plate" graphic for a dozen or so armors) and all those segments have think/solid lines so no alpha-sharing is needed.
- 3D "Like" games use layers of textures rendered on billboards with a fixed top-camera (or piled on the same billboard/plane.

Overall, you've got the right mindset and approach.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!