View previous topic :: View next topic |
Author |
Message |
MDave

Joined: 17 Dec 2007 Posts: 75
|
Posted: Tue Apr 01, 2008 7:46 pm Post subject: Model attachments? |
|
|
Just a quick question, is it possible to make an entity have more then one model assigned to it? For instance, I currently have it that I use a different player model for each weapon it holds. This dosn't seem to be very efficient, as each of my player models is about 1.5 mb, and it's a tedious task to export the same character just with different guns rigged onto him. Not to mention I'd have to do the same for my enemy soldier characters, argh. If it is possible, are there good examples of this?  |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Tue Apr 01, 2008 9:31 pm Post subject: |
|
|
Md3 tagging is your friend. _________________ Apathy Now! |
|
Back to top |
|
 |
MDave

Joined: 17 Dec 2007 Posts: 75
|
Posted: Tue Apr 01, 2008 10:03 pm Post subject: |
|
|
MauveBib wrote: | Md3 tagging is your friend. |
If only it were so easy. I'm limited by using a quake engine without md3 support, unless I code it in myself somehow. Since this engine isn't exactly on the PC, it might be quite the task to port it If there is no solution for vanilla-ish quake, I'll just have to do it the tedious and very un-motivating way
How does quake know .weapon is the model to show for the first person view only, and .model is for the actual character? Is it strictly through the engine only, or QC? Can I do self.model.weapon?
Is there any documentation on how you can pair or link entities together? |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Wed Apr 02, 2008 7:17 am Post subject: |
|
|
Not really. It usually becomes easier for us to help you if you can simply tell us what you want to do, rather than asking if your idea of how to do it works. There are many examples of multipart models being done in Quake, they however all use multiple entities for the different parts. Even md3's with tags would do this, unless you use csqc. Prydon Gate is an example of this, separate models for player, weapon and shield. Many visible-weapon mods do this as well. _________________ Look out for Twigboy |
|
Back to top |
|
 |
MDave

Joined: 17 Dec 2007 Posts: 75
|
Posted: Wed Apr 02, 2008 2:42 pm Post subject: |
|
|
Urre wrote: | Not really. It usually becomes easier for us to help you if you can simply tell us what you want to do, rather than asking if your idea of how to do it works. There are many examples of multipart models being done in Quake, they however all use multiple entities for the different parts. Even md3's with tags would do this, unless you use csqc. Prydon Gate is an example of this, separate models for player, weapon and shield. Many visible-weapon mods do this as well. |
Hmm, I thought my original post explained with an example what I needed help with. But yeah, a visible weapon mod (for third person view) is what I'm trying to do. When you hold a pistol, the third person model holds a pistol etc. and only the weapon mdl changes, not the entire player mdl too. I'm not too overley familiar with all the mods out there that do this, but I guess the best way to understand how its done is by looking at the qc source right? I thought perhaps it would be simple enough explain how its done in code, guess not.  |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Wed Apr 02, 2008 4:10 pm Post subject: |
|
|
Surely.
Spawn two entities, one for player, another for weapon. In the player's postthink code, do a setorigin on the weapon model to the players origin, and after that make it have the same .angles and same .frame as the player.
Now the tricky part:
All weapons must have the same amount of frames as the playermodel, with the weapon positioned to the players hand, properly aligned and everything, each frame. That takes a little work, but if you're familiar with QME, it shouldn't be hard at all.
This makes the weapon follow the player around, and look as if the player is holding it properly no matter the animation. _________________ Look out for Twigboy |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Wed Apr 02, 2008 4:16 pm Post subject: |
|
|
That's true, I didn't think about the fact that the third person weapon model will be seen even in first person. This is why Quake Essentials baked their weapons into the playermodel _________________ Look out for Twigboy |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Wed Apr 02, 2008 4:24 pm Post subject: |
|
|
Urre wrote: | That's true, I didn't think about the fact that the third person weapon model will be seen even in first person. This is why Quake Essentials baked their weapons into the playermodel |
Heh, I deleted my original post because yours pretty much nailed how it was done.
Anyhow, like I said in the original, just make sure you do it right, and there won't be any problem. Better yet, try to find a way to bake mutiple weapon models into your main player model. (Accessable via different framegroups) _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
MDave

Joined: 17 Dec 2007 Posts: 75
|
Posted: Wed Apr 02, 2008 6:57 pm Post subject: |
|
|
Thanks for the helpful replies! Sounds easy enough
Hmm, problem with baking the weapon models into the player would be repeating all the player animations again with each weapon model I have (which is 10, ouch!) so multiply 1.36mb (my player model without a weapon) by 10 and add some more for the extra weapon models, thats one huge file size!
Now for Urre's suggestion I'll only have to worry about the first person view, but is there a way in the engine to fix that, perhaps? Actually, I remmember the chase cam tutorial here doing something funky with hiding the first person view model and displaying the third person view character, even though its not a 'real' chase_active third person camera. |
|
Back to top |
|
 |
daemon

Joined: 07 Nov 2007 Posts: 62
|
Posted: Mon Apr 14, 2008 10:33 pm Post subject: |
|
|
an alternative that i've been messing with is to load up your player model in QME and map the offset and angles of where the weapon would be for each frame straight into qc. tedious, but you don't have to animate your weapons. you'll also have to give the weapon an avelocity to interpolate it if you desire smooth animation. once this is done, you can make as many single frame weapons as you want to attach to the player w/o having to do much work. _________________ -daemon [ daemonforge.org ] |
|
Back to top |
|
 |
ShoTro

Joined: 18 Mar 2008 Posts: 61 Location: Virginia, USA
|
Posted: Tue Apr 15, 2008 2:28 pm Post subject: |
|
|
daemon wrote: | an alternative that i've been messing with is to load up your player model in QME and map the offset and angles of where the weapon would be for each frame straight into qc. tedious, but you don't have to animate your weapons. you'll also have to give the weapon an avelocity to interpolate it if you desire smooth animation. once this is done, you can make as many single frame weapons as you want to attach to the player w/o having to do much work. |
One step beyond that is to rig the model with a skeleton. Ok, you need to reanimate the characters again at this point, but it would be a breeze compared to normal in Blender3D. You can rig a armature for weapons then apply each model to it and export appropriately. Every weapon would be rendered based on one animation. (or just import the MDL as an MD2 and animate the weapons using a single armature for each frame of animation. Your option) Then export each weapon with something like the openArena MD3 exporter. After that convert it to MDL using one of the few converting methods out there. It is a bit of work getting the conversion right, but the animation part will be a breeze. _________________ Shoot everything that moves. When it stops moving shoot it again just for good measure. |
|
Back to top |
|
 |
daemon

Joined: 07 Nov 2007 Posts: 62
|
Posted: Tue Apr 15, 2008 5:11 pm Post subject: |
|
|
that sounds like some work for each new weapon o.o _________________ -daemon [ daemonforge.org ] |
|
Back to top |
|
 |
ShoTro

Joined: 18 Mar 2008 Posts: 61 Location: Virginia, USA
|
Posted: Tue Apr 15, 2008 7:02 pm Post subject: |
|
|
daemon wrote: | that sounds like some work for each new weapon o.o | Really not that bad, unless you don't know the tools. Then it is a nightmare. XD _________________ Shoot everything that moves. When it stops moving shoot it again just for good measure. |
|
Back to top |
|
 |
jim

Joined: 05 Aug 2005 Posts: 400 Location: In The Sun
|
Posted: Wed May 07, 2008 5:27 pm Post subject: |
|
|
I have some questions about them too. I've made my models use a lot different attachments and some attachments have attachments too. One character model has total: 4 attachments and 6 subattachments (attachments having attachments). So seeing one character like this brings 11 entities to the screen at once...
Are they going to eat a lot performance? _________________ zbang! |
|
Back to top |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Wed May 07, 2008 9:31 pm Post subject: |
|
|
jim wrote: | Are they going to eat a lot performance? |
Damn right. Loads of draw calls for that kind of model. This is why UT3 automatically combines attachments into one mesh (except weapon) for example to improve on the performance. _________________
 |
|
Back to top |
|
 |
|