Arvutiteaduse instituut
Courses.cs.ut.ee Arvutiteaduse instituut Tartu Ülikool
  1. Kursused
  2. 2025/26 sügis
  3. Arvutigraafika (MTAT.03.015)
EN
Logi sisse

Arvutigraafika 2025/26 sügis

  • Main
  • Lectures
  • Practices
  • Projects
  • Test
  • Results
  • Links

Procedural Animation

Patrick Tiit Raal, Artjom Geimanen, Juhan Oskar Hennoste

Description

The goal of this project is to create a 2D game, where the player character's movement is driven by a procedural system, akin to a game called Rain World. Rather than achieving animations through traditional keyframes, they would be math-driven, applying trigonometry and inverse kinematics. The player inhabits and moves around a handcrafted level. The playable character is a creature, more specifically a spider, which is good for demonstrating the procedural animation systems.

Final Release

Repository: https://github.com/p4triko/CG-2025-Project-Procedural-Animation

Latest release build can be downloaded here: https://github.com/p4triko/CG-2025-Project-Procedural-Animation/releases/latest

Online version: https://grmseven.itch.io/cg-2025-project-procedural-animation

Video:

Core features

  • Custom nodes for the editor, to easily create IK skeletons with constraints. Has physics interpolation, texture mapping, debug drawing, can have multiple anchor points.
  • Procedurally animated playable spider character. Uses raycasting to determine where to step.
  • Worm-like creatures that use FABRIK.
  • Creature that is generated using L-system.
  • A small environment for the character to move around in.

Introduction

What is procedural animation?

Imagine the time of old Disney animations, artists would draw each of the characters movements and actions by hand. Nowadays we have new and different solutions for animating such as animation software. The point is that animations are mostly pre-made, either done by traditional ways or utilizing motion capture. Our goal is to avoid that and achieve these results in-game during gameplay by generating them procedurally.

Inverse kinematics

A very popular term found in procedural animation. To put it briefly, it's a process of determining the correct motion for a limb/joint to reach the desired goal.

This article gives a much broader explanation of the methods covered.

Tools used

  • Godot (version 4.5.1).
  • Aseprite, for drawing the sprites.

Development

First we started building a basic structure for our workflow, basically gathering reference material and doing a bunch research related to our topic.

Click here to see the upper section containing our planning and research material.

Originally planned features:
• More constraint types for IK system
• System that creates a smooth path from nodes, can be used for drawing something over the nodes
• Sprite mapping for the nodes
• A way to smoothly move anchors
• Path finding algorithm for creatures

We ended up not needing smooth path creation, because it looked good without them. And path finding, because we didn't make any freely moving creatures.

Systems:

IK system

This is a node simulation system that can be used to make rigs, that can later be used with some simple logic to make procedurally animated creatures. Implemented as Godot nodes, so they can be placed manually or through code.
Any node can be an anchor, so its position will be locked and wont be affected by constraints. It has two constraints right now: First constraint uses FABRIK IK for keeping nodes together. Second is an angle constraint, which lets to choose how nodes are allowed to rotate, used for sideways limbs and to prevent node overlapping. It should be easy to add any additional constraints if needed.
Has physics interpolation implemented. It allows to calculate physics in a lower framerate, but still look as smooth as users monitor refresh rate. Physics frame rate can be as low as 20fps and still look good.

L-system

Simple implementation of L-system. It can make branches with variable length. Can have multiple independent rules. (Has separate rules for main branch and for side branches).

Palette swapping shader

A palette swapping shader that allows for dynamically changing the color palette of the game, to give different areas a bit of variety in visual identity and mood. Each color in the palette can be changed independently at runtime.

Creatures

Big focus in this project were the procedural creatures. Creatures, that were implemented were the spider, that serves as the playable character, for the non-controllable characters that reside in the environment, we have the worm, the tentacle and the leviathan.

Worm

The worm was the most simple out of all the creatures implemented. The effect is achieved through FABRIK (Forward And Backward Reaching Inverse Kinematics). We have an anchor point which pulls the rest of the body with it, for that we have assigned the head and the worm is treated like a series of points that are connected by distance constraints. For each frame we do 2 passes, a forward and a backward pass. The body we can imagine to be a chain, the forward pass pulls the body towards the head's position, job of the backward pass is to correct all spacing between chain points to ensure that the worm maintains its shape. A more general explanation would be that the we are trying to follow two rules at once, the anchor or the head is pulling the body forward and the segments behind follow it maintaining a fixed distance between each other. In the scene itself they follow a path made up of Bezier curves.

Tentacle

The tentacle works similarly to the worm, again utilizing FABRIK, but there are a few key differences. First off our anchor is locked in place, being the first point in the chain or the part where the tentacle starts. To make it look more like a tentacle, we add waviness with the help sin-waves, basically for each tentacle segment we apply an offset perpendicular (orthogonal) to it's direction. We can also scale the intensity of the offset in terms of amplitude, frequency and speed.

Leviathan

Uses the L-system to create a long creature with multiple appendages. First creates a tree that can branch once from the main stem. Then crates a skeleton with IK nodes, maps gradually shrinking texture, sets angle constraints. Then follows a Bézier curve path.

Spider (player)

Spider has two main parts: legs and body.

Legs constantly raycast for nearby surfaces. Using relative surface position and normal, it determines weight. Weight represents how good of a surface it is for stepping. Then leg checks if the new position is greatly better than current and there currently exists a grounded leg. If both are true, leg steps to the best available position. It forcefully moves the leg if current position is now too far. If there doesn't exist a viable surface, leg switches into a ragdoll state.

Body is trying to maintain some distance from the floor. If there is not a single pair of left and right leg touching the ground, then spider will fall. Player has small coyote time (player stays midair instead of falling for a few milliseconds). It also helps remove jitter if legs loose contact with floor for a small time. Lastly it casts a ray towards it's movement vector and predicts how how it should move vertically to maintain wanted distance from the floor.

The Level (cave)

Early concept for the main level.

The level itself is made up of 4 layers, the first layer being one that the player walk on or the ground and floor layer, the rest are simply background layers stacked on top of each with different z indices. We use Godot's built in Parallax2D in order to create a parallax effect in the cave.

Gallery

Inspector view of SimRoot node. Located at the root of the tree.

Inspector view of SimNode node.

Leviathan with debug rendering enabled. Big circles represent segment length. Small red circle is an anchor.

Rules that are used to generate the Leviathan.

  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Courses’i keskkonna kasutustingimused