Procedurally Animating Creatures for my Game | Withersworn Devlog
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
🕹️ 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.
🎭 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
💡Inverse Kinematics (IK)
💡Leader and Target Goal
💡Bend Limitations
💡Blending Animations
💡Pathfinding
💡BOIDS
💡Detection and Steering
💡Ragdoll Physics
💡Clothing and Deformation
💡Dynamic Movement
💡Visual Fidelity
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.