Mod request: Add inertia dampening to gyro arrays

Sozin

Dog Emperor
Joined
Jul 9, 2016
Messages
576
Likes
845
Points
505
#1
My C# is a bit (read very) rusty. Any chance the above could be modded in? Not sure how the terratech game engine runs so i'm a bit leery about trying it myself
 
Likes: Fehn

Sozin

Dog Emperor
Joined
Jul 9, 2016
Messages
576
Likes
845
Points
505
#3
Edit: before reading the rest, note that your hover height mod is basically what I’m looking for. Difference is: in that, you’re damping along the vertical axis, and thus only care about distance to ground. I’m asking for inertia damping, so I care about 3d space, so local variable should be position and not distance.

Use local variable to store past location
=> can calculate velocity
=> apply force vector on COM in opposite direction
=> scale force according to velocity magnitude * some dampening factor k

If there’s another way to calculate velocity then use that instead.

If force calculations are not supported then decreasing the velocity by some factor works too

I say apply the force vector on the COM because then can simplify somewhat: just multiply dampening force by # of gyros and apply in one location instead of checking individual gyro locations and applying multiple forces there

Edit: forgot to say: bound force applied by some constant. E.g. each gyro allows you to potentially exert 1 Newton of dampening force

Still calculate what the appropriate dampening force is (k*num_gyros*velocity), but actually apply a force of magnitude:
min(k*num_gyros*velocity, c*num_gyros)

Note: c,k to be determined by experimentation or whatever idk what they should be.

If applying on a by-gyro basis is easier (because script is applied to the gyro block itself), then just apply force opposite velocity of min(k*velocity, c). Velocity should remain mostly constant amongst the gyros (because lag is a thing, and rotations take some time) but in this case recommend keeping individual locations anyway (or to apply COM velocity to all of them)
 
Last edited:
Likes: WhitePaw2002

WhitePaw2002

Modding Husky
Joined
Jan 7, 2016
Messages
931
Likes
1,990
Points
505
Age
17
Location
North-east America
Website
github.com
#4
I think I got an idea of what you mean, but I just want to make sure:
Should gyros be more stable to prevent from bobbing from extra force?
Should gyros be able to upright techs perfectly? (I made an adaptive equation a while ago, capable of adding and removing force to get an object to reach and stay at a goal)
 

Sozin

Dog Emperor
Joined
Jul 9, 2016
Messages
576
Likes
845
Points
505
#7
Essentially, yes. My vision is that gyro arrays can maintain both rotational and positional stability. But, for example, if you have a jet engine pointing up on one side roaring, and nothing on the other, only a ludicrous amount of gyros should stop it from turning

The main reason I want this is so that hovercraft can stop drifting all over the place. Instead of modding another block like you did blimps on the cakes, I thought it’s be better to roll the functionality into the existing gyro arrays. (Pun intended)