feat(build): add Epic Fight dependency and gradle test setup

- Add Epic Fight via CurseMaven as an implementation dependency and Skill Tree as compile-only
- Pass Epic Fight refmap remapping properties to the run configuration
- Add JUnit 5 test dependencies and enable JUnit platform in the test task
- Ignore reference/ recordings in .gitignore
This commit is contained in:
richard committed 2026-11-29 22:21:26 +01:00
1 parent 018efc206c
commit 3fadf8bd0c
338 files changed
+20222 -1462

No files matched your search

+174
View File
@@ -0,0 +1,174 @@
# Resonant Combat
# ResonantCombat
Minecraft mod that brings Wuthering Waves systems into Minecraft: Resonance awakening, overclock, Resonance Liberation, Tune Break, Forte tree, signature weapons. Working title.
## Targets
- First: Minecraft 1.20.1, Forge, for the Casket of Reveries (TCoR) pack. Epic Fight 20.14.16.
- Later: 1.21.1 NeoForge/Fabric, 1.21.10, possibly Epic Fight 2 on NeoForge 26.2.
- Scope order: Resonance layer first (awakening, overclock, Liberation, Tune Break, Forte). Weapons come later.
## Architecture
Two layers. Keep them apart.
- `core/` is pure Java 17. No `net.minecraft`, `net.minecraftforge` or `yesman.epicfight` imports. Time is passed in as a tick number. Everything here must be unit-testable with plain JUnit.
- Packages: `util`, `context`, `awakening`, `overclock`, `energy`, `tune`, `status`, `forte`, `weapon`. Root: `Attribute`, `ResonanceState`, `ResonanceConfig`.
- Forge layer wraps the core: capabilities, NBT, networking, commands, config, Epic Fight integration, datapack loaders. Nothing in it makes game-rule decisions the core could make.
- The core must stay reusable for the NeoForge/Epic Fight 2 port (data attachments and payloads replace capabilities and packets there).
## Game design (source of truth for mechanics)
Tags: **Decided**, **Leaning**, **Open**. Numbers marked "starting value" are placeholders, not balance. Do not invent mechanics or numbers that are not written here. Ask when something is missing.
### Elements and Resonance state
- **Decided.** A player joins with no element and gains one through play. There are six elements (the `Attribute` enum): spectro, aero, fusion, havoc, electro, glacio.
- **Decided.** Which element a player gets is decided by context signals (what is happening around them), scored with datapack weight tables. Code: `context` package (`Signal`, `ResonanceContext`, `WeightTable`, `WeightedScorer`). Examples: a crowd of mobs or chaos points to havoc, Aether or Valkyrie content points to aero.
- `ResonanceState` holds: element (null until the first awakening), rank, awakening count, capped awakening history, stability, scarring, load, overclock stage, ticks in overclock, and a dirty flag. Planned additions: energy, the Forte tree, the signature item id and a discovered flag.
- `AwakeningRecord`: attribute, outcome, causeId, gameTime, awakeningNumber. Planned: archetypeId.
### Awakenings
- **Decided.** The first awakening (outcome `FIRST`) gives the element and fixes the Forte archetype. **Open:** the trigger. Leaning towards guaranteed and story-like.
- **Decided for TCR** (see `TCR_INTEGEATION.md`): killing the Land Tower guardian gives Spectro to every participant. **Done:** generic datapack awakening rules (`data/<ns>/awakening_rules/`), so the base mod's own trigger can use the same system later. Base mod (no TCR): still open.
- **Decided.** Second and later awakenings are rare, hidden and not plannable. The game never announces the chance. Chance = `baseChance × intensity × overclockMultiplier × r^(n-1)`, where n is the number of awakenings so far and r is below 1, so each awakening is rarer than the last.
- **Decided.** Overclock raises that chance significantly, and nothing tells the player.
- **Decided.** The context element decides the outcome. A different element is `SWITCH` (a permanent change of element). The same element is `STRENGTHEN` (rank goes up and the existing element features get stronger).
- **Decided.** Element switching exists only in the TCR pack. In the base mod it is disabled (one element at a time, `SWITCH` replaces it as before).
- **Decided.** In the TCR pack, the first awakening is given by the first Battle Tower guardian fight in the story (Brass-Amber BattleTowers golem), not by the tutorial golem. Which tower comes first in the story is **not verified**. Which element it gives is **Open**.
- **Decided.** Unlocked elements and switching, like Rover in Wuthering Waves, exist only in the TCR pack. A config flag `elementSwitching` (default off) controls it. Off: `SWITCH` replaces the element permanently. On: `SWITCH` adds the element to the unlocked set and the player picks the active one. The archetype never changes. Liberation follows the active element. **Open:** the switching limit (cooldown or out of combat only), and what `STRENGTHEN` does per element. Details in `TCR_INTEGRATION.md`.
- **Decided.** TCR hook (optional, only when `tcrcore` is installed): the story fires awakenings through a generic datapack trigger rule plus a small optional TCR datapack, with no Java dependency on TCR Core. In TCR the first awakening is Spectro, given at the first fight against the Land Tower guardian. Everything TCR-specific is in `TCR_INTEGRATION.md`, not here. Without TCR, the first-awakening trigger stays open.
- Code: `awakening` package (`AwakeningMath`, `AwakeningResolver`). The random source is injected (`util.Rng`), so tests are deterministic.
### Overclock
- **Decided.** Four stages: `NONE`, `STRAIN`, `OVERCLOCK`, `COLLAPSE`. They are driven by load, softened by Rabelle stability and worsened by scarring. Hysteresis stops the stage flickering at a boundary. `effectiveStability()` combines stability and scarring.
- **Decided.** Overclock is dangerous and normally avoided. Warnings are diegetic (effects, sounds, visuals). There is no exact bar.
- **Open:** the numbers and the exact formulas. The Overclock and Rabelle lore pages were not verified.
### Status effects
- **Decided.** One per element: Havoc Bane, Aero Erosion, Electro Flare, Spectro Frazzle, Glacio Chafe, Fusion Burst. These six are the first set. More are added later, not now. Code: `status` package (`StatusRule`, `StatusStacks`). **Open:** exact effects and stacking.
- **Decided: Spectro Frazzle** (after WuWa): stacking status, flat Spectro damage per tick, each tick removes one stack. Its damage ignores armor and element resistance and never fills the Off-Tune gauge.
- **Done** (`core/status/FrazzleModel`, `damage/SpectroFrazzle`, damage type `resonantcombat:spectro_frazzle`). Starting values (`ResonanceConfig.Frazzle`): max 10 stacks, tick every 1 s for 0.25 × stacks (10 stacks ≈ 13.75 over 10 s), basic hit +1 (once per 0.5 s per attacker), Epic Fight non-basic hit (weapon skill, special attacks) +3. Also ignores shields, enchantments and the hurt cooldown; no knockback, no anger; kill credit to the last applier. Debug: `/resonance frazzle <n>`. Game test `spectroFrazzleTicksThroughArmor`.
- **Leaning (owner said "idk", starting value):** which hits apply stacks (above). In-memory only.
### Forte
- **Decided.** The Forte archetype is chosen at the first awakening from the awakening context and stays through later awakenings. After a `SWITCH` the Forte adapts to the new element. After a `STRENGTHEN` it stays the same and becomes stronger.
- **Decided.** The first Forte is procedurally generated. Save node ids, never seeds.
- **Decided.** Tree layout: five columns (Resonant Strikes, Signature Bond, Forte Core, Liberation, Rabelle Stability) and a bottom row (Element Mark, Tune Break).
- **Decided.** One shared, modular tree. Unlocked elements do not get their own trees. The element only changes the payload (status effect, visuals, Liberation payload).
- **Decided.** Shape follows the Wuthering Waves Forte screen (reference screenshot: five vertical columns, a bottom row of two round nodes):
- Each column has one **upgradeable node** (a diamond with a level, Lv x/10 in the reference) at its base. These are the modular part. They are picked from the `NodePool` by archetype and can change in idea between archetypes.
- Above it, the column continues with **fixed, non-upgradeable nodes** (two small bonus nodes and a locked top node in the reference). These are the later unlocks. They keep the same idea for every player and every archetype, and they are never levelled.
- The bottom row (Element Mark, Tune Break) is also fixed and never levelled.
- Levels survive an element switch. Only the payload changes.
- **Decided.** The Resonance Liberation a player gets is determined by archetype × element.
- TCR scope (see `TCR_INTEGEATION.md`, Kit): for the pack, no separate Resonance Skills and six Liberations, one per element. Archetype × element above stays the base mod's design.
- **Decided.** The Forte is one shared, modular tree, not one tree per element. Its nodes are upgradeable and the upgrades belong to the player, so they survive element switching.
- **Decided.** Unlocking an element adds fixed nodes (Element Mark, status effect, Liberation payload). They are not upgradeable and their idea never changes. Only the active element's fixed nodes are in effect.
- **Leaning.** Unlocked elements: the player keeps a set of unlocked elements and picks the active one, like Rover in Wuthering Waves. This changes the earlier rule that `SWITCH` replaces the element for good: `SWITCH` now adds an element to the set, and choosing the active one is a separate action. Switching needs a cooldown or out-of-combat only, and the archetype stays fixed. Liberation follows the active element (archetype × element). **Open:** cooldown value.
- **Leaning.** Archetypes: Vanguard, Skirmisher, Marksman, Channeler, Warden. Archetype decides the Liberation shape, element decides the payload. **Open:** the final list, and what an element does on its own.
- Code: `forte` package (`ForteArchetype`, `ForteColumn`, `ForteSlot`, `ForteTree`, `ForteNodeDef`, `NodePool`, `AffinityProfile`, `ForteGenerator`, `ForteMath`).
### Signature weapon
- **Decided.** After the first Forte exists, a signature weapon is chosen from a datapack tag. Matching uses weapon type and substats, with no damage numbers. Holding it gives stronger Forte buffs (the Signature Bond column). The state stores the item id and a discovered flag.
- **Decided.** Weapon profiles are datapack-driven and WuWa-like: substats, passives, bonuses, rarity 1 to 5 stars. Weapons without a profile get their stars from Minecraft rarity (see Hard rules).
- Code: `weapon` package (`StatType`, `WeaponProfile`, `SignatureMatcher`, `SignatureBonus`).
- **Open:** how a player's element and a weapon's element interact.
### Tune Break
- **Decided.** Based on the Off-Tune mechanic of Wuthering Waves 3.0. Each mob has a gauge. Hits from an awakened player fill it. A full gauge makes the mob Mistuned for a window. A Tune Break on a Mistuned mob consumes the window. Tune Break is also a bottom-row Forte node.
- **Decided.** Six animation types: sword, broadblade, gauntlets, pistols, rectifier, bow. Spear and trident count as sword. Each animation is 1.4 s (28 ticks), a dash through the target, and the player is untouchable while dashing.
- **Decided.** Animation lookup order: exact item id override, then Epic Fight weapon category, then the sword fallback. Mapping is datapack JSON.
- **Decided.** Flow: key press, then the server checks (awakened, a Mistuned mob in front, free to act, cooldown), then plays the animation. The hit that lands multiplies damage and consumes the window. A Tune Break hit never adds buildup.
- Server-only gauge, not synced. No bar, in line with the diegetic rule. Clients only see a Mistuned mob effect.
- Starting values: gauge 100, at most 25% of the gauge per hit, Mistuned 200 ticks, decay starts 100 ticks after the last hit at 0.5 per tick, Tune Break damage ×2.0, 40-tick cooldown, 8-block range.
- **Open:** whether an unawakened player can Tune Break. Current assumption: no.
- Code: `tune` package (`TuneBreakType`, `OffTuneParams`, `OffTuneState`, `OffTuneModel`, `TuneBreakResult`, `TuneBreakLookup`).
### Weapons and movesets (deferred until the Resonance layer works)
- **Decided.** The moveset belongs to the weapon, not the character. Every new weapon gets its own Epic Fight weapon type, because every moveset is unique.
- **Decided.** Rover: Bloodpact's Pledge (sword) only for Aero and Spectro Rover, a custom broadblade for Havoc Rover, custom gauntlets for Electro Rover. **Open:** Glacio and Fusion. Havoc Rover plays like a fast, efficient longsword. In Dark Surge she uses a giant scythe with a fast moveset.
- **Decided.** Winter Brume weapons: Emerald of Genesis uses Yangyang's moveset, Lustrous Razor Jiyan's, Static Mist the Lux & Umbra moveset (Galbrena), Abyss Surges Jianxin's, Cosmic Ripples Yinlin's. Kumokiri uses Chisa's moveset (it works like giant scissors).
- **Decided.** Lux & Umbra become two separate items with their own models and need their own pistol class. OBJ meshes are preferred over block models for detail.
- Reference workflow: screen-record the move at 30 fps, convert frames to ticks (tick = frame × 2/3), then rebuild the animation by hand in Blockbench.
### The Casket of Reveries (TCR) pack
- **Decided.** Awakening triggers are generic datapack rules (on killing an entity, gaining an advancement, and so on). They need no TCR Core code. The TCR story hook is an optional preset datapack on top, active only when `tcrcore` is installed. Never depend on TCR Core's Java classes (it is mixin-heavy and changes between versions).
- **Decided.** In the TCR story, the first resonance awakening fires in the first golem fight. This applies only to the TCR story.
- **Open.** Which fight that is. Likely the Training Golem (TCR's tutorial entity, `tutorial_passed` flag), not verified. Which element it gives, since no Angel or Eye exists yet at that point. Where the archetype comes from, since the tutorial forces everyone to dodge and parry.
- **Leaning.** Later in the story each Eye of God maps to an element, so other Eyes can unlock elements for the switch set. Boss and element leans are in the Awakening Map doc and are not verified.
- TCR Core tracks story progress per player with flags such as `tutorial_passed`, `*EyeKilled` (abyss, cursed, desert, flame, mech, monst, storm, void), `isAllEyeKilled`, `finalBossKilled`. The main questline is driven by Java in TCR Core, not by the FTB quest chapters.
## Hard rules
- Save by string id, never by enum ordinal. Every enum that is saved has an `id()` and a `byId()` returning `Optional`.
- Version the NBT (data version field). Cap history lists. Call `clampAll()` after loading.
- Capabilities: copy in `PlayerEvent.Clone` (`reviveCaps`), sync on login, respawn and dimension change. The server is authoritative.
- Tuning numbers live in records or datapack JSON, not scattered literals. Defaults are starting points, not balance.
- No exact meters for overclock. Warnings are diegetic (effects, sounds, visuals).
- Stars for weapons come from Minecraft `Rarity` (Common 2 to Epic 5), read from a fresh unenchanted stack. Exception: wooden weapons are 1 star. A weapon can also be given its own star rating through a datapack, which overrides both rules.
## Epic Fight 20.14.16 (checked against the 20.14.16 tag source)
- Register animations on the mod bus: `AnimationManager.AnimationRegistryEvent`, then `event.newBuilder(MODID, builder -> ...)` and `builder.nextAccessor("path", accessor -> new ...)`. One builder per namespace.
- Animation file path: `assets/<modid>/animmodels/animations/<registry path>.json`. Tune Break uses `biped/tune_break/<type>`.
- Export animations from Blockbench (`epicfight-blockbench-add` plugin) in matrix format. The loader also detects attributes format.
- No `Coord` track is fine: Epic Fight takes movement from the `Root` track. `AttackAnimation` defaults to `TRACE_TARGET_DISTANCE`, which stops in front of the target. Use `MoveCoordFunctions.RAW_COORD` for lunge-through attacks.
- For players, Epic Fight calls vanilla `attack` with an `EpicFightDamageSource`, so `LivingHurtEvent` sees it and `getAnimation()` names the animation.
- Not verified: whether a dedicated server reads clips from a mod's `assets` folder. If a server cannot find a clip, mirror it under `data/<modid>/animmodels/animations/`.
- The GitHub 1.20.1 branch head is newer than 20.14.16. Do not assume its API matches.
## Animations and assets
- Original animations only. No ripped Wuthering Waves assets (models, textures, audio, animation data).
- Epic Fight's own assets are all rights reserved. Use them as reference only. Never copy them into this repo.
- Animation timing: Blockbench timeline at 20 fps (one tick = 0.05 s). Tune Break is 1.4 s (28 ticks).
- Before every export, check that the last frame returns to the idle pose. Blockbench holds the last position value of a channel that has no key at the end (Root height, Tool_R position and the legs bit us before). Only the Root's forward travel may differ.
- Tune Break types: sword, broadblade, gauntlets, pistols, rectifier, bow. Spear and trident count as sword.
## Working agreement
Assumption, edit if wrong: the owner writes the code. Default to explaining, reviewing and proposing small diffs. Do not generate whole classes or large refactors unless asked. Point out risks (save format, sync, Epic Fight version differences) before they are written.
- Say what you could not verify. Do not present unbuilt code as tested.
- Do not commit or push unless asked. The remote is a private Gitea repository.
## Commands
Assumes the standard ForgeGradle setup. Adjust if the project differs.
- Build: `./gradlew build`
- Run client: `./gradlew runClient`
- Run dedicated server: `./gradlew runServer`
- Tests: `./gradlew test`
## Open decisions
Details sit in the design section above. Collected here:
- Trigger of the first awakening (leaning guaranteed and story-like).
- Whether an unawakened player can Tune Break (current assumption: no).
- Final Forte archetype list, and what an element does on its own.
- Player element versus weapon element coupling.
- Rover weapons for Glacio and Fusion.
- Overclock numbers and formulas, status effect details.
- Epic Fight 2 asset pipeline and release status.
-
Forge 1.20.1 (47.4.10) mod on top of Epic Fight 20.14.16. `core/` is pure Java 17 (no Minecraft imports, JUnit-tested); everything Forge/Epic Fight lives outside it.
- Build/test with Java 17: `JAVA_HOME=/usr/lib/jvm/java-17-openjdk ./gradlew test` (Gradle 8.1.1 does not run on the default Java 21).
- In-game tests (Forge GameTest, `gametest/`): `JAVA_HOME=/usr/lib/jvm/java-17-openjdk ./gradlew runGameTestServer` — exits non-zero if one fails.
- Tuning numbers live in `ResonanceConfig.defaults()`.
## Future work (not now)
- **Rework mob HP scaling for combat.** Vanilla/modded mob health is too low for Tune Break to matter: a regular hit chain kills most mobs before the Off-Tune gauge fills, and a Tune Break on a 20 HP mob is just a kill. Mobs need more HP (or damage scaling) so that filling the gauge and landing a Tune Break becomes the important part of a fight. When this happens, re-balance the Tune Break damage (`tuneBreakBonusDamage`, `tuneBreakMaxHealthFraction`, `tuneBreakMaxHealthCap` in `ResonanceConfig.OffTune`) and the gauge gain/decay together with it.