Swing Limit Soft should be off too, there was some sort of limitation when it’s turned on, don’t remember right now.
Angular Position Strength is a stiffness of the spring, set tank to it’s proper mass and tune this value up until you get proper clearance - distance between bottom of chassis and the ground. This is where I don’t like physics constraints as springs - if you change angle limit you have to tune Position Strength and Velocity Strength again, the wider allowed angle the more force you need.
The estimate for the spring strength is something like this:
Mass of tank in kg * acceleration due gravity / amount of wheels.
60000 * 980 /16 = 3675000 would be a basis.
Btw, in case you don’t know, you can multiselect all your suspension physics constraint by ctrl+left click in the list and then any change of parameters will be applied to all of them.
Angular Velocity Strength is a dampener, on my own springs it’s usually about 1% of stiffness value. You have to find it experimentally, when it’s too low suspension will wobble, when it’s too high it will jump erratically or stop it’s motion very rapidly.
Try higher values for Angular Position Strength, if you can’t find such that won’t allow spring to compress at all then something is wrong with settings.
Tuning is in two steps, you set something like 1 for Angular Velocity Strength (just so that it’s not a zero) and that approximation from formula for Angular Position Strength. If suspension doesn’t hold then make Angular Position Strength 10 times bigger. When it’s too much you will see that it won’t bend at all, then return it back to previous value and make it 5 times stronger instead of 10 and etc. until you get to something that looks right clearance wise.
After this you can tune Angular Velocity Strength until tanks doesn’t wobble after landing on wheels.
Have you created and connected all OnComponentHit events already? Those need to be done before UpdateFriction otherwise you can’t test it.
One thing that could be giving you troubles is a position of the torsion bar in relaxed state - it should form something like 70-80 degrees angle with chassis. So when it’s compressed under the weight and angle of torsion bar is about 10 degrees, the torsion bar will be producing a lot of force - necessary to handle the weight. I could make a diagram if this is confusing
This could be a part of the problem. I think I have the same issue on T-26, just haven’t thought about it.
If it’s default position is 15 degrees and this is where you get necessary clearance then you never going to get it. Unless you set position strength to some ridiculously high number such that deviation by just 1 degree produces force necessary to hold tank. Which means that at 2 degrees force will be so high that tank will go flying.
Default position can be something like 30 degrees or higher, then allow constraint to move 30 degrees too (±15) if you want 15 degrees to be “normal” position under weight. This way you will have 15 degrees of compression for the force to actually act and you can tune it such that at midpoint (15 degrees) you have exact amount of force necessary to support tank.
I don’t know how Angular Position Strength is scaled over the range of freedom that object is allowed to move. But I would expect that full amount of Angular Position Strength is used only at the last points of the range. Let’s say that default position for the handle is 15 degrees and physics constraint is allowed to move by 40 degrees. It means that handle can go as far as -5 to 35 degrees (±20 from 15). The force of the spring, will be equal to Angular Position Strength only near -5 and 35 degrees, everywhere in the between it will be smaller and it will be zero at the center, 15 degrees in our case.
This means that you have to deflect handle of suspension to a much higher degree by default, so that when it get to 15degrees of “desired” deflection you already have enough of Angular Position Strength to hold the tank.
Here’s all the wheels, idler and sprocket attached to the hull with constraints.
This should also somehow be the rest position when it “lands” on the ground.
I did setup the Torsion arms just like the real tiger where on one side they are all leading, and on the other side they are all trailing.
Yeah, then you will have to rotate them, but this should be simple. Just select all of your handles and add roll value in rotation.
For UpdateFriction either wait when I post a short guide on it or simply copy the code from T-26. It’s relatively simple:
We need to calculate total amount of friction points in contact with ground. This is where local integer variable is used Num_Friction_Points or something like that. The most important is for it be local.
Then we have two sequence branches, each for each side of the tank. We just need to fetch velocity of the track from “TrackProcessor” (?) on corresponding side and pass it to friction component.
I need to look into “track processor” to describe it’s input parameters but feel free to add them already. Look at the bottom of the list in T-26 components.
On the left, torsion spring is in the relaxed state and is effected only by gravity which we ignore for simplicity. On the right, torsion spring holds a portion of mass of the tank. So how do we get to this:
We can set angular limit to 90 degrees, so handle can turn up to M1 and M2. M1 and M2 would be the points where maximum force of the spring is generated. So spring force will go from -Angular Position Strength at M1, to 0 at A and to +Angular Position Strength in M2.
We want force of the spring to be equal "Mass of tank in kg * acceleration due gravity / amount of wheels " at 15 degrees (point B), which is 70% from point A. Which means that we should set Angular Position Strength to:
(Mass of tank in kg * acceleration due gravity / amount of wheels) * 1.3
to add 30% of force that we should have at M1 and M2.
We can take different angle. For example default position is 30 degrees and we allow freedom of 60, it means that lever can travel from 0 to 60 degrees and if our desired position under tank load is 15 degrees then we need to set Angular Position Strength as:
(Mass of tank in kg * acceleration due gravity / amount of wheels) * 2
as 15 degrees is a half way between relaxed position and fully compressed.
makes sense… the initial 15 degrees when it standing on all wheels was more or less a measurement. If I rotate the springarm 15 degrees from its horizontal position… the wheels seem to be at the point where they are in real life.
I will experiment with the angle and weight. I did not enable any weight of the actual wheel or springarm (yet)
My fear with settting M1 at 90 degrees is that when you drop the tank on schene activation the wheels go the other way… Haven’t tried that.
Contraints always seem to be some sort of struggle… for years I’ve setup 3D character for film and animarion in general and constraints always seem kind of iffy. It’s probably because of how they are implemented. They always seem to do “something” … relusting in all sorts of wobble and errors.
I’m curious how they do it in Vortex, I’m pretty sure they wrote their own physics code for it. In the long run I think it would be nice to have some sort of seperate torsion bar node, just like the spring… if you do it with the current constraint it’s kind of a pain to setup… and I’m curious if it will ever react the way you predict this way.
If you want me to send you the tiger to also experiment with the torsion bar, just let me know… I can send it to you. If it’s all working we can also include the tiger as an example for other people to try.
That would be great. It’s possible that I’m missing something important as so far I’ve setup just few tanks. It would be faster to take a loot at assembled model than to build another one. I do have a high poly model of MLRS provided by DaveFace but I only yesterday got proper Modo license and it will take some time to bring it into UE4.
0lento suggested a hybrid approach - were some wheels are driven by physical bodies and the rest is done using raycheck. This would limit suspension to a simpler setup like torsion bar but can be more stable and less iffy.
At the same time constraint based approach is not completely researched, just last week I’ve played with setting of suspension on T-26 and got a very different behavior. The main problem on T-26 is not even settings of the constraints but collision shapes of the wheels getting stuck in obstacles
I think you are right regarding using custom spring instead of using physics constraint motor. I can make it work one way - so lever can go from 30 to 0 degrees and creates maximum force at 0 and no force at 30, instead of heaving this symmetry as we have right now with constraints.
What’s the best way to send it? just “migrate” the Tiger_BP? and will just send all attached meshes etc…
btw, What version of UE4 are you currently on?
I’m using 4.11 now, but would like to move to 4.12 because there are some fixes to foliage I need.
If I am correct… all I have to do is install a 4.12 version of the plugin and my project should load fine right?
I’ve made a branch of 4.11 and master is on 4.12 right now. To migrate to 4.12 you need to copy/paste new version of plugin into plugin folder and then you can migrate by right clicking on project file in explorer. Just make sure to make a backup before that.
Asset migration should work fine after that. If needed I can check it in 4.11 too.
I will backup first, then move it to 4.12. When that all works out… I will migrate just the tiger and send it to you.
Can I make one suggestion for the MMT Content package? make a root folder called MMT in the content , and put all your directories in there. This makes it a bit more organized if someone want to add other packages to the project.
I moved everything MMT related to an MMT root directory… and UE4 just went awol … was scared that I just lost everything trying to reorganize… but all went ok… as far as I can see.
That would be a good thing indeed. I’ve tried to do it on folder by folder and fix redirectors - it didn’t worked well. I still cants delete old folders as redirectors as somehow locked.
I moved everything to 4.12 and it’s all up and running again.
I see you are experimenting with terrain deformation… haha… nice… I’m curious how heavy it is on a terrain with grass. I assume it’s stencils that spawn with a deformation map. Could also be a normal map that does not deform the terrain, but does give the impression of leaving trackmarks. If it’s gets to heavy you could also set an optional timer that erases the stencil after an X amount of time.
I love the terrain deforming… Did you ever see spintires?
I added all the OnHit component events also for the wheels. So now it’s time for the rest… I’ll wait until you have time to give me some guidance on how to proceed
In the meantime I can return to modeling… and the interior control blueprint.
I need a way to set it up seperate from the tiger blueprint. Now all the interior controls are also in the tiger blueprint… it would somehow be nice If I could seperate it so that it is easy to add to a different tank also.
I just have no idea how to organize something like that.
Hence… I don’t even know how to ask for ideas about it