2D Inverse Kinimatics and BOIDS with Obstacle Avoidance

C#, Inverse Kinimatics, BOIDS, Unity 3D, Realtime Simulation

This project contains two simulations, the first is a 2D Inverse Kinematics simulation that was implemented using a Cyclic Coordinate Descent(CCD) method on a multi-arm armature reaching for two different target points. In addition to the base IK system, I implemented configurable angle limits for the armature's joints and collision with external objects. The second simulation uses the BOIDs flocking algorithm with an additional goal and collision avoidance force to direct the movement of groups of AI agents.

Project Details

  • Category: Game Development, Inverse Kinematics, Group movement, Local Object Avoidance, Graphics, 3D Simulation, Unity
  • Date: Fall 2023
  • Technologies: C#, Unity 3D, Pathfinding, 3D Rendering

How to Run

  • 1.) Click on the Download the Project button
  • 2.) Download the latest executable from the Github Releases Page
  • 3.) Click the executable to play the game
  • 4.) Check out the project's source code on Github

Highlighted Features

Multi Limb IK 2D Armature

This simulation uses the Cyclic Coordinate Descent method to implement Inverse Kinematics along a multi-limb armature. The armature consists of a series of connected bones that end in two separate limbs with end effectors that are reaching towards two different goal points in the scene.

Angle Limits and Collision

In addition to the CCD IK driving the armature, the simulation also includes angle constraints that can be defined for each joint. Collisions between the armature and obstacles were also implemented using a simple line and circle intersection test.

BOIDS Flocking Simulation

The second simulation uses the BOIDs flocking algorithm to drive the movement of agents in a 3D environment. BOIDS uses a series of forces between nearby units to simulate intelligent group movement.

Collision Avoidance and Goal Force

In addition to the normal forces included in BOIDs, I also implemented two additional forces. A goal force, directing the agents towards a goal position on the map, and a collision avoidance force. That force pushes agents away from objects in the scene they are moving towards in order to steer the agents around obstructions.