Willy spring / wheel setup.. uhhh???

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Willy spring / wheel setup.. uhhh???

Post by fo0k »

So i've never played with the willy before :lol:


Was just trying something... and was setting up the spring positions in max using their co-ords in objects / physics..

The positions of the wheels.. is mighty weird.. it's like a series of different offsets... which do ultimately end up putting the wheels in the right place.. but it seems overly complex to get 'to the final position..' (on the axles..)

I guess you need to actually setup the willy springs in max to understand what I'm talking about.. but if you do know what i mean here... why is it like this?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Willy spring / wheel setup.. uhhh???

Post by Swaffy »

I just move the parts attached to the Willy's engine.

rem *** WillyEngine ***
ObjectTemplate.create Engine WillyEngine
ObjectTemplate.setnetworkableInfo WillyEngineInfo
ObjectTemplate.setAttachToListener 1
ObjectTemplate.loadSoundScript Sounds/WillyEngine.ssc
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.setMinRotation 0/0/-5000
ObjectTemplate.setMaxRotation 0/0/5000
ObjectTemplate.setMaxSpeed 0/0/40000
ObjectTemplate.setAcceleration 0/0/20000
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETCar
ObjectTemplate.setTorque 60
ObjectTemplate.setDifferential 3
ObjectTemplate.setNumberOfGears 5
ObjectTemplate.setGearUp 0.3
ObjectTemplate.setGearDown 0.1
ObjectTemplate.addTemplate WillyFrontWheelR
ObjectTemplate.setPosition 0.7/-0.21/2.5
ObjectTemplate.addTemplate WillyFrontWheelL
ObjectTemplate.setPosition -0.7/-0.21/2.5
ObjectTemplate.addTemplate WillyBackSpringR
ObjectTemplate.setPosition 0.7/-0.73/0.29
ObjectTemplate.addTemplate WillyBackSpringL
ObjectTemplate.setPosition -0.7/-0.73/0.29


Notice how there are two "FrontWheel" and "BackSpring" objects. Because the front wheels rotate (steer), the front springs are attached to their rotational bundle ("WillyFrontWheelL" and "WillyFrontWheelR") and those are attached to WillyEngine.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
takiwa
Posts: 134
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Willy spring / wheel setup.. uhhh???

Post by takiwa »

fo0k wrote:So i've never played with the willy before :lol:


Was just trying something... and was setting up the spring positions in max using their co-ords in objects / physics..

The positions of the wheels.. is mighty weird.. it's like a series of different offsets... which do ultimately end up putting the wheels in the right place.. but it seems overly complex to get 'to the final position..' (on the axles..)

I guess you need to actually setup the willy springs in max to understand what I'm talking about.. but if you do know what i mean here... why is it like this?
I know exactly what you mean, fo0k, I've went in and cleaned up code before and thought to myself, "As much stuff as I just took out, this thing will NEVER work!" But it did. Seems like a lot of the code placement for vehicles is redundant, unneeded, or just plain weirdly coded when there are easier ways to do it...
Image
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Willy spring / wheel setup.. uhhh???

Post by Vilespring »

Yeah, I've noticed that. The Panzer IV tank's con file is formatted so much differently than the other tanks, either that the panzer IV was the first tank in the game, or it was made by a different person.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Willy spring / wheel setup.. uhhh???

Post by freddy »

fo0k wrote:The positions of the wheels.. is mighty weird.. it's like a series of different offsets... which do ultimately end up putting the wheels in the right place.. but it seems overly complex to get 'to the final position..' (on the axles..)
maybe? http://www.ozebiz.com.au/racetech/theory/align.html
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Willy spring / wheel setup.. uhhh???

Post by Apache Thunder »

From the work I've done, the front wheels is typically offset outwards so they rotate correctly when steering is used (PivotPosition code on Rotational Bundles). They are typically offset a second time inwards so they don't stick out of the sides of the vehicle as a result of the pivot position code on the rotational bundles used for steering.

There's also the need to lower the springs further then how they will appear when the vehicle is in use. The springs damping/strength settings determine how much suspension the spring has and how much it moves up towards the vehicle when the weight of the vehicle is on it.

Tank springs get a little more crazy as they also have to be attached to skeleton bones for the track meshes, so they may have odd offsets to make the tracks work for that particular vehicle. My tanks have been mostly uniform in how the springs are made, but I'm sure Dice had their own ideas on it for their vanilla vehicles. :P
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Willy spring / wheel setup.. uhhh???

Post by fo0k »

yeah this is all true and understood. wheels dont actually rotate about their center.. and the suspension offset is required..

but the physics setup on willy places the wheels too far forward and very different heights... and is then corrected in objects with offsets.. maybe affects physics... ? its weird.. manually setup a willy with wheels.. (kinda assuming you have done this 100 times unless always via the vehicle import?)
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Willy spring / wheel setup.. uhhh???

Post by Apache Thunder »

Sometimes the structure of vehicle is coding has no real reason if the function of the vehicle isn't effected. Perhaps it's just how some of the Dice dev members made the vehicle or the result of what ever program they used to build the vehicle templates if there is such a thing for that. Sorta like how I like my coding to be organized. There's no functional difference, but it's just my way of organizing things. Though I wouldn't set up vehicles the way Dice did with offsetting the engine wheels and such since it makes figuring things out down the road more difficult if the wheels, engine or other things attached to that need to be adjusted. :P

I've built all my own vehicle coding from scratch for the most part. At least when it pertains to assets used in my Battlefield Heroes'42 mod. Some things are copy and paste like the positions of child objects, but the structure given to things is entirely me. I have the vehicles imported into Max from BFH and the only thing I really copy over is the positions of all the various parts, the rest just gets coded up from scratch with some exceptions. Like the National vehicles. They are mostly copies of the royal vehicle coding with the names changed and things altered for stuff specific to that vehicle since it's faster to do this with no real detriment to the quality of the final result. The BFH game I got them from had vehicles and weapons balanced the same for both teams, so there was no need to rebuild all the coding for the National team once finishing the Royal team stuff.
ImageImageImage
I have cameras in your head!
Post Reply