Skip to content

🏮 Phototaxie et orbite nocturne autour des sources de lumière ​

📌 Clause de non-responsabilité relative au code source : La documentation de ce Wiki reflète l'état actuel du code source dans le dépôt, incluant d'éventuels commits récents non publiés sur CurseForge ou 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)

☕ Note du développeur: Si vous appréciez les nuées de chauves-souris en 3D réaliste fertilisant vos cultures avec leur guano, soutenez mon travail sur Ko-fi !


🌙 L'effet papillon de nuit (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.


📐 Mathématiques des vecteurs tangentiels ​

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: Nuées 3D BOIDs et cinématique | Chasse aux nuisibles et piqué

Official documentation & web portal for Dasik Igaijinn mods.