Profile image

Tutourial for Walkers

93.4k winterro  1.3 years ago

So ,i have been making walkers for an enternity now. And people ask me realy often how it works precisely.

Step 1 - Building a frame

First you need to build a platform. first make a rough shape of what you want. after that detail it as you like. Its a good idea to use disablePartColissions set to True on parts that have close contact with eachother. Hinges shift and are not static, so every close parts will grind on other close parts on the impact of the legs, and could get damaged.

Also its important to set partColissionResponse to None on vital parts of the legs, like the foot or the hinges. doing this will make the parts immune to colission damage.

For the hinges theres one important rule, Weight equals strength. The heavier the hinge, the stronger it gets, hinges with the weight of 0 are weak and easily flopped. Heavy hinges are strong but create a lot of rotational torque on the frame.

Also try to get the speed to atleast a value of 500%, this makes the hinge very responsive.

Next we add a Gyroscope since it doubles your performance. The value you need to look at is speed, gyroscopic stability is basicly useless and we only change the speed on it. for small walkers 250% gyro is more than suficient, however thats not the case for bigger walkers. increasing the speed to 600% usually fixes it. Next you add this to your Yaw in the gyroscope Roll-YawRate/6*clamp(Roll=0,0.1,1). This makes the walker keep its heading while walking. Since your walker moves its legs it gets rotational torque, this neutralizes it. making the number 6 in the code bigger makes your walker turn faster.

Last there is a funky tree in the joint category (overload). If your walker is very fat, it will wobble like its drunk. Increasing the damperMultiplier will make the hinges less wobbly, the recommended value is 1000 anything above will make the hinge slower.

Step 2 - FT Coding

This is the heart of your creation, without it, no walkies.

Grab a label

Labels are extremely helpfull to look if your codes are working.
For example {Throttle}. If you have typed it correctly in your label it will show as 0 and else, nothing. This is an easy check in the designer if you have made any typos.

So lets start with the beginning. You have a rotator, does not matter wich since all are the same.

The rotator has a value between 1 and -1. However we need a wave from 1 to -1 to make it walk.

Lets start with clamp. This input is very handy later on for trimming your walkers gait later on. Its purely here for convenience so you do not need any ingame file editers.

clamp(Pitch,-1,1)

Next we add sum . sum works like a stopwatch, but with no reset function. It will count forwards and backwards with the numbers you give it. Give it a value of 1 and it will add 1 every second, give it -1 and it will do it the opposite way. This is what we need for continuous motion. sum is here to keep the sinewave going. Without sum you will never get an effective infinite walking
motion. Since all the values in simpleplanes are 1,or -1 for inputs, you get that this is going to be extremely slow, so we add a multiplier to speed it up.

sum(clamp(Pitch,-1,1)*500)

Last we add the magic ingredient.
alt text
That ingredient is sin or cos. These two functions are the part wich makes the legs move back and forth, The sinus waves max value is 50% later than the cosinus value. by using the cosinus as the knee and ankle rotator while using sinus as a hip rotator you will get a walking motion.

sum(sin(clamp(Pitch,-1,1) *500))
sum(cos(clamp(Pitch,-1,1) *500))

  • Log in to leave a comment
  • Profile image
    93.4k winterro

    Mirroring the code doesn’t work correctly, invert the direction of movement by swapping min and max

    Do not use invert

    Example
    Max= A
    Min= -B
    _____________=
    Max= -B
    Min= A

    Pinned 4 days ago
  • Profile image
    93.4k winterro

    @Griffon1 i Accidenally found it once, note how my wyvern walks

    +1 1.2 years ago
  • Profile image
    93.4k winterro

    @Griffon1 hmm sound interesting

    +1 1.3 years ago
  • Profile image
    14.2k Griffon1

    A long time ago I formulated some functions in Desmos which would "sharpen" or blunt the peaks of the sine wave, I just have to find it and use it one of these days

    1.3 years ago