-
Notifications
You must be signed in to change notification settings - Fork 0
Leader Follower and Flocking
Rifa edited this page Aug 9, 2026
·
1 revision
| Component | Specification |
|---|---|
| Member Interface | net.dasik.social.api.group.GroupMember |
| AI Goal | net.dasik.social.ai.goal.FollowLeaderGoal |
| Flock Types |
FlockType.TERRESTRIAL, FlockType.AERIAL
|
| Boids Strategies |
TerrestrialFlockingStrategy, AerialFlockingStrategy
|
Dasik Library implements generalized Boids Flocking Math (Craig Reynolds model) optimized for Minecraft pathfinding. Entities implementing GroupMember automatically coordinate group movement, leader following, and spatial separation.
The combined steering force vector
Where:
-
$\vec{V}_{\text{separation}}$ pushes entities apart to prevent crowding. -
$\vec{V}_{\text{cohesion}}$ pulls entities toward the group center of mass. -
$\vec{V}_{\text{alignment}}$ aligns entity headings. -
$w_{\text{sep}}, w_{\text{coh}}, w_{\text{ali}}$ are configurable weights inGroupParameters.
public record GroupParameters(
float cohesionRadius,
float separationRadius,
float maxSpeed,
boolean canTeleport,
float teleportDistance,
float startDistance,
float stopDistance,
float alignmentWeight,
float cohesionWeight,
float separationWeight
) {
public static final GroupParameters DEFAULT_AERIAL = new GroupParameters(
3.0f, 1.0f, 0.4f, true, 144.0f, 6.0f, 2.0f, 0.05f, 0.05f, 0.1f
);
public static final GroupParameters DEFAULT_TERRESTRIAL = new GroupParameters(
5.0f, 1.5f, 1.2f, true, 144.0f, 6.0f, 2.0f, 0.0f, 0.0f, 0.0f
);
}Adding flocking AI to a custom entity:
public class CustomBirdEntity extends PathfinderMob implements GroupMember {
private LivingEntity leader;
@Override
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(4, new FollowLeaderGoal<>(this, GroupParameters.DEFAULT_AERIAL, 32.0D));
}
@Override public LivingEntity getLeader() { return this.leader; }
@Override public void setLeader(LivingEntity leader) { this.leader = leader; }
@Override public FlockType getFlockType() { return FlockType.AERIAL; }
}
Dasik Library | Social AI & Infrastructure Engine
Developed with โค๏ธ by Dasik (Rifaditya) | Licensed under LGPL-3.0
๐ Documentation reflects active repository source code state.
- Hive Mind Social System
- Social Scheduler & Events
- Animal Genetics Engine
- Genetics API & Pedigree
- Genetics Loot Modifiers
- Leader Follower & Flocking
- Dynamic GameRules Manager
- GameRule Codec & Serialization
- Client GameRule & GUI Helpers
- Dynamic Enchantments & Vision
- Stochastic & Math Utilities
- Stale Attribute Purging & Scale
- ModVersionGuard & Startup Safety
- Developer Setup & Building
- Architecture & Package Layout
- Mixin Reference & Hooks
- Behavior Profiles & Conditions
- Consumer Mods Integration Guide