• Register

Take command of maintainer 442 of seed vault 49 and take natures side in the fight. You may be life's last hope. Bring back life to the wasteland by rolling balls, building walls and walking robots. When water is found you bring back life to a desert wasteland. Protect against enemies with destructable walls and towers with guns that need ammo. Ammo is provided by a gravity driven rolling ball system. Ultimate goal is to bring back life to the planet.

Post feature Report RSS Life Stealer - Procedural walker

Life has a new enemy with legs, AI and terrain hugging abilities. It is not a robot you want near your plants.

Posted by on

Life has a new enemy with legs, AI and terrain hugging abilities. It is not a robot you want near your plants :-)

CubeWalkerThumb

The walker use Unity IK rigging and animation with a VFX for flames and particles. Here is the code controlling the body so it angles itself in relation to the legs with smooth and deadZone.

public Transform footLB;
    public Transform footLF;
    public Transform footRB;
    public Transform footRF;

    public float rotateMultiplier = 1f;

    public float currentXrot;
    public float currentZrot;

    public float targetXrot;
    public float targetZrot;

    public float rotPerFrame = 0.1f;
    public float deadZone = 0.2f;

    // X is back front
    // Z is left right


    // Update is called once per frame
    void Update()
    {
        float avgLeft = footLB.localPosition.y + footLF.localPosition.y;
        float avgRight = footRB.localPosition.y + footRF.localPosition.y;

        float avgFront = footLF.localPosition.y + footRF.localPosition.y;
        float avgBack = footLB.localPosition.y + footRB.localPosition.y;

        targetXrot = (avgBack - avgFront);
        targetZrot = (avgRight - avgLeft);

        if (targetXrot - deadZone > currentXrot)
        {
            currentXrot += rotPerFrame;
        }
        if (targetXrot + deadZone < currentXrot)
        {
            currentXrot -= rotPerFrame;
        }

        if (targetZrot - deadZone > currentZrot)
        {
            currentZrot += rotPerFrame;
        }
        if (targetZrot + deadZone < currentZrot)
        {
            currentZrot -= rotPerFrame;
        }

        transform.localEulerAngles = new Vector3(currentXrot * rotateMultiplier, transform.localEulerAngles.y, currentZrot * rotateMultiplier);
    }

Here you can see the terrain painter in action as the plants are consumed by the walker.

burning

The end result with nav AI and plant range finding. And a rough terrain manipulation. I hope to make it using masks instead of handcoded pixels.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: