Skip to content

Fowl Play

BonsUnleashed edited this page Oct 10, 2026 · 5 revisions

Fowl Play

Minecraft 1.20.1 / Forge: this page documents that build and its measurements. For the separate 205-control Minecraft 1.21.1 port, see Minecraft 1.21.1 NeoForge.

Two controls for Fowl Play 1.1.2+1.20.1-forge (mod id fowlplay): flocking headings are computed in primitive arithmetic, and birds only pick flight targets in chunks that are already loaded. The second one deliberately changes behaviour (a bird retries later instead of loading a chunk); its section explains it. Every switch checks the code it would change against the tested build; another build is left untouched with one WARN line (see How the patches are applied).

Key Target Side Since Kind Result
fowlplay_air_targets_loaded_only Fowl Play 1.1.2+1.20.1-forge BOTH 1.0.13 change 3,394 → 18.8 µs per target search
fowlplay_flock_vectors Fowl Play 1.1.2+1.20.1-forge BOTH 1.0.1 opt 94–99 % less allocation per heading

fowlplay_flock_vectors

Since: 1.0.1 · Scripts (1.0.19 and earlier): bons_and_furious-GuidedFlocking.js, bons_and_furious-LeaderlessFlocking.js Patched: aqario.fowlplay.common.entity.ai.brain.behaviour.GuidedFlocking.getHeading and LeaderlessFlocking.getHeading Mixins (since 1.0.20): GuidedFlockingMixin, LeaderlessFlockingMixin

What upstream did. Both flocking behaviours accumulated a bird's heading through chains of temporary Vec3 objects, several per neighbour, every AI tick.

What the patch does. Accumulates the same arithmetic in primitive doubles, preserving the negate-then-add order, the float reciprocals, the square-root comparison, the getter calls and the six random draws.

What stays the same. AI scheduling, flock caps, spawn settings and every returned heading: all 14,000 headings, 42,000 raw double components and 14,000 subsequent RNG states matched the original bytecode.

Measured. 680–6,680 → 40 B per heading for 7, 24 and 64 neighbours (94–99 % less allocation).


fowlplay_air_targets_loaded_only

Since: 1.0.13 · Kind: deliberate behaviour change · Script (1.0.19 and earlier): furious13-fowlplay.js Patched: aqario.fowlplay.common.util.TargetingUtil (the flight-target search tryFindAir) Mixin (since 1.0.20): TargetingUtilMixin

What upstream did. A flying bird picking a random flight target read the target column (height map plus three block checks) with chunk loading. A target outside the loaded area therefore stalled the server thread until that chunk had been generated. In the normal-play spark that motivated this, birds were 8.7 % of the server thread and 4.6 % of it was waiting on chunk generation.

What the patch does. A target whose chunk is not already loaded is treated as unusable, so the bird simply retries later. Only the flight-target search changed; the water, ground, perch and non-air searches share the pattern but were not measured as a problem and are unchanged. The patch inserts instructions rather than rewriting the method, so Fowl Play's lambdas are untouched.

Deliberate difference. Birds no longer choose flight targets in unloaded chunks. In practice they stay within the loaded area around players, which is where they could be seen anyway.

Measured (full-pack world A/B). 3,394 → 18.8 µs per target search; 400 searches loaded 29 → 0 chunks.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.38

Compatibility

Controls by mod

Links

Clone this wiki locally