Learning To Build Guns.

Modelling, Textures, Animating and other general engine asset topics.

Learning To Build Guns.

Postby Epifire on Mon Aug 29, 2011 4:28 pm

Hey guys, I wanted to ask how it is you make a weapon for the Source engine. I'll give a rundown on what I know so that maybe you guys can help me fill in the blanks...

I have had a lot of time in XSI softimage (although I never worked with animation, or character creation). Note that I have experience with XSI itself, but never exported any models over to Source.

I picked up the '05 version of C++, but am still pretty new in this area. Cause all I got is a Noesis Interactive DVD on editing the hl2 buggy. I just mention programming, cause I figure that ties in with putting a gun in the engine some where.

Done alot of time in Hammer, so that's not a problem in the knowledge area for this project.

So really I guess I can say I have famialiarity with the exsisting programms, I just don't know how to apply that expereince to make a gun. So lets just say there are a lot of blanks to fill in.
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

Re: Learning To Build Guns.

Postby Zecrah on Mon Aug 29, 2011 5:55 pm

http://www.interlopers.net/tutorials/16895

http://www.interlopers.net/tutorials/32662

These are a few tutorials that may help with the actual 'adding' it to a mod/coding it in and tweaking its properties. The second one is mine, yeah, although probably won't help much until you've reached a near finishing stage. It involves tweaking the ammo, damage and other properties.


http://developer.valvesoftware.com/wiki ... ng_a_model (Exporting)
(XSI link at the bottom)
http://developer.valvesoftware.com/wiki ... ng_a_model (Compiling)

This should help the export side of things and compiling them, and thus actually getting them into the engine.

The bulk of the work is modelling and texturing the weapon. I'm not a modeller so can't comment on that, but I believe it's generally making a world and view model and then the necessary animations such as reload, fire and so fourth. Adding it to the game is fairly straight forward.

Edit:

Take a look in here for Valve examples:
...\Steam\steamapps\<user name>\sourcesdk_content\hl2\modelsrc\weapons

There's lots of other examples in and around the sourcesdk_content folder too for models.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: Learning To Build Guns.

Postby stoopdapoop on Mon Aug 29, 2011 6:25 pm

zecrah's post is pretty comprehensive (as I'd expect it to be considering he wrote the longer tutorial :))

Animating weapons is pretty straightforward, but you'll need to be creating at least partially mechanically correct models for them to animate correctly, this will almost certainly require some hidden geometry and a little pre-planning.

you don't need to do any programming unless you're adding a completely new weapon, or changing some of the functionality of an existing weapon. If you're just making a cosmetic reskin of an existing one, you just need to compile it with the same name, and make sure it has the same animations. Make sure they're the same length to (framerate * number of frames, obviously) because a lot of the timing in the code is determined by the length of the animation.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Learning To Build Guns.

Postby Epifire on Mon Aug 29, 2011 7:34 pm

Well I am attempting to find out how to make a completely new one. However I am now starting some thing really simple, and that is first to make a simple physics model first.

Last time I tried, the model never appeared in model viewer. As I read through the links to the Valve Dev' Wiki Zecrah posted, I find there are some small little steps I never knew about. Now I also have one other question to add to this. I know in the more, in depth professional instructor videos I found before, stated that you should generate a finnal rendermap texture for the model. Well that is in the case that you use more than one source texture. Is that a must, or just a more processing effective technique? Cause in that case I know Modtools v6.0 has a bug with rendermapping.

Other than that I am just trying to settup a effective development pipeline before diving into weapon designing. Some of the things I have harder time with are the hard drive locations that you are supposed to place mod files in, cause generaly tutorials never really specifiy. Other wise when you get compilers that request for mod folders, you can easily misstake them if not properly directed.
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

Re: Learning To Build Guns.

Postby Zecrah on Tue Aug 30, 2011 12:20 am

I find that models not showing up is often the result of a poor .QC file. I encountered this many times when a newbie modeller friend of mine was having a go at modelling boxes for me.

As for rendermapping, I'm not entirely sure what that is so I'll leave that to someone else. :P

But I can help with locations of things, as could a few of us I'm sure. Of course, post here when you're stuck. Eventually it'll become clearer and more logically where things should go. I do know what you mean with that, I had similar confusion when playing with particles.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: Learning To Build Guns.

Postby Epifire on Tue Aug 30, 2011 3:44 am

Ok well here is an update...

Thanks to all your quick posts I was able to find my way to the Valve Wiki page on the Source file system. So with enough looking at that, and studying about what files go where, then the file location issue is solved. :smt023

Here is some good news though. After taking another shot at StudioCompiler by cannonfodder, I did a lot of trial and error for the past two hours, untill I didn't get any errors in the Model Viewer. So now Model Viewer says that it loaded with textures acounted for, (thank goodness) and now the only issue is that the model is not visible. With what you said, about this being a QC problem, than I am not so worried.

I noticed that there was an option to use an exsisting QC file for referance or some thing, but I just had StudioComp' build a new one. Maybe that's why? If some one could point out some of the paramiters that insure a working model, that might really help. :-)
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

Re: Learning To Build Guns.

Postby Zecrah on Tue Aug 30, 2011 1:38 pm

I've never used the cannonfodder thing. I've always written my own QC file then left-click drag'd it over studiomdl (Or, a batch file to studiomdl.exe) Perhaps this is what creates difficulties for you.

http://developer.valvesoftware.com/wiki/Studiomdl

On this page there is an example QC file for creating a straightforward, static, solid model. I've copied it here for reference:
Code: Select all
$modelname   "props_sdk\myfirstmodel.mdl"
$body mybody   "myfirstmodel-ref.smd"
$staticprop
$surfaceprop   combine_metal
$cdmaterials   "models\props_sdk"

$sequence idle   "myfirstmodel-ref.smd"

$collisionmodel   "myfirstmodel-phys.smd" { $concave }


On that page you can click the various parameters and see what they do.


The .QC I used to compile my friends box model - a small, physics only card board box - is below:
Code: Select all
$modelname "boxes/box.mdl"

$scale 1.0
$body box "box texture.smd"
$surfaceprop "cardboard"
$upaxis Y
$cdmaterials "models\boxes\"
$sequence idle "box_idle.smd"

$collisionmodel "Box.smd"
{
    //The player can pick up a maximum weight of 35KG, the gravity gun 250KG.
    $mass 4.0
   
    //For a concave collision model set this, else delete it.
    //Model can have multiple convex models.
    $concave
}
$keyvalues
{
   prop_data
   {
      base         Cardboard.Small
   }
}


Yeah, he sort of named the .SMD's a bit poorly :P

By the way, when you say not visible what do you mean? Can you still get a wireframe for it but it's just 'see through'? This is what happened to me when I put the wrong .SMDs in the wrong parameters. It didn't work properly, and although the model 'existed' it was just invisible.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: Learning To Build Guns.

Postby Epifire on Tue Aug 30, 2011 4:01 pm

I havn't used model viewer all that much, but when I load the model, the option is there to rotate it. Like you can see the visual helper that apears, around the model for the rotation, but there is just no model.

Now before when I went under the model tab after loading it, the info box used to report that the textures could not be found, but I fixed that (after finding I forgot to generate them!!). :?

So other wise I am just in the process of making a explosive physics barrel. Just gave it a wooden texture and painted the tnt letters on it. I don't need any custom gibs debries for it at the moment. Just want a simple prop that blows up. I know I kinda derailed my own topic as far as making a gun, but I figure I shouldn't put the cart before the horse.

EDIT: Oh I just remembered. I knew there were some extra paramiters for a exploding prop, but I don't know what they are. I know Noesis Interactive used to have a modeling video for making a exploding prop, but I think that got taken off of there site. I recall they had listed all this stuff at one point, sadly I wasn't into Source modding then.

Well I have had many updates in the past several hours. I got my Tnt Barrel to show up in model viewer and it looks fine, but my only problem is that when I try and select it in Hammer's model brouser, Hammer crashes. I don't hace any ideas as to why, but that's why I am asking.
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

Re: Learning To Build Guns.

Postby Zecrah on Wed Aug 31, 2011 11:30 am

http://developer.valvesoftware.com/wiki/Propdata

You can play with this parameter to create explosives, things that break, gibs, flammable objects etc.

Noesis interactive have a YouTube channel with XSI tutorials on too, near the bottom of their upload list:
http://www.youtube.com/user/noesisinteractive#p/u


What's the .QC file you're using?
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: Learning To Build Guns.

Postby Epifire on Thu Sep 01, 2011 1:29 am

$modelname "\tnt_barrel.smd"
$scale 1.00
$cdmaterials "models/textures"

$body "Body" "Tnt_barrel.smd"

$sequence "Idle" "D:\Sourcemods\Export SMD\Tnt_barrel.smd" fps 30 ACT_IDLE 1

$surfaceprop "wood"

$keyvalues { "prop_data" {"base" "wood.small"}

$collisionmodel "D:\Sourcemods\Export SMD\Tnt_barrel.smd" {
$concave
$mass 100.000
}


Ok I haven't had internet on my modding PC for a while, so sorry it took a while to getting around to that.

I know it hasn't got the parameters that it requires for explosion, but that's how it looked coming out of StudioCompiler. So that's how it stands now. By the way, the fact that Hammer crashes from the Tnt model means there is something wrong in the QC correct? If so, what are some extra measures to insure that it does not do that?
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

Re: Learning To Build Guns.

Postby Gary on Thu Sep 01, 2011 3:17 am

Try this:
Code: Select all
$cd "D:\Sourcemods\Export SMD\"
$modelname "tnt_barrel.smd"
$scale 1.00
$cdmaterials "models/textures"

$body "Body" "Tnt_barrel.smd"

$sequence "Idle" fps 30 ACT_IDLE 1

$surfaceprop "wood"

$keyvalues { "prop_data" {"base" "wood.small"}

$collisionmodel "Tnt_barrel.smd" {
$concave
$mass 100.000
}


By the way, using your visual mesh as a collision model is expensive and possibly invalid.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Learning To Build Guns.

Postby Epifire on Thu Sep 01, 2011 3:55 am

Gary wrote:By the way, using your visual mesh as a collision model is expensive and possibly invalid.


Hmm. Well all I know is I am really new to this so what do I use for a collision model? Or more like how do I change it?

I just followed directions, and tried loading it in Hammer. But when Hammer crashed from it, I then came back again asking why. The model looks fine in model viewer, but there seems to be an issue some where. My thoughts are mainly what is it that is crashing this?

Maybe I put in a wrong option some where in StudioCompiler. It has a option for the use of a exsisting QC, so I guess I'll use that when I want to get a more complex model going, and eventually some where down the road, I may construct a weapon.
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

Re: Learning To Build Guns.

Postby boing on Thu Sep 01, 2011 6:38 am

You need the collsion mesh for casting shadows and... well colliding with it. It should be as simple as possible, so you should basicly just build a very very lowpolyversion of you model. Most important: Concave elements will mess up your mesh and, allthough you dont see it in game it still needs a texture applied to it before exporting.
http://developer.valvesoftware.com/wiki/Collision_model
boing
Member
Member
 
Joined: Wed May 12, 2010 10:07 am

Re: Learning To Build Guns.

Postby Zecrah on Thu Sep 01, 2011 11:45 pm

Epifire wrote:$modelname "\tnt_barrel.smd"
$scale 1.00
$cdmaterials "models/textures"

$body "Body" "Tnt_barrel.smd"

$sequence "Idle" "D:\Sourcemods\Export SMD\Tnt_barrel.smd" fps 30 ACT_IDLE 1

$surfaceprop "wood"

$keyvalues { "prop_data" {"base" "wood.small"}

$collisionmodel "D:\Sourcemods\Export SMD\Tnt_barrel.smd" {
$concave
$mass 100.000
}


BTW you're missing a bracket there. Formatted, that line looks like this:

Code: Select all
$keyvalues
{
    "prop_data"
    {   
        "base" "wood.small"
    }


Needs bracket to close the $keyvalues
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: Learning To Build Guns.

Postby Fenrix on Mon Sep 19, 2011 4:54 pm

Anyone know of a handy maya tutorial for weapons? preferebly one using pralls 2011 fixed plugin. *dont need the modelling bit just rigging, compiling part*
Fenrix
Dumpling
Dumpling
 
Joined: Sun Aug 28, 2011 5:08 pm

Return to Art Creation

Who is online

Users browsing this forum: No registered users

cron