-
Notifications
You must be signed in to change notification settings - Fork 0
3D BOIDs Flocking and Steering
| Parameter | Default Value | GameRule Key | Description |
|---|---|---|---|
| Alignment Weight ( |
5 (Scale 0.05) |
better-bats:bat_alignment |
Velocity vector matching weight ( |
| Cohesion Weight ( |
5 (Scale 0.05) |
better-bats:bat_cohesion |
Attraction to flock center of mass ( |
| Separation Weight ( |
10 (Scale 0.10) |
better-bats:bat_separation |
Collision avoidance pushing force ( |
| Flock Size Limit | 5 |
better-bats:bat_swarm_size |
Maximum members in a single flock |
| Hard Altitude Cap | 30 blocks |
Surface Heightmap | Maximum blocks above world surface (WORLD_SURFACE) |
| Night Comfort Zone |
5 to 20 blocks |
Surface Heightmap | Ideal surface elevation range at night |
| Min / Max Flight Speed |
0.15 / 0.35
|
Internal | Velocity magnitude limits (blocks/tick) |
Calculated inside BatFlightHelper.applyFlightForces(Bat bat) for all active, non-resting bats:
Draws individual bats toward the average spatial position (
Aligns the bat's flight heading with the average velocity vector (
Pushes bats away from neighbors closer than 4 blocks (
During twilight hours (Dusk:
-
Alignment Weight: Multiplied by
$\times 2.5$ -
Cohesion Weight: Multiplied by
$\times 2.5$ -
Separation Weight: Reduced by
$\times 0.4$
┌──────────────────────────────────────────────────────────┐ Max Altitude Cap: Surface + 30
│ Downward proportional force applied: -min(0.25, dy*0.05)│
├──────────────────────────────────────────────────────────┤ Night Comfort Zone: Surface + 20
│ Parabolic downward steering │
│ │
│ Optimal Flight Buffer │
│ │
│ Parabolic upward steering │
├──────────────────────────────────────────────────────────┤ Night Comfort Zone: Surface + 5
│ Ground Avoidance: Upward force = (6 - d) * 0.035 │
└──────────────────────────────────────────────────────────┘ Terrain / Fluid Surface
-
Ground & Water Avoidance: Scans 5 blocks downward. If solid terrain or fluid is detected at distance
$d$ , an upward velocity force of$(6 - d) \times 0.035$ is added. -
Ceiling Avoidance: Scans 3 blocks upward. If a solid ceiling is detected at distance
$d$ , a downward force of$(4 - d) \times -0.035$ is added. -
Hard Altitude Cap: If a bat exceeds
$\text{Surface Y} + 30$ , a proportional force scaling up to$-0.25\text{ blocks/tick}$ forces it downwards.
Bats scan a 10-block radius for predatory entities (Cats, Ocelots, Phantoms). If a predator is detected, bats add a flee direction vector scaled by
Better Bats Wiki • Copyright © 2026 Dasik (Rifaditya) • Licensed under GNU GPLv3
📌 The documentation in this Wiki reflects the current source code state in the repository.
- Bat Ecology & Photophobia
- 3D BOIDs Flocking & Math
- Guano Crop Fertilization
- Phototaxis & Light Orbiting
- Pest Control Combat
- Echolocation & Panic
- Chiroptera Genetics
- Dynamic GameRules
- Ambient Spawning Rules
- HUD & Client GUI Config
- Commands & Advancements
- Sounds & Particle Effects
- Troubleshooting & FAQ