Skip to content

🏮 趨光性與夜間燈火環繞巡飛 ​

📌 代碼倉庫原始碼免責聲明:本維基文件反映了倉庫當前的原始碼狀態,可能包含領先於 CurseForge 與 Modrinth 上公開發布版本的最新開發提交或未發布功能。

ParameterSpecification Details
AI Goal Classnet.vanillaoutsider.betterbats.ai.BatHuntLightGoal
Detection Light LevelBlock Light > 8 (LIGHT_DETECT_THRESHOLD)
Continue Light LevelBlock Light > 6 (LIGHT_CONTINUE_THRESHOLD)
Search Radius10 blocks (Deterministic BlockPos.findClosestMatch)
Search ThrottleExecutes light search once every 30 ticks (~1.5s)
Orbit Duration200 to 600 ticks ($10 - 30\text{ seconds}$)
Goal Cooldown200 to 400 ticks ($10 - 20\text{ seconds}$)
Approach ModeCurved banking flight vector ($d > 2.5\text{ blocks}$)
Orbiting ModeTangential velocity vector with sine-wave vertical bobbing
Visual ParticlesCRIT (10% tick probability during orbit)

☕ 獨立開發者寄語:如果你喜歡蝙蝠逼真的三維群飛和鳥糞為莊稼施肥的生態體驗,歡迎在 Ko-fi 上支持我的獨立開發!


🌙 飛蛾效應 (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.


📐 切向旋回向量數學 ​

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)$$


Next: 三維群飛與轉向數學 | 害蟲防治與俯衝戰鬥

Official documentation & web portal for Dasik Igaijinn mods.