Page 1 of 2

How do 3rd person weapon models work? (noob)

Posted: Fri Oct 15, 2010 1:29 am
by mrmmaclean
Is there a point on the model where they attach and animate accordingly? Or do they simply not even change? Or do they all reside in the player mdl?

I have no idea! If someone could help a noob out and break it down for me, I would be very happy.

Posted: Fri Oct 15, 2010 3:50 am
by leileilol
There's many ways. I'll just go through a few of them

THE OLD DEATHMATCH ESSENTIALS WAY:
Many different Player.mdls with the gun model changed itself on the model itself. This is EXTREMELY MEMORY CONSUMPTIVE as you need 16 whopping megabytes of memory to allocate typically... and that's just for the software renderer! Go GL with it, and considering the texture mapping for each player's colors, the texture memory footprint would be THROUGH THE DAMN ROOF raping your poor PSP.

THE HEXEN2 WAY:
Additional standing, running firing and pain animations for each weapon inside the same player.mdl. WARNING: ALSO TEXTURE MEMORY INTENSIVE and patience intensive, and polygonal intensive too as you're cramming in a ton of verts in there. this works best if you know how to model low poly weapons and know how to cram it in the UVs. hexen 2 got away with it back in 1997 because each player only had a limit of FOUR WEAPONS and most of them were sticks

THE SLIGHTLY MORE MODERN QUAKE2ISH "vwep" WAY:
A weapon model pre-animated according to the host model's animation, with a movetype_follow entity. The engine must support that and hiding the said entity in first person. WARNING: LOTS OF TIME CONSUMING MAKING THESE

EVEN SLIGHTLY MORE MODERN:
Like above, but with QuakeC vector offsets for every frame for the gun to put in the hand. Saves memory but is even more network intensive

A LOT LESS MODERN (the Duke3D, Kleshik way):
Stick the gun over the damn head.

THE ALMOST RIGHT WAY:
MD3 tags. Player MUST be MD3, must feature a tag_ to attach to. This is how Quake3 did it, it's a bit less time consuming, provided md3s and weapon models are ready. The engine of course must support it (darkplaces, fteqw)

THE RIGHT ? WAY:
The above but with skeletons and all the stuff's done through CSQC saving bandwidth.

THE HALF-LIFE WAY:
Weapons have p_ models which usually contain base skeleton with the weapon verts assigned to them. You could just say 'why not just tag' but this way allows for the egon weapon to connect from the backpack for example essentially allowing you to put weapon parts on any damn bone you like. No Quake engines support this, though maybe Darkplaces through CSQC does by sharing an animmodelindex.

Posted: Fri Oct 15, 2010 10:52 am
by andrewj
leileilol wrote:A LOT LESS MODERN (the Duke3D, Kleshik way):
Stick the gun over the damn head.
Heh :lol: I would never have thought of that

Posted: Fri Oct 15, 2010 12:04 pm
by ceriux
leileilol wrote:
THE HALF-LIFE WAY:
Weapons have p_ models which usually contain base skeleton with the weapon verts assigned to them. You could just say 'why not just tag' but this way allows for the egon weapon to connect from the backpack for example essentially allowing you to put weapon parts on any damn bone you like. No Quake engines support this, though maybe Darkplaces through CSQC does by sharing an animmodelindex.
i wish an engine would support this....

Posted: Fri Oct 15, 2010 3:21 pm
by mrmmaclean
leileilol, you are a freaking champion! Thank you so much for the info and ideas!

edit: I was thinking of doing the weapon frames to match the model animation but I didn't realize it would be as simple as using follow. The actual animating and exporting on the other hand... ughhh. But I knew the risks.

Posted: Fri Oct 15, 2010 10:16 pm
by Biodude
Im a little confused, stick the gun on the player's head? Like so you cant see it in first person? but then it will be on his head???

Posted: Fri Oct 15, 2010 10:41 pm
by mrmmaclean
Biodude, first person weapon models are different than 3rd person models. You'll notice by browsing through the vanilla paks that the weapon models in first person camera mode are (smartly) only the visual area of the gun (ie. the top and that's it).

3rd person weapons are a different thing all together, as in you can see the whole thing. So when you go back into 1st person view, you place the 3rd person weapon over the player's head so it isn't in view and can't be seen and then let the 1st person weapon models take over as usual.

edit: spelling

Posted: Sat Oct 16, 2010 12:00 am
by Biodude
I know it Is different, but lets say in multiplayer you are playing with someone, they look at you, and you have a gun above the player's head in 3rd person, the W_model, but it looks all ok in first person.
If you move it down to the player model's hands(still 3rd person), then it will be in front of you in first person

I think I got it, basicly when people look at you, the weapon will have to be high enough to not be seen in 3rd person?

Posted: Sat Oct 16, 2010 12:54 am
by mrmmaclean
Hmm, I wasn't even considering multiplayer. In that case, using the gun above the head solution, other players WOULD see that model above your head. Would be pretty hilarious, imo, but certainly problematic.

Multiplayer is not my forte nor what I'm interested in modeling/coding for (Flash port) so I don't know what to tell you...

Posted: Sat Oct 16, 2010 1:44 am
by qbism
OrionTF vweps are a good example of the Q2ish way w/ movetype_follow. Check out the qc.

Posted: Sat Oct 16, 2010 3:56 am
by Biodude
waitt, why would you want 3rd person weapon models in anything but multiplayer, unless you can physicly see yourself in a mirror or something?

Posted: Sat Oct 16, 2010 3:57 am
by Downsider
Biodude wrote:waitt, why would you want 3rd person weapon models in anything but multiplayer, unless you can physicly see yourself in a mirror or something?
Enemies..? :roll:

Posted: Sat Oct 16, 2010 4:12 am
by Biodude
I thought we were talking about only players here 8)

Posted: Sat Oct 16, 2010 4:20 am
by mrmmaclean
Well, I was talking about 3rd person view. I needed some understanding on how it could/does work and lei provided a lot of different examples.

Quake mods don't HAVE to be first person shooters, after all. :wink:

qbism, I'll check that qc out, thanks!

Posted: Sat Oct 16, 2010 7:23 pm
by goldenboy
That's true, Quake has a chasecam and Hexen 2 has something similar.

There are things you can do in 3rd person that don't make sense in 1st person. Like player acrobatics, kung-fu moves, swimming animations, spellcasting animations, icons over the player char to signify things affecting him/her like poison, speed, regeneration etc., and gosh, even different skins or outfits, like in 3rd person you could actually see which armour you're wearing, on your body. See Tomb Raider, Heretic 2 and Prince of Persia and similar games.

Tomb Raider is more similar to a 3rd person Quake than most people think. Especially with the weapon loadout (shotgun, grenades, machine guns and similar things) and the level design (gloomy tombs and rotten caves). OK, Lara looks better than Quakeguy, I'll give you that. Quake's running speed is also faster.

;-)