Skip to content

Boids movement

Simulates flocks movement.

Authors and contributors to this experimental extension: planktonfun, D8H.


Simulates swarms or flocks movement following the separation, alignment, cohesion principles. The flock can be attracted to a location or avoid some obstacles.

The Fish School example shows how properties impact on the movement.

Read more...

Tip

Learn how to install new extensions by following a step-by-step guide.

Boids Movement

Move as part of a flock.

Behavior actions

Avoid an object
Intend to avoid an area from an object center and a given radius.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (👾 Object): Avoided object
  • Parameter 3 (🔢 Number): Radius
  • Parameter 4 (🔢 Number): Decision weight

Technical note: parameter 5 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::AvoidObject.

Avoid a position
Intend to avoid an area with a given center and radius.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Center X
  • Parameter 3 (🔢 Number): Center Y
  • Parameter 4 (🔢 Number): Radius
  • Parameter 5 (🔢 Number): Decision weight

Technical note: parameter 6 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::AvoidPosition.

Move in a direction
Intend to move in a given direction.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Direction X
  • Parameter 3 (🔢 Number): Direction Y
  • Parameter 4 (🔢 Number): Decision weight

Technical note: parameter 5 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::MoveInDirection.

Move toward an object
Intend to move toward an object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (👾 Object): Targeted object
  • Parameter 3 (🔢 Number): Decision weight

Technical note: parameter 4 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::MoveToObject.

Move toward a position
Intend to move toward a position.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Target X
  • Parameter 3 (🔢 Number): Target Y
  • Parameter 4 (🔢 Number): Decision weight

Technical note: parameter 5 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::MoveToPosition.

Alignment sight radius
Return the alignment sight radius.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetAlignmentRadius.

Alignment weight
Change the weight the alignment takes in the chosen direction.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetAlignmentWeight.

Cohesion sight radius
Change the cohesion sight radius.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetCohesionRadius.

Cohesion weight
Change the weight the cohesion takes in the chosen direction.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetCohesionWeight.

Maximum acceleration
Change the maximum acceleration of the object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Steering Force

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetMaxAcceleration.

Maximum speed
Change the maximum speed of the object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Max Speed

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetMaxSpeed.

Separation sight radius
Return the separation sight radius.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetSeparationRadius.

Separation weight
Change the weight the separation takes in the chosen direction.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::SetSeparationWeight.

Behavior conditions

Object Rotated
Check if the object is rotated while moving on its path.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🧩 Behavior

Technical note: parameter 2 is an internal parameter handled by GDevelop.

Technical note: this condition internal type (in GDevelop JSON) is BoidsMovement::BoidsMovement::ShouldRotate.

Behavior expressions

Expression Description
Object.BoidsMovement::AlignmentRadius() Return the alignment sight radius.
Object.BoidsMovement::AlignmentWeight() Return which weight the alignment takes in the chosen direction.
Object.BoidsMovement::CohesionRadius() Return the cohesion sight radius.
Object.BoidsMovement::CohesionWeight() Return which weight the cohesion takes in the chosen direction.
Object.BoidsMovement::MaxAcceleration() Return the maximum acceleration.
Object.BoidsMovement::MaxSpeed() Return the maximum speed.
Object.BoidsMovement::SeparationRadius() Return the separation sight radius.
Object.BoidsMovement::SeparationWeight() Return which weight the separation takes in the chosen direction.
Object.BoidsMovement::Speed() Return the current speed.
Object.BoidsMovement::VelocityX() Return the current horizontal speed.
Object.BoidsMovement::VelocityY() Return the current vertical speed.

This page is an auto-generated reference page about the Boids movement extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.