🏮 Fototaksis & Mengitari Cahaya di Malam Hari
📌 Pernyataan Sumber Repositori: Dokumentasi di Wiki ini mencerminkan kondisi kode sumber terkini di repositori, yang mungkin memuat komit atau fitur pengembangan yang belum dirilis di CurseForge atau Modrinth.
| Parameter | Specification Details |
|---|---|
| AI Goal Class | net.vanillaoutsider.betterbats.ai.BatHuntLightGoal |
| Detection Light Level | Block Light > 8 (LIGHT_DETECT_THRESHOLD) |
| Continue Light Level | Block Light > 6 (LIGHT_CONTINUE_THRESHOLD) |
| Search Radius | 10 blocks (Deterministic BlockPos.findClosestMatch) |
| Search Throttle | Executes light search once every 30 ticks (~1.5s) |
| Orbit Duration | 200 to 600 ticks ($10 - 30\text{ seconds}$) |
| Goal Cooldown | 200 to 400 ticks ($10 - 20\text{ seconds}$) |
| Approach Mode | Curved banking flight vector ($d > 2.5\text{ blocks}$) |
| Orbiting Mode | Tangential velocity vector with sine-wave vertical bobbing |
| Visual Particles | CRIT (10% tick probability during orbit) |
☕ Catatan Pengembang Solo: Jika Anda menyukai kawanan kelelawar 3D BOIDs yang realistis dan pemupukan tanaman otomatis dengan guano, dukung karya saya di Ko-fi!
🌙 Efek Ngengat (The Moth Effect)
At night, bats are attracted to artificial light sources (torches, lanterns, campfires, sea lanterns). When within 10 blocks of a valid light block with Block Light > 8, BatHuntLightGoal activates. Bats approach the light and transition into smooth circular orbits.
📐 Vektor Fisika Orbit Tangensial
The orbital velocity vector is calculated perpendicularly to the radial position vector $\vec{r} = \vec{P}{\text{bat}} - \vec{P}{\text{light}}$:
$$\vec{V}{\text{tangent}} = \frac{(-r_z, 0, r_x)}{|\vec{r}|} \times v{\text{orbit}}$$
A sine-wave vertical modulation adds organic natural bobbing:
$$V_y = A \sin(\omega t)$$
