Problems with vehicle model

Discussion in 'Testing Discussion' started by Redskull, Feb 11, 2015.

  1. Redskull

    Redskull Member

    Messages:
    115
    Likes Received:
    4
    Trophy Points:
    0
    Hey guys

    I've been wrestling with the new NF med tank for a while, it's floating off the ground and is very back-heavy which makes it do wheelies all the time and unable to steer.
    Any idea what could be the problem here? All the .qc files are basically from the BE medium that i hacked together with my own stuff.

    [​IMG]

     
  2. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    the center of mass can be overridden, might fix your back-heavy problem
    https://developer.valvesoftware.com/wiki/$masscenter

    i find it kinda odd that the center of mass isnt set for the current vehicles since its certainly not the centroid, maybe this explains some of the handling oddities?

    the ride height could be the scripts. idk too much about that though, just viro (i think) mentioned something about how you could set a vehicle to drive above ground in scripts (or was it spartacus? idk but doesnt matter really)

    edit:
    acutally maybe its all in the scripts
     
    Last edited: Feb 11, 2015
  3. Z100000M

    Z100000M Vithered Weteran

    Messages:
    9,120
    Likes Received:
    70
    Trophy Points:
    0
    While the off center weight might seem like a odd and cool thing, i wonder if it wouldnt complicate the steering even more, maybe even break how tanks react to mines. Woudlnt really want to have meds flip to 3 mines.
     
  4. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    a lower center of mass should make them less likely to flip from anything most things. if, as i suspected, the center of mass is the centroid of the physbox its higher from ground then it should be.
     
  5. Lazybum

    Lazybum :D Staff Member Moderator

    Messages:
    4,827
    Likes Received:
    190
    Trophy Points:
    0
    I assume you are using the nf vehicle handling script.
    Code:
    	"body"
    	{
    		"massCenterOverride"	"0 -40 -1.5"	// leave at vec3_origin for no override
    }
    Your problem for how the tank is leaning back is due to that. For some reason it doesn't say what does what, but it should have this comment added it it.
    Code:
    	{ Drag: First coordinate moves center left/right (don't change it), second : front, rear --> setting it <0 limits the turning ability of a tank "on spot" and a bit on the move, setting it > 0 makes turning slower in the beginning and way faster if you keep the keys pressed  ; third: up/down --> moving it down (-) counters flipping but hinders hill climbing
    	}
    Try setting all that to 0 0 -1.5 and see what happens, it should balance out somewhat. You or someone with more scripting knowledge has to mess with the handling scripts, it probably won't handle right really if you leave it at the default settings and changing anything is tricky.

    Not sure about height though, but it may be related to whatever viroman was talking about.
     
  6. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    The (invisible) physics wheels are probably set wrong. That's probably why it's floating.

    Hit me up on steam and we'll clean it up. It'll probably take a few recompiles, but it's not hard, just tedious.

    Oh and you're a wonderful human being for doing this. Like really.
     
  7. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    The leaning back... seems like it might be from the BE afv. The AFV has larger front wheel and smaller wheels for the tracks. You might try looking in the vehicle script itself. look at "radius" to make sure they are all the same.

    You will also get that if the springs are not all set the same.

    One more thing... omg... please keep it down to 3 axles at the most. No need to make steering a serious pain in the ass.
     
    Last edited: Feb 12, 2015
  8. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    [​IMG]

    Yeah, it just needs some wheel-love.

    [​IMG]

    Yay, I get to feel important!

    [​IMG]
     
    Last edited: Feb 14, 2015
  9. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    spart... why is that tank... grey?
     
  10. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    I don't know, but I'll probably figure it out. Or someone else will. That's not my concern at this point.
     
  11. RappemongO

    RappemongO Member

    Messages:
    446
    Likes Received:
    2
    Trophy Points:
    0
    I fucked around with trying to replace the AFV at some point, and I gave up just because of this.

    I believe there is a great deal of magic involved in making the vehicles behave, either in scripts or code, but something somewhere is overriding any physics models you compile with.
     
  12. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    Yeah, I really need to at least put my existing work with this thing on the forums. Ship or die!

    You can fix this, it's just mind-numbingly boring to figure out which fucking wheel mount maps to which other wheel since redskull unknowingly tried to put 10 axles on the tank.
     
  13. Redskull

    Redskull Member

    Messages:
    115
    Likes Received:
    4
    Trophy Points:
    0
    Would it be easier if the wheels are set up like this? I have no idea what defines the amount of axles on a model.

    [​IMG]
     
  14. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    The model that is visible doesn't matter (i think). It's all about how it's rigged, or how it's offset in the qc. Grrr, I keep putting this off.
     
  15. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    yes its all about rigging not what the model looks like. The Model could be a flying saucer but, the rigging could have 4 wheels.
     
  16. f1r3w4rr10r

    f1r3w4rr10r Modeler

    Messages:
    2,475
    Likes Received:
    4
    Trophy Points:
    0
    It only matters, if you want the road wheels to fit to the underlying terrain. Otherwise it doesn't matter.
     
  17. Redskull

    Redskull Member

    Messages:
    115
    Likes Received:
    4
    Trophy Points:
    0
    So how would I rig this model to have fewer axles? Each wheel has a unique bone but I still don't know what determines an axle in the rig.
     
  18. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    talk to spart about that. I didn't bother with rigging like spart did.
     
  19. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    One thing that would make it much easier to work with would be to know which axle number maps to which visual axle. There are ten of the damn things and the physics wheels seem to be mapping to the axles at random (except for the front axle, which is just defaulting to the origin in the lower middle of the model).

    You can see there's a wheel attachment point where every visual wheel goes.

    [​IMG]

    Avoiding that "tipping" issue in the OP is actually really simple to solve. It's caused by the front wheels not having an attachment point (for reasons I can't figure out) and defaulting to the origin, which happens to be in the lower middle of the model, which "tips" it.

    But even without the front wheels, we have 3 more axles to work with, which is plenty. We could make do with two if necessary. The fucking insane part of it is figuring out which vehicle physics axle.

    You can see them below. They are the green spheres (wheels are spherical in Source). There are only three axles because the fourth (erm, "first"?) is stuck under the tank at the origin, but it's tiny and basically vestigial.

    Note that the two that are touching the ground are higher than their attachment points because of the suspension. That's expected behavior.

    Also note that the front is clipping through the ground because there's no wheel up there. That's easy to fix. It's intentionally not fixed because I wanted to use the original wheel points so Redskull & Friends could see where the wheels are spawning by default.

    [​IMG]

    And the qc so far. I was going to just figure it out via manually recompiling with and without each axle (and apparently figured out one of them), but I lost my patience the last time I worked on this.

    Code:
    //wheels - base_rig_wheelL01, base_rig_wheelL02, etc
    $attachment wheel_fl "base_rig_wheelL01_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_fr "base_rig_wheelR01_1" 0 0 -2 rotate 0 180 0
    
    $attachment wheel_02r "base_rig_wheelR02_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_03r "base_rig_wheelR03_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_04r "base_rig_wheelR04_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_05r "base_rig_wheelR05_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_06r "base_rig_wheelR06_1" 0 0 -2 rotate 0 180 0 //Second Axle (First gets thrown back to origin)
    $attachment wheel_07r "base_rig_wheelR07_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_08r "base_rig_wheelR08_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_09r "base_rig_wheelR08_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_010r "base_rig_wheelR09_1" 0 0 -2 rotate 0 180 0
    
    $attachment wheel_02l "base_rig_wheelL02_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_03l "base_rig_wheelL03_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_04l "base_rig_wheelL04_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_05l "base_rig_wheelL05_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_06l "base_rig_wheelL06_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_07l "base_rig_wheelL07_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_08l "base_rig_wheelL08_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_09l "base_rig_wheelL08_1" 0 0 -2 rotate 0 180 0
    $attachment wheel_010l "base_rig_wheelL09_1" 0 0 -2 rotate 0 180 0
    
    //$attachment wheel_rl "base_rig_wheelL010_1" 0 0 -2 rotate 0 180 0
    //$attachment wheel_rr "base_rig_wheelR010_1" 0 0 -2 rotate 0 180 0
     
  20. f1r3w4rr10r

    f1r3w4rr10r Modeler

    Messages:
    2,475
    Likes Received:
    4
    Trophy Points:
    0
    Isn't that something Redskull should be able to tell you? I mean from what I know those attachments are placed corresponding to bones. So you just need to know where which bone is.
     

Share This Page