Procedurally Animating Creatures for my Game | Withersworn Devlog

Asarge
9 Dec 202307:00

TLDRThe video discusses the implementation of procedural animation in game development, which allows for real-time animation generation that is more diverse and dynamic than traditional pre-defined animations. The process saves time and resources and can be used for various actions such as adjusting to terrain, grabbing objects, and ragdoll physics. The technique often relies on inverse kinematics (IK) to calculate the necessary motion to reach a desired position. The video outlines steps for animating walking, turning, and aiming, using IK and blending with pre-made animations. It also covers the use of the 'boids' algorithm for pathfinding and movement behavior, which is typically used for flocking birds but can be adapted for game characters. The speaker shares their experience with applying procedural animation to creatures and humanoids, mentioning the potential for dynamic movement and the addition of lifelike features such as cloth, fur, hair, and skin deformation. The video concludes with the speaker's excitement for the future of procedural animation and its potential to surpass AAA animation quality.

Takeaways

  • 🎮 Procedural animation is used to automatically generate real-time animations with more diverse actions compared to predefined animations, saving time and resources.
  • 🔄 Common uses of procedural animation include adjusting legs to uneven terrain, turning heads to look at the player, grabbing objects, and ragdoll physics.
  • 🤖 Inverse Kinematics (IK) is a technique used to determine the motion needed to reach a desired position, often visualized by imagining pulling your hand towards you.
  • 🔗 IK setups typically involve two main points: a leader (e.g., hand reaching for a cup) and a target goal (the cup itself).
  • 🚶 Steps for procedurally animated walking include using IK to control the leg, gluing the foot to the ground, and moving a target point attached to the body.
  • 🧠 The body can be adjusted by using the average leg position plus an offset and rotating the body based on the difference in height between the left and right legs.
  • 🚀 Additional features and conditions can be added to make the walk more unique, such as changing step duration and leg height, and ungluing on angle thresholds.
  • 🐦 The enemy's movement can be achieved using a similar setup to the artificial simulation movement behavior called 'BOIDS', which is typically used for flocking birds or fish.
  • 👀 The head and spine of the creature turn to look at the target, which can extend to the chest if the enemy is a turret, and can be used for aiming ranged weapons.
  • 💥 Procedural animation can simulate hit reactions, such as jiggling on impact and impulse that pushes the enemy back.
  • 🧵 Cloth, fur, hair, skin, or ooze can be animated using a cloth simulation to deform the mesh, enhancing visual fidelity without extra logic.
  • 🔧 Procedural methods can blend with pre-made animations during attacks, providing simulated follow-through information and enhancing gameplay dynamics.

Q & A

  • What is procedural animation and how does it benefit game development?

    -Procedural animation is a technique used to automatically generate real-time animations with diverse actions. It benefits game development by saving time and resources, and providing a more dynamic look when set up correctly.

  • What are some common uses of procedural animation in games?

    -Common uses include adjusting legs to uneven terrain, turning heads to look at the player, grabbing objects, and simulating ragdoll physics.

  • How does inverse kinematics (IK) contribute to procedural animation?

    -Inverse kinematics uses equations to determine the motion needed to reach a desired position, allowing for more realistic and dynamic movements of limbs and other body parts.

  • What are the two main points in an IK setup?

    -The two main points in an IK setup are a leader and a target goal. The leader is the bone that initiates the movement, while the target goal is the desired position to be reached.

  • How can bend limitations and bone chain effects be used to change the feel and result of an animation?

    -Bend limitations can be set to control how much a bone can bend, and bones down the chain can be made less affected to alter the feel and result of the animation, creating a more unique movement.

  • How can pre-made animations be blended with procedural animations?

    -Pre-made animations can be blended with procedural animations to provide visual feedback and enhance the overall look of the movement, creating a more seamless and lifelike animation.

  • What are the basic steps for applying procedural animation to walking?

    -The basic steps include using inverse kinematics to control the leg, gluing the foot to the ground, creating a target point attached to the body, and moving the target point to adjust the leg's position based on the walking pattern.

  • How does the Boids algorithm influence the movement of enemies in a game?

    -The Boids algorithm, which is typically used for flocking behaviors, can be adapted for enemies to follow basic rules of separation, alignment, and cohesion, allowing them to move naturally and react to the player's actions.

  • What are some additional features that can be added to make the walk of a creature more unique in a game?

    -Additional features include changing the step duration, the height to which the leg is raised, ungluing on angle thresholds, and defining regions around the foot to prevent other feet from stepping inside.

  • How can ragdoll physics be integrated with procedural animation?

    -Ragdoll physics can be blended with procedural animation to create a fluid knockback recovery for creatures, enhancing the realism of attacks and other large, impactful poses.

  • What are some plugins that can assist with procedural animation in Unity?

    -Some helpful plugins for procedural animation in Unity include Final IK, Maga Cloth, and FImpossible Creations, which offer various solvers to aid in the procedural process.

  • How can procedural animation impact the visual fidelity and gameplay of a game?

    -Procedural animation can unlock a new dimension of visual fidelity and enhance gameplay by allowing for dynamic responses to in-game actions, such as adapting to destroyed limbs or integrating with collision hits for a more immersive experience.

Outlines

00:00

🕹️ Procedural Animation in Gaming

This paragraph discusses procedural animation, a technique used to automatically generate real-time animations that are more diverse than predefined animations. It saves time and resources and can be seen in various aspects of gaming, such as character movement, object interaction, and rag doll physics. The technique often employs inverse kinematics (IK) to calculate the motion required to reach a specific position. The paragraph provides a step-by-step guide on how to implement procedural walking using IK, including setting up a leader and target, adjusting for terrain, and blending with pre-made animations. It also touches on pathfinding and the use of the 'boys' steering behavior, which is adapted from flocking birds, for non-flocking entities like enemies in a game. The system allows for dynamic movement and can be applied to various parts of a creature or character, including the head, spine, and limbs, to enhance realism and visual fidelity.

05:02

🎭 Enhancing Visual Fidelity with Procedural Animation

The second paragraph expands on the application of procedural animation beyond just movement, to enhance visual fidelity in gaming. It mentions how procedural methods can be used for non-creature entities, such as humanoid animations, and how they can dynamically adapt to different scenarios like strafing, turning, and specific attack movements. The paragraph also discusses the potential of fully procedural humanoid enemies and the eerie effect of combining a shambling walk with active ragdoll physics. It highlights the adaptability of gameplay to the flexibility of the system, such as a creature compensating for a missing limb or guarding a vulnerable area. The paragraph concludes with a note on the future potential of procedural animation in visual fidelity and gameplay, and recommends some Unity plugins for those interested in implementing such systems.

Mindmap

Keywords

💡Procedural Animation

Procedural animation is a technique used in game development to automatically generate real-time animations for characters or creatures. It allows for a wide range of movements and actions that are not predefined, resulting in more dynamic and diverse character behavior. In the context of the video, procedural animation is used to create more lifelike and adaptable movements for creatures in a game, such as adjusting to uneven terrain or reacting to player actions.

💡Inverse Kinematics (IK)

Inverse kinematics is a method used in 3D animation to determine the motion of a character's limbs or other body parts based on the position of a target. It's a mathematical approach that calculates the necessary joint movements to reach a desired end point. In the video, IK is used to control the leg movements of creatures, allowing them to interact with the environment in a more natural and dynamic way.

💡Leader and Target Goal

In the context of procedural animation, a leader and a target goal are two main points used to define the motion of a character's limbs. The leader is the primary bone or part that initiates the movement, while the target goal is the point the character is trying to reach. For example, if a character is reaching for a cup, the hand is the leader and the cup is the target goal. This concept is used in the video to explain how procedural leg movements are coordinated.

💡Bend Limitations

Bend limitations refer to the constraints placed on the movement of a character's limbs to prevent unrealistic or awkward bending. These limitations can be adjusted to change the feel and result of the animation, making it more natural or stylized as desired. The video discusses how bend limitations can be set to affect how much the bones down a limb's chain are influenced by the movement, contributing to the overall look and feel of the creature's walk.

💡Blending Animations

Blending animations is the process of combining different animations or animation techniques to create a seamless and smooth transition between actions. In the video, blending is mentioned as a way to integrate pre-made animations with procedural ones to provide visual feedback and enhance the realism of the creature's movements.

💡Pathfinding

Pathfinding is an algorithmic technique used in game development to calculate the shortest or most efficient path between two points, often used for non-player characters (NPCs) to navigate a game environment. The video discusses a custom pathfinding solution that allows enemies to be placed in any scene and navigate dynamically, without requiring a pre-baked navigation mesh.

💡BOIDS

BOIDS is a behavioral simulation method used to model the movement of flocking birds, fish, or other animals. It follows three basic rules: separation, alignment, and cohesion, which dictate how individual members of a group move in relation to each other. In the video, a similar setup to BOIDS is used for the movement behavior of game enemies, allowing them to pursue the player in a natural and group-like manner.

💡Detection and Steering

Detection and steering are mechanisms used in game AI to enable characters to perceive their environment and navigate around obstacles. The video describes using ray casts or sphere casts to detect objects between the enemy and the player, and then steering the enemy around these obstacles to find the path of least resistance.

💡Ragdoll Physics

Ragdoll physics is a simulation of the way a lifeless body falls and moves, often used in games to create realistic reactions when a character is hit or killed. The video discusses blending ragdoll physics with procedural animation to add a layer of realism to how creatures react to being hit or attacked.

💡Clothing and Deformation

Clothing and deformation refer to the simulation of how clothing, fur, hair, skin, or other flexible materials move and change shape in response to the character's actions or external forces. The video mentions using cloth simulation to deform the mesh of a character, which can greatly enhance the visual fidelity and realism of the animation.

💡Dynamic Movement

Dynamic movement is the concept of allowing characters to move and react in a more fluid and less scripted manner, which can lead to more engaging and realistic gameplay. The video discusses using procedural animation to enable dynamic movement for humanoid characters, allowing for more varied and adaptable actions during gameplay.

💡Visual Fidelity

Visual fidelity refers to the quality and realism of the visual presentation in a game, including the accuracy of animations, textures, and lighting. The video suggests that when procedural animation is done right, it can unlock a new dimension of visual fidelity that may surpass the quality of traditional AAA animation.

Highlights

Procedural animation is used to automatically generate real-time animation with more diverse actions than predefined animation.

Procedural animation saves time and resources and looks more dynamic when set up correctly.

Common uses of procedural animation include adjusting legs to uneven terrain, turning heads to look at the player, and rag doll physics.

Inverse kinematics (IK) is a technique used to determine the motion needed to reach a desired position.

IK uses equations and can be visualized by pulling your hand forward and feeling how your arm moves with it.

Procedural animation setups typically have two main points: a leader and a target goal.

Bend limitations can be set and bones down the chain can be made less affected to change the feel and result of the animation.

Procedural animations can be blended with pre-made animations to give visual feedback in life-like situations.

In Uncharted, character sway with vehicle physics while their seat and hands are pinned, simulating a realistic response.

For procedurally animated walking, inverse kinematics is used to control the leg, with a solver setup built into the engine or an available asset.

The foot is glued to the ground and a target point is attached to the body to control leg movement.

The body is adjusted using the average leg position plus offset and rotated based on the difference between the left and right leg height.

Extra features and conditions can be added to make the walk more unique, such as changing step duration and leg raise height.

Most pathfinding solutions require baking a nav mesh or environmental setup, but the developer wanted a system that works in any scene.

An artificial simulation movement behavior called 'BOYSS' (bird-like objects) is used for the enemy's movement.

BOYSS follows three basic rules: separation, alignment, and cohesion, which help the enemy navigate and avoid obstacles.

The enemy acquires the player as its target and uses detection methods like ray or sphere casts to navigate towards the player.

The head and spine of the creature turn to look at the target, and this can extend down to the chest if the enemy is a turret.

Procedural animation can be used for aiming ranged weapons or limiting attacks that hone in on the player.

The same principles used for the creature's legs can be applied to other parts, such as the head, spine, and tail.

Procedural methods can provide simulated follow-through information for attacks, blending with pre-made animations.

Cloth, fur, hair, skin, or ooze can be simulated with a cloth sim deforming the mesh for visual fidelity.

Procedural animation has been used to bypass strafing animations, idle turning, and allow dynamic movement on certain attacks.

Experiments with fully procedural humanoid enemies are ongoing, with potential for eerie and unique movements.

Ragdoll physics can be blended with collision hits to add recovery that sings well with the environment and force.

The potential of procedural animation is expected to be more evident after a combat focus, as systems will complement each other.

For Unity users, plugins like Final IK, Maga Cloth, and FImpossible Creations are recommended for aiding in the procedural process.