Filter loader...
Filter versions...

Fix a bug with goal priority

v4.1.0

Fix the problem with see-through blocks. Added Player Profile, adding customization to the player detection range. By default, support the Feline origin from the Origin mod.

v4.1.0

  • Fix the problem with see-through blocks.
  • Added Player Profile, adding customization to the player detection range. By default, support the Feline origin from the Origin mod.

v4.0.9

  • Ported v4.0.9 for Forge 1.19.2

v4.0.9

  • Performance fix.

  • Auto config.

v4.0.9

  • Performance Fix
  • Auto config

v4.0.9

  • Performance fix
  • Auto config

v4.0.9

  • Performance fix
  • Auto update config

[1.20.1-4.0.8] - 2025-08-25

Changed

  • Sound switching semantics clarified and updated

    • src/main/java/com/example/soundattract/config/SoundAttractConfig.java
      • soundSwitchRatio now uses multiply semantics with ratio in (0.0–1.0]: switch when newWeight > currentWeight × soundSwitchRatio.
      • Updated comments and bounds; default set to 0.5.
  • Novelty bonus applied consistently to effective weight

    • src/main/java/com/example/soundattract/SoundTracker.java
      • The effective weight returned for the selected sound now includes soundNoveltyBonusWeight during soundNoveltyTimeTicks.
      • The async candidateRecordById mapping also stores novelty-adjusted weight so async-picked IDs honor novelty.
  • Resolve same-soundId ambiguity

    • When multiple candidates share a soundId, keep the one with higher effective weight (including novelty); tie-breaker by closer distance to the mob.
  • Config responsiveness tweaks

    • soundScoringSubmitCooldownTicks default is 1 to make async scoring responsive.

Defaults updated

  • soundSwitchRatio default: 0.5
  • soundNoveltyBonusWeight default: 9.5

Added

  • Off-thread sound scoring integration

    • src/main/java/com/example/soundattract/SoundTracker.java
      • findNearestSound(mob, level, mobPos, mobEyePos, currentTargetSoundId) now builds SoundScoreRequest with:
        • Mob position and time
        • Current target sound ID to enforce switch ratio off-thread
        • List of muffled SoundCandidates (range/weight after block muffling)
        • soundSwitchRatio, novelty bonus and window (from config)
      • Async results drained via WorkerScheduler.drainSoundScoreResults() and cached per-mob.
    • src/main/java/com/example/soundattract/ai/AttractionGoal.java
      • Updated call sites (canContinueToUse(), tick(), findInterestingSoundRecord()) to pass the current target sound ID into SoundTracker.findNearestSound(...).
  • Dynamic configuration keys (accessed via SoundAttractConfig.COMMON.<key>.get()):

    • soundScoringSubmitCooldownTicks (default 5)
    • asyncResultTtlTicks (default 10)
    • raycastCacheTtlTicks (default 200)
    • raycastCacheMaxEntries (default 5000)

Changed

  • Worker scheduler rejection policy

    • src/main/java/com/example/soundattract/worker/WorkerScheduler.java
      • Replaced CallerRunsPolicy with a non-blocking DiscardOldestPolicy-based handler to avoid main-thread stalls when saturated.
      • Added debug logging when tasks are dropped (gated by debugLogging).
  • Per-mob async submission control in SoundTracker

    • Added per-mob maps LAST_SUBMIT_GAME_TIME and LAST_CANDIDATE_HASH.
    • Submissions are skipped if within cooldown, async result is still fresh, and candidate set (incl. current target) is unchanged.
    • Async result TTL and submission cooldown are now read from config.
  • Raycast cache eviction and gating

    • SoundTracker.applyBlockMuffling(...) cache now stores RaycastEntry(result, gameTime).
    • TTL-based expiry and size-based eviction implemented; values read from raycastCacheTtlTicks and raycastCacheMaxEntries.
    • Honors enableRaycastCache to bypass both cache reads and writes when disabled.

Notes

  • All configuration values are looked up dynamically via SoundAttractConfig.COMMON.<key>.get() to reflect live changes.

  • Defaults for the new keys match previous hardcoded behavior for compatibility.

  • Debug logs are gated by SoundAttractConfig.COMMON.debugLogging.get().

  • Added a worker scheduler and refactored mob grouping logic to run heavy math off-thread using snapshots, while applying results on the main thread.

Added

  • Worker pool and DTOs
    • src/main/java/com/example/soundattract/worker/WorkerScheduler.java
      • Bounded daemon thread pool (safe defaults; optional config via SoundAttractConfig.COMMON.workerThreads and COMMON.workerTaskBudgetMs if present).
      • Immutable snapshots: MobSnapshot, ConfigSnapshot.
      • Result queue + GroupComputeResult for leader mapping, edge mobs, deserters.

Changed

  • Group computation off-thread and result application on tick

    • src/main/java/com/example/soundattract/ai/MobGroupManager.java
      • New submitGroupComputeSnapshot(ServerLevel) to build snapshot (main thread) and submit worker task.
      • New applyGroupResult(ServerLevel, GroupComputeResult) to rebuild uuidToLeader, leaders, lastEdgeMobMap, deserterUuids (main thread).
      • updateGroups(ServerLevel) now uses an early-submit pattern; retains previous synchronous path as fallback.
      • Fixed inner class structure for SoundRelay (kept equals/hashCode inside the class).
  • Apply results during server tick

    • src/main/java/com/example/soundattract/SoundAttractionEvents.java
      • In onServerTick(END), drain WorkerScheduler.drainGroupResults() and apply via MobGroupManager.applyGroupResult(...).
      • Preserved existing tick sequence (dynamic cooldown -> sound tracker -> block breaker -> apply group results -> pending goals).

Notes

  • All world/entity/goal access remains on the main thread; only pure computations are off-thread.
  • Config lookups continue to use dynamic access (SoundAttractConfig.COMMON.<key>.get()). Optional worker tunables are read via reflection with safe defaults.
  • Logs are gated behind SoundAttractConfig.COMMON.debugLogging.get().

v4.0.7

  • Simple Voice Chat range adjusts dynamically

v4.0.7

  • Simple Voice Chat range now adjusts dynamically.

v4.0.7

  • Dynamic Simple Voice Chat range.

v4.0.7

  • Enhance the simple voice chat integration by dynamically adjusting the range based on the speaker's volume.

v4.0.6

  • Support PlasmoVoice mod

v4.0.6.

  • Mobs can now break blocks to get to the player or sound source (disabled by default)

  • Support PlasmoVoice mod

v4.0.6

  • Mobs can break blocks to get to the sound/player location (disable by default)
  • Support PlasmoVoice mod.

Project members

Sylsatra

Member

Details

Licensed GPL-3.0-only
Published 6 months ago
Updated 3 days ago