combatoverhaul

a mod to create the new combat as you wished

Combat Overhaul Next —— Animation and Action System Tutorial
================================================
Applicable version: COH 0.1.0 (Minecraft 1.20.1 / Forge 47.x), requires DamageOverhaul (DOH)
Last updated: 2026-11-28

Before You Start
--------
1. All configuration is located at: <game directory>/config/combatoverhaul_next/
2. In-game commands all start with /con; after editing actions/classes/tree/Montage/state graph, save/recompile.
3. Before changing configuration, it is recommended to back up the entire config/combatoverhaul_next directory.
4. The actions in this mod are a "server-side action library + client-side presentation": action JSON must be loadable by the server before the client can synchronize and play it.
5. Self-check: if the build log shows CoreCheck PASS (13 groups, 722 checks), everything is normal.


I. Common Commands Overview
----------------
/con help                     Show editor commands
/con edit                     Open the model/animation workbench (recommended starting point)
/con classes                  Weapon animation class editor (weapon classification/five grip actions/stances/combos)
/con tree                     Action tree editor (can add unlimited groups/action nodes)
/con montage                  Montage editor (segmented actions + blend overlap)
New commands: /con events event graph editor; /con graph Scratch-style action connection graph.
Each Montage segment has "segment sound/segment particle" buttons; inline segment events are triggered at segment offsets during compilation.

/con dohconfig                DamageOverhaul configuration editor
/con models                   Model resource browser
/con render on|off            Toggle player model rendering path

Server commands:
/combatoverhaulnext reload    Reload the action library (after modifying actions/*.json, montages.json)
/combatoverhaulnext actions   View loaded actions
/combatoverhaulnext action <id>  Play an action (for debugging)


II. Making an Animation for the First Time (Model Browser + Timeline)
----------------------------------------
1) Enter /con edit to open the model workbench.
2) The player model is loaded by default; you can also open other models from the model browser.
3) At the bottom is the action timeline:
   - Action id: defaults to con:editor_action
   - Duration: total ticks of the action (20 ticks = 1 second)
   - Current frame: 0 ~ duration-1
   - ◀ / ▶: previous frame/next frame
   - Play/Pause: advance by tick and preview with linear interpolation
   - Record Pose: record the current model pose (rotation + translation) to the current frame
   - Delete Frame: delete all keyframes of the current frame
   - Save Action: write actions/<id>.json and automatically reload
   - Action Tree: jump to the action tree editor
4) Workflow:
   Frame 0 → select a bone (left panel/click the model) → left-click drag or arrow keys to pose
   → Record Pose → switch to frame 10 and continue posing → Record → Play preview → Save Action
5) Shortcuts:
   F Frame view              X Reset selected bone       Shift+X Reset all
   Ctrl+Z Undo               P Toggle rotation/translation mode   T Real pose/stored pose
   H Hide selected bone      Shift+H Show all
   Ctrl+E Export disassembled action  Ctrl+S Save action       Ctrl+O Load action by id
   Ctrl+H Add hitbox         Ctrl+Shift+H Delete current frame hitbox
   Ctrl+I Add iframe         Ctrl+Shift+I Delete current frame iframe
   Ctrl+K Add cancel window    Ctrl+Shift+K Clear cancel window
   Ctrl+J Add sound event    Ctrl+Shift+J Add particle event   Ctrl+L Delete current frame event
6) Timeline scale:
   Orange = has keyframes; Red = hitbox; Blue = iframe; Green = cancel window; Yellow = sound/particle event.


III. Action JSON Format (for manual writing/fine-tuning)
--------------------------------
File: config/combatoverhaul_next/actions/<file name>.json
Minimal example:

{
  "format": 1,
  "id": "con:my_slash",
  "name": "my slash",
  "duration": 12,
  "loop": false,
  "staminaCost": 18.0,
  "cancel_from": 8,
  "cancel_to": 11,
  "fade_in": 4,
  "fade_curve": "smoothstep",
  "interpolation": "catmull_rom",
  "root_motion": [0.0, 0.0, 1.5],
  "channels": [
    {"bone": "right_arm", "keys": [
      {"tick": 0,  "rot": [-20, 0, 0], "pos": [0,0,0], "scale": [1,1,1]},
      {"tick": 3,  "rot": [-70, 0, 0], "pos": [0,0,0], "scale": [1,1,1]},
      {"tick": 8,  "rot": [25, 0, 0],  "pos": [0,0,0], "scale": [1,1,1]}
    ]}
  ],
  "hitboxes": [
    {"name":"blade","bone":"right_arm","from":3,"to":6,
     "offset":[0,0,0],"size":[8,8,8],"multiplier":1.0,"poise":1.0,"impact":1.0}
  ],
  "iframes": [
    {"from":0,"to":3,"full":true,"block_custom":true}
  ],
  "events": [
    {"tick":3,"type":"sound","value":"minecraft:entity.player.attack.sweep"},
    {"tick":6,"type":"particle","value":"crit"}
  ]
}

Field descriptions:
- id: unique action id; con: prefix is recommended
- loop: set true for looping actions (stances/idle); attacks are generally false
- cancel_from/cancel_to: tick window in which early cancellation is allowed; -1/omitted = none
- fade_in/fade_curve: number of ticks for action start crossfade and weight curve (linear/smoothstep/ease_in/ease_out)
- interpolation: keyframe interpolation linear / catmull_rom / step; toggle with Ctrl+T on the timeline
- root_motion: root displacement of the entire action (blocks); the server evenly distributes it per tick across the actor over duration
- reverse: when true, the entire action plays in reverse (keyframes/hitbox/iframe/events synchronously reversed); toggle with Ctrl+R on the timeline
- channels[].bone: bone name or semantic name; rot is Bedrock ZYX Euler angles, pos is model pixels
- hitboxes: bone/from/to/offset/size/multiplier/poise/impact
- iframes: invincibility window; block_custom=true only blocks hitboxes from this mod
- events: when type=sound, value is the sound id; when type=particle, supports
  crit/damage/sweep/flame/smoke/explosion

Note: actions are read when the server starts. After modifying JSON, execute /combatoverhaulnext reload.


IV. Action Tree (/con tree)
-----------------------
Purpose: organize actions by group; you can add unlimited groups and action nodes; it is not a runtime state machine.
Operations:
- New Group / New Action: add under the currently selected group
- Delete: delete the current node and its child nodes (the root node cannot be deleted)
- Move Up/Move Down: adjust order under the same parent node
- Name / Action id: edit in the input boxes on the right and save
- Edit Action: open the model timeline with that action id; if the file does not exist, a new empty action will be created
- Save Action Tree: write config/combatoverhaul_next/action_tree.json

Recommended structure:
Action Tree
  Group: Straight Sword
    Action: con:sword_slash
    Action: con:sword_finisher
  Group: Greatsword
    Action: con:greatsword_swing


V. Montage Segmented Actions (/con montage)
------------------------------------
Purpose: combine multiple actions in sequence into one action, with overlap (blend) between segments for transitions.
Operations:
- Create/delete Montages in the left list
- Add segment/delete segment/move up/move down on the right
- After selecting a segment, you can change the action id and blend
- Edit segment action: open that action's timeline
- Save: write config/combatoverhaul_next/montages.json
- Recompile: save and execute /combatoverhaulnext reload

JSON example:
{"montages":[{
  "id":"con:combo_2hit",
  "name":"two hit combo",
  "sections":[
    {"action":"con:my_slash","blend":0,"curve":"linear"},
    {"action":"con:my_finisher","blend":4,"curve":"smoothstep"}
  ]
}]}

Compilation rules: each segment's keyframes/hitbox/iframe are merged with start = previous segment end - blend;
within the overlap window, the client also uses `ClientMontageRuntime` to sample both the previous and next segments simultaneously and blend by curve weight (runtime dual player),
while the server still runs the compiled result for hit detection. When interrupted by a new action, the common 4-tick crossfade is used.
The result is a normal ActionDef that can be bound by weapon classes/action tree and reuses existing synchronization and hit resolution.
curve supports linear/smoothstep/ease_in/ease_out/constant (curve input box for each segment in the Montage editor).


VI. Animation State Graph (/con states)
--------------------
Purpose: configure conditional transitions for player animation states + the action bound to each state.
File: config/combatoverhaul_next/anim_state_graph.json
Default states: idle / walk / attack / stun / dead
Conditions: moving !moving attacking !attacking stunned !stunned dead !dead always
State actions (optional, written in states):
{
  "states": {
    "idle": {"enter":"con:idle_in", "loop":"con:stance_one_handed", "exit":"con:idle_out"},
    "walk": {"loop":"con:walk_loop"}
  }
}
- On entering a state, enter plays first (one-shot), then loop plays (looping); when no attack action is running, it is overlaid on the whole body
- While an attack action is running, state actions yield, and return after the attack ends
- Editing actions/state rules is all done in /con states; the states field can be directly edited in JSON and reloaded
Operations:
- Fill in from / to / condition at the bottom → add rule
- Delete selected (deletes the last entry)
- Save / Restore Defaults / Reload
- After saving, the runtime automatically uses the new graph (client)

Default rules:
idle -> walk if moving
idle -> attack if attacking
idle -> dead if dead
walk -> idle if !moving
walk -> attack if attacking
walk -> dead if dead
attack -> idle if !attacking
stun -> idle if !stunned
dead -> dead if always


VII. Weapon Animation Classes (/con classes)
-----------------------------
Purpose: manually classify weapons into animation classes; weapons in the same class share actions/stances/combos; no automatic classification by tag.
Operations:
- Create/delete class on the left
- Two toggles on the right: two_handed (allow two-handed), dual_wield (allow dual-wield base state)
- Five grip action fields: right_two_handed / right_one_handed / dual_wield /
  left_two_handed / left_one_handed
- combos field format: action>next>window;...
- stance / walk_stance / aim_scale: idle action, full-body walk action, pitch aim strength
- Item list click selection: manually add/remove from class; an item belongs to only one class
- Complete five-state template: fill actions, default combos, five grip default stances
- Save: write bindings.json and automatically reload
- More detailed five-grip stances are configured in JSON's weapon_classes.<class>.stances


VIII. Key bindings.json Fields
--------------------------
config/combatoverhaul_next/bindings.json

default                 Default attack action
items/tags              Bind actions by item/tag (may include grip_actions)
weapon_classes          Animation classes: items, two_handed, dual_wield, actions, combos, stances
class_overrides         Manually move an item to another class
grip_actions            Global grip actions
two_handed              Global two-handed item list
combos                  Global combos
contexts                Context actions
stances/aim_scale       Global stances/aim

default key bindings: V+left click/right click to toggle base state and left/right two-handed; offhand attack defaults to mouse 4.

Action resolution order:
item+grip → item action → class actions[grip] → tag+grip → tag action →
global grip_actions → default
Stance resolution order:
item override → tag override → class grip stances → class flat stance → global grip stances → global stance


IX. Multiplayer Notes
----------------
- Action definitions are synchronized by the server action library; if the client lacks a definition, it will pull it, but the action JSON must first be loaded on the server.
- Stance/aim/two-handed states are synchronized via protocol v10; attack actions carry hand.
- The server calculates damage only after accepting a hit, and returns the actual damage via ActionHitResultPacket.
- Everyone needs to install COH and DOH; if versions are out of sync, first enter the game and check whether action ids are pulled.


X. Combat Pipeline (for understanding)
----------------------
1. The attacking client uses the real pose to determine hits and sends ActionHitPacket(action,target,hitbox,clientTick,hand)
2. Server validation: action is running, hand/action match, hitbox is active on that tick, within 12 blocks, no duplicate hit
3. The server uses the weapon snapshot to run the full DO damage chain, applying health/poise/impact
4. The server returns ActionHitResultPacket (actual damage, remaining health, rejection reason) and broadcasts hit effects
5. Cancel window: within the action JSON's cancel_from/cancel_to, early startup is allowed; outside the window, the server returns busy
6. Presentation: action crossfade 4 ticks; stance/aim/events are overlaid by the client


XI. File Locations Quick Reference
------------------
config/combatoverhaul_next/
  bindings.json               Weapon classes/action bindings/combos/stances/key bindings
  actions/*.json              Actions
  action_tree.json            Action tree
  montages.json               Montage
  anim_state_graph.json       Animation state graph
  bindings.json.bak           Automatic backup by weapon class editor
  (DOH configuration is in config/damageoverhaul/)


XII. FAQ
--------------
Q: After saving an action, there is no response in game?
A: Check the save log and /combatoverhaulnext reload; on a multiplayer server, the server owner needs to execute reload.

Q: The action plays but the model does not move?
A: The bone names in the action channels must match the model bone names/semantic names; check the log
   "[CON] client action overlay ... missingBones=...".

Q: The animation I made looks wrong on other players' screens?
A: Everyone's action library must have the same action id; weapon class configuration only affects local selection,
   multiplayer presentation states are synchronized, but action content requires the server action library.

Q: Stance does not display?
A: The weapon class must be configured with stances or stance; if walk_stance is not configured, walking only overlays the upper body.

Q: Cancel window does not work?
A: The server returns busy when the action has not reached the cancel window; use -Dcon.probeHitTickOffset only to verify hits,
   for cancel windows use the action JSON's cancel_from/cancel_to.

Q: Cannot find the action after Montage compilation?
A: Check the server log for montage compiled/montage references unknown action; actions referenced by segments must already be loaded.


XIII. Probe/Unattended Testing (for development)
--------------------------------
con_launch.py supports the following parameters (examples):
  -Dcon.probe=true
  -Dcon.probeScreen=editor|classes|tree|montage|states|dohconfig|browser
  -Dcon.probeAnimAuthoring=true       automatically record two frames + events and save the action
  -Dcon.probeClassesTemplate=true     save weapon class template
  -Dcon.probeTreeAdd=true            automatically create group + action in action tree and save
  -Dcon.probeMontageAdd=true         automatically create two segments in Montage and compile
  -Dcon.probeStatesAdd=true          save default rules in state graph
  -Dcon.probeRequestAction=con:xxx   request to play an action
  -Dcon.probeRequestAction2=con:yyy  request a second action after 5 ticks (crossfade verification)
  -Dcon.probePitch=45 / -Dcon.probeAimDebug=true  pitch aim/hitbox debugging
  -Dcon.probeHitTickOffset=30        forge a hit frame to verify server rejection
  -Dcon.probeCombo=true / -Dcon.probeComboDelay=15  combo/cancel window


XIV. Current Limitations (Next Layer)
------------------------
1. State action enter/exit are currently client-side overlays; there is no server-side state machine participating in hit detection yet.
2. Montage dual-player already supports overlap blending/interruption, but there is no reverse playback/segment-level event graph yet.
3. The event graph is currently a JSON node chain, and there is no visual node editor yet; events are still timeline rows.
4. Animation tangents only go up to catmull_rom/step; per-keyframe custom tangents are not implemented.
5. Hits are still confirmed by the attacker; there is no lag compensation/rollback.

Recommended order: event graph visualization → reverse playback/segment-level events → hit rollback.

combatoverhaul Team

profile avatar
  • 2
    Projects
  • 520
    Downloads

More from ZeroChen