D2/Baldur's Gate: how to implement base player + armor/weapons/e
by Jeff Weinstein · in General Discussion · 09/04/2001 (3:44 pm) · 14 replies
In D2/BG, you start out with what appears to be an animation of just
a plain old character walking around on screen. As you get different
armor and weapons, the on-screen character changes, in waht
appears to be a completely new animation. Now, I know that it's not
1 totally new animation, because that'd mean you'd have to generate player animations
for every single possible combination of armor and weapons and helmets/charms/etc:
in short it'd be impossible, or at the very least, time consuming and ridiculous.
I imagine the way it's done is that there's a base animation, and that perhaps
a separate animation is made for each item: something simple like just making the item
sway back and forth like the player does when he's standing, or antoher one for when
he's walking, or another one for when he's attacking. But that still seems like a lot of work.
I know it's got to be modular in some sort of way. And since this seems to be fairly commonplace,
I assume there's a general purpose,decent algorithm to accomplish the above.
That said, does anyone have any thought on how I'd implement such a system?
FWIW, I'm using C++ and DirectX, not that it should matter, since I'm just
looking for general algorithm help here. Thanks for your help =)
a plain old character walking around on screen. As you get different
armor and weapons, the on-screen character changes, in waht
appears to be a completely new animation. Now, I know that it's not
1 totally new animation, because that'd mean you'd have to generate player animations
for every single possible combination of armor and weapons and helmets/charms/etc:
in short it'd be impossible, or at the very least, time consuming and ridiculous.
I imagine the way it's done is that there's a base animation, and that perhaps
a separate animation is made for each item: something simple like just making the item
sway back and forth like the player does when he's standing, or antoher one for when
he's walking, or another one for when he's attacking. But that still seems like a lot of work.
I know it's got to be modular in some sort of way. And since this seems to be fairly commonplace,
I assume there's a general purpose,decent algorithm to accomplish the above.
That said, does anyone have any thought on how I'd implement such a system?
FWIW, I'm using C++ and DirectX, not that it should matter, since I'm just
looking for general algorithm help here. Thanks for your help =)
About the author
#2
That's all i can tell you because i don't quite understand your question.
09/04/2001 (6:41 pm)
Well, i don't know much about Direct-X , but i used to do some gfx programing under Dos.The algorithm u ask about is a simple animated sprite handler and the tough part comes when you make the sprites(ex:character ,armor)That's all i can tell you because i don't quite understand your question.
#3
I haven't played D2 or BG, so it could be that I just don't know enough about the effect you are referring to.
In a game like Asherons Call, there is an animated skeleton, and modeled parts are simply mounted onto the skeleton. To cut down on the number of animations which need to be created by the artists, males and females share the same animation skeleton; they simply have different body models.
If the character puts on a helmet, a helmet model is mounted at the head/neck mount-point, and it inherits the motions of the head/neck. It's just a matter of adding all the necessary mountpoints to your models and setting them up correctly.
Mounting models to mount-points is already fully supported in V12. Sharing skeletons between models may or may not be... I don't know. I would guess that it isn't.
09/04/2001 (7:15 pm)
Your question is unclear to me.I haven't played D2 or BG, so it could be that I just don't know enough about the effect you are referring to.
In a game like Asherons Call, there is an animated skeleton, and modeled parts are simply mounted onto the skeleton. To cut down on the number of animations which need to be created by the artists, males and females share the same animation skeleton; they simply have different body models.
If the character puts on a helmet, a helmet model is mounted at the head/neck mount-point, and it inherits the motions of the head/neck. It's just a matter of adding all the necessary mountpoints to your models and setting them up correctly.
Mounting models to mount-points is already fully supported in V12. Sharing skeletons between models may or may not be... I don't know. I would guess that it isn't.
#4
09/04/2001 (8:05 pm)
Nelson , BG is a 2d rpg while asheron's call if i'm not mistaken is a 3d rpg.
#5
1. This whole setting the mount points: is it done in the animation program, like a right click->add moutn point menu choice or something, or do I do it in my code?
2. the accessing of the mount points in the code: I assume this would be part of whatever SDK I'm using to load the animation? And the part where I say: "helmet attach here"...again, is this the kind of thing provided by the SDK or is this something I'd be coding up on my own? I don't suppose there's any good books/tutorials/on line resources on this topic?
thanks a lot for your help, I'm trying to learn some new techniques to push my game coding abilities =)
09/05/2001 (11:16 am)
Well, D2/BG are 3D. They use direct3d, it's not first person, but it's still using 3d. Anyways, regardless, maybe my problems is I just don't know enough about 3d modeling. If my animator makes a 3d animation in 3ds max or the equivalent, and then just a static image of each armor/weapon type (still made in 3dsmax tho, it's just not moving), I can just load in the main animation in my code, and then in the code as well basically say: "attach helmet to head mount point X on skeleton", and the helmet now gets the same movement properties as the body? I'm left with a few questions:1. This whole setting the mount points: is it done in the animation program, like a right click->add moutn point menu choice or something, or do I do it in my code?
2. the accessing of the mount points in the code: I assume this would be part of whatever SDK I'm using to load the animation? And the part where I say: "helmet attach here"...again, is this the kind of thing provided by the SDK or is this something I'd be coding up on my own? I don't suppose there's any good books/tutorials/on line resources on this topic?
thanks a lot for your help, I'm trying to learn some new techniques to push my game coding abilities =)
#6
http://www.gamasutra.com/features/20001025/schaefer_01.htm
- Barry
09/05/2001 (1:17 pm)
Don't know how useful this will be to you in the sense of an exact algorithm, but here's a link to a good article on the development of Diablo 2 by Erich Schaefer (Vice President of Blizzard North). There is some mention of the method they used to render the different armour sets and get them on screen:http://www.gamasutra.com/features/20001025/schaefer_01.htm
- Barry
#7
And yes, D2 does use Direct 3D, but they only use it for parallaxing and I think lighting. That stuff is optional if your machine can't handle it.
This distinction is important, because this is still a 2D problem, not a 3D problem if you're really trying to mimic D2 or BG or Nox. Sure, your artists have to know how to create the right parts of the 2D art assets from 3D files (assuming they're not hand-drawn,) but you'll be assembling these eq/body/weapon sprites with offsets and general 2D math, not with in-game 3D skeletal tricks.
On the other hand, if your game will be like WarCraft III (or Dungeon Siege or Pools of Radiance or ...), then *THAT* is a 3D game and requires 3D tricks to solve. Honestly, Darkstone is the only Diablo-esque game that's actually 3D that I can think of.
There are also a few RTS games that you can learn from that deal with the same problems. If you are pursuing 3D, you may want to try to figure out how the Earth 2150 series did their tricks -- most of the mechs (and buildings for that matter) in that game are completely configurable, with a chassis and choice of weapon/accessory mounts. Metal Fatigue, on the other hand, let you assemble mechs, and it was a 2D game.
I hope that helps.
-Scott
09/05/2001 (2:28 pm)
For the record, D2 and BG are not 3D games -- they are 2D games where the 2D backdrops, 2D character animation sprites, etc., were all rendered from 3D models. But they are *not* 3D games.And yes, D2 does use Direct 3D, but they only use it for parallaxing and I think lighting. That stuff is optional if your machine can't handle it.
This distinction is important, because this is still a 2D problem, not a 3D problem if you're really trying to mimic D2 or BG or Nox. Sure, your artists have to know how to create the right parts of the 2D art assets from 3D files (assuming they're not hand-drawn,) but you'll be assembling these eq/body/weapon sprites with offsets and general 2D math, not with in-game 3D skeletal tricks.
On the other hand, if your game will be like WarCraft III (or Dungeon Siege or Pools of Radiance or ...), then *THAT* is a 3D game and requires 3D tricks to solve. Honestly, Darkstone is the only Diablo-esque game that's actually 3D that I can think of.
There are also a few RTS games that you can learn from that deal with the same problems. If you are pursuing 3D, you may want to try to figure out how the Earth 2150 series did their tricks -- most of the mechs (and buildings for that matter) in that game are completely configurable, with a chassis and choice of weapon/accessory mounts. Metal Fatigue, on the other hand, let you assemble mechs, and it was a 2D game.
I hope that helps.
-Scott
#8
09/05/2001 (2:42 pm)
so then if they are 2D games basically, I assume that means that the animations for the characters are just a sequence of 2D bitmaps (perhaps rendered from a 3D animation model, but still, it's a sequence of bitmaps changing, as opposed to a 3d model actually loaded and running in the program)? In which case, then there is nothing 3D about the character moving about the screen, they're just 3D looking 2D bitmaps. Is that correct? Just static 2D bitmaps, quickly flipping from one frame to the next? If that's the case, then I'm confused as to how the character could have lighting effects applied to them. I was under the impression that to do lighting, you needed a 3D model, something with vertex information, so that you could do all the fun calculation of normals and whatever else needs to be done to mimic rays of light hitting a surface. Perhaps I'm totally looking at this in the wrong way. Please let me know if I am =)
#9
If I run across any good articles on this stuff, I'll follow up on this thread.
-Scott
09/05/2001 (3:17 pm)
Well, to be honest, I'm not sure how exactly they do the character lighting, but I am sure it's a 2D game that assembles bitmaps (or some 2D format) into the characters you see. Note that the parallaxing (where the tops of trees move at a different rate than the ground behind them) is just a 3D effect applied to 2D art assets -- I assume lighting uses a similar trick.If I run across any good articles on this stuff, I'll follow up on this thread.
-Scott
#10
This allows them to take full advantage of hardware acceleration and lighting.
I remember a recent RPG-style isometric game doing this. I can't remember which.
09/06/2001 (1:30 am)
I believe some games of this nature are 3D. They use animated textures on very simple geometry.This allows them to take full advantage of hardware acceleration and lighting.
I remember a recent RPG-style isometric game doing this. I can't remember which.
#11
One other solution is to make 3D models for each character and animate them into a buffer in memory and blit that into the game (Ive done that and it works fine).
Of course that means you need a reasonable 3D renderer in software, which a lot of companies wont have these days).
Phil.
09/06/2001 (3:52 am)
2D sprites can quite easily have lighting calculated.. most of its just calculating a modulation texture to apply over the character sprite.One other solution is to make 3D models for each character and animate them into a buffer in memory and blit that into the game (Ive done that and it works fine).
Of course that means you need a reasonable 3D renderer in software, which a lot of companies wont have these days).
Phil.
#12
From (ss)Goku
01/31/2004 (3:04 pm)
Could someone here tell me how to change the size shape and color of a weapon bullet pleae.From (ss)Goku
#13
02/02/2004 (5:40 pm)
Some people might be getting confused with Baldurs gate dark alliance on consoles and old baldurs gate on PC :). the console version is all 3d and very pretty, the PC version is 2D.
#14
So back then, there wasn't any Balder's Gate: Dark Alliance. =)
-Scott
03/10/2004 (7:59 pm)
Heh, true, but this thread is like 2.5 years old (6 days before 9/11, I might add...) So back then, there wasn't any Balder's Gate: Dark Alliance. =)
-Scott
Torque Owner Josh Albrecht