> For the complete documentation index, see [llms.txt](https://arawn-software-publishing.gitbook.io/free-flow-combat-for-gc2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arawn-software-publishing.gitbook.io/free-flow-combat-for-gc2/quickstart.md).

# Quickstart

This guide gets the GC2 Free Flow Combat demo running and gives you the recommended weapon-first setup. Use Components.md when you want to understand each script in detail, and GC2VisualScripting.md when authoring Game Creator instructions or Behavior Tree tasks.

### Weapon-First Setup

<figure><img src="/files/BgQFoRXvuqH68SqAKVcV" alt=""><figcaption></figcaption></figure>

The normal path is now simple:

1. Equip `FreeFlow_Brawl_FreeFlowWeapon` on the player with GC2's `Equip Melee Weapon` instruction.
2. Equip the same Free Flow weapon, or another tuned `FreeFlowMeleeWeapon`, on non-player GC2 `Character` enemies.
3. Leave `Auto Setup Non-Player Characters` enabled on the weapon so enemies can receive missing `FreeFlowCombatTarget` and `FreeFlowEnemyAgent` components at runtime.
4. Assign `Assets/Arawn/FreeFlowCombat/Assets/AI/FreeFlow_Enemy_BehaviorTree.asset`, or your own GC2 Behavior graph, to the weapon's `Behavior Graph` field if enemies should auto-receive a GC2 Behavior `Processor`.
5. Trigger `Free Flow Attack` and `Free Flow Counter` from GC2 Actions or input triggers.

The first enabled `FreeFlowEnemyAgent` creates a visible scene-owned `Free Flow Enemy Director (Auto)` if no director exists. Add a director manually only when you want per-encounter tuning.

### Optional Asset & Template Wizard

<figure><img src="/files/7JMz9IMhKDyTMF003O49" alt=""><figcaption></figcaption></figure>

Open `Tools/Arawn/Free Flow Combat/Setup Wizard` from the Unity menu. The window is now only for asset and template work:

* `Start`: shows the weapon-first workflow.
* `Assets`: creates or repairs the default Free Flow weapon and shield.
* `AI Tree`: creates or repairs the editable enemy Behavior Tree template.

The wizard is optional. Use it to create or repair baseline assets and generate the editable enemy Behavior Tree template. It does not prepare scenes, add enemy components, or validate runtime setup. Runtime auto setup handles simple scenes when enemies equip a `FreeFlowMeleeWeapon`; advanced encounters can still be tuned directly in the Inspector.

It can:

* Create or repair `FreeFlow_Brawl_FreeFlowWeapon`.
* Create or repair `FreeFlow_Brawl_FreeFlowShield`.
* Assign the baseline GC2 `Combos` asset for target attack chains.
* Seed fallback attack and counter response instruction lists with editable GC2 instructions.
* Seed counter responses with a close/mid/far/front/side/back `Free Flow Run Instructions By Spatial Context` template.
* Create or rebuild a complete editable `Assets/Arawn/FreeFlowCombat/Assets/AI/FreeFlow_Enemy_BehaviorTree.asset` template.
* Generate one `Free Flow Enemy Play Skill` task per configured Enemy Attack Skill and store the Enemy Attack Weapon on those tasks.
* Rebuild the Behavior Tree template if you want to reset it after experimenting.
* Upgrade old distance-only counter templates to the spatial counter template. The wizard only auto-upgrades a single top-level `Free Flow Run Instructions By Distance` counter instruction unless reference replacement is enabled.

The generated Behavior Tree is a starting point. Assign it to the weapon's `Behavior Graph` field for the quick path, or open it in the GC2 Behavior editor to tune node order and replace tasks as the enemy AI grows.

### Demo Scene

For the fastest path:

1. Open `Assets/Arawn/FreeFlowCombat/Demo.unity`.
2. Press Play.
3. Test the player's attack and counter inputs against the enemies.

If an enemy attack skill or reaction does not appear to play, first check that the enemy Behavior Tree task has a valid Enemy Attack Weapon and Skill, and that the enemy weapon points at the expected GC2 Brawl hit reaction.

### Player Setup

1. Equip `FreeFlow_Brawl_FreeFlowWeapon` on the player with GC2's `Equip Melee Weapon` instruction.
2. Edit `FreeFlow_Brawl_FreeFlowWeapon` to configure targeting, combo input, fallback attack behavior, counter response instructions, visibility filters, and enemy auto-setup defaults.
3. For simple enemy setup, equip `FreeFlow_Brawl_FreeFlowWeapon` on a non-player GC2 `Character` and leave `Auto Setup Non-Player Characters` enabled on the weapon. It adds missing `FreeFlowCombatTarget` and `FreeFlowEnemyAgent` components at runtime, and can add a GC2 Behavior `Processor` when the weapon has a `Behavior Graph` assigned.
4. Trigger `Free Flow Attack` and `Free Flow Counter` from GC2 Actions or input triggers.

Optional notes:

* Targeted attacks default to GC2 `Combos`: Free Flow selects and faces the target, then queues the configured melee input.
* `Skill` assets still own animation, motion warp, phases, strikers, hit logic, and hit reactions.
* `FreeFlowShield` extends GC2 `Shield` behavior for block/parry/break and optional Free Flow parry hooks.
* `Fallback Attack Instructions` run when Attack does not select a normal target inside `Attack Radius`. This is the gap-closer/fallback range, not necessarily a true no-enemy state.
* Distance zones are: inside `Attack Radius` uses normal targeted combos, between `Attack Radius` and `Scan Radius` can run fallback attack instructions with a scanned `Target`, and beyond `Scan Radius` provides no target.
* `Fallback Target` controls whether fallback attack instructions receive a scanned enemy as `Target`. Keep the default directional/closest scanned target if a fallback skill uses GC2 Motion Warp with `Self to Target Location`; set it to `None` for a true whiff.
* Use `Free Flow Input Execute` to explicitly queue a GC2 Melee key through the active Free Flow weapon.
* Use `Free Flow Play Skill` to play one configured GC2 Melee `Skill` through the active Free Flow weapon.
* Use `Free Flow Play Random Skill` to randomly choose from several fallback attack or counter skills.
* Use `Free Flow Run Instructions By Spatial Context` inside `Counter Response Instructions` to build close, mid, far, front, side, and back counters. Manual and shield counters capture distance and signed angle before Free Flow turns the player toward the enemy, then nested instructions keep `Target` as the selected enemy.
* Use `Free Flow Run Instructions By Distance` for simpler close/mid/far branching when facing direction does not matter. The fallback list is the normal place for the far counter if you do not need a maximum far distance.
* `Counter Radius` is separate from normal `Attack Radius`. Keep it large enough for the farthest counter prompt you want to accept; otherwise the distance-branch instruction will never run for those far targets.
* `Counter Interrupt Mode` controls how manual counters interact with an active player combo. The default `Force Cancel Current Skill` gives Arkham-style priority to counter prompts; switch to `Try Cancel Current Skill` to respect each GC2 Skill's cancel windows.
* `Target Indicator Prefab` on the Free Flow weapon is optional and shows the player's current primary target. The default is a ground ring under the enemy footprint. It is separate from `Counter Indicator Prefab`, which belongs to enemies and shows an open counter window above the head.
* `Fallback Candidate Indicator Prefab` is optional and marks the enemy that would receive `Fallback Attack Instructions`. The default is a ground ring and it only appears for candidates outside `Attack Radius` and inside `Scan Radius`.
* `Visibility Filters` on the Free Flow weapon can require attack or counter targets to be inside the main camera view or visible through selected occlusion layers. Leave them disabled for classic forgiving targeting.
* `Enemy Auto Setup` on the Free Flow weapon provides counter indicator, movement, and optional Behavior Graph defaults for non-player characters that equip the weapon and do not already have a tuned enemy agent or Processor.
* Add `FreeFlowLegacyAnimationEventSink` to models that reuse old Jammo/Batman clips with `HitEvent` animation events.

### Indicator Assets

Starter indicator sprites live in `Assets/Arawn/FreeFlowCombat/Assets/Indicators/Sprites/`. Ready-to-use billboard prefabs live in `Assets/Arawn/FreeFlowCombat/Assets/Indicators/Prefabs/`.

* `FFC_Target_Primary_Ground` is the default player target ground ring.
* `FFC_Target_Fallback_Ground` is the default fallback/gap-closer candidate ground ring.
* `FFC_Target_Primary` and `FFC_Target_Fallback` remain available for older overhead/billboard style indicators.
* `FFC_Counter_Window` is the default enemy counter prompt.
* `FFC_Parry_Response` can be used by custom parry/counter response instructions.
* `FFC_Danger_Attack` can be used for non-counterable enemy attack warnings.

### Enemy AI Setup

Enemy AI uses GC2 Behavior plus a small runtime bridge:

* `FreeFlowEnemyDirector` grants attack tokens according to its active-attacker budget. Simple scenes can rely on an auto-created runtime director; add one to an enemy group/root when you want visible encounter tuning. Directors are scene-owned and do not persist across scene loads.
* `FreeFlowEnemyAgent` lives on each enemy and drives GC2 `Character` movement, facing, counter windows, attack-turn state, retreat, and orbit movement. It can be added automatically when a non-player equips a `FreeFlowMeleeWeapon`.
* GC2 Behavior Tree tasks call the custom `Free Flow Enemy ...` visual scripting instructions.
* Enemy attack skills are authored in the Behavior Tree with `Free Flow Enemy Play Skill`, not directly on the visible agent component.
* Counter indicators are visual only. A successful counter must consume an enemy-owned counter window before the weapon runs its counter response.

Weapon-first enemy setup:

1. Equip a `FreeFlowMeleeWeapon` on each non-player GC2 `Character`.
2. Leave `Auto Setup Non-Player Characters` enabled so the weapon can add missing `FreeFlowCombatTarget` and `FreeFlowEnemyAgent` components at runtime.
3. Assign optional `Counter Indicator Prefab` and movement defaults in the weapon's `Enemy Auto Setup` section so auto-created agents inherit them.
4. Assign optional `Behavior Graph` on the weapon if runtime-spawned or simple enemies should receive a GC2 Behavior `Processor` automatically.
5. Optional: add `FreeFlowEnemyDirector` to the parent object that contains the enemy group if you want per-encounter tuning. If no director exists at runtime, the first enabled `FreeFlowEnemyAgent` creates a visible `Free Flow Enemy Director (Auto)` object.
6. Use the wizard only when you want to create or repair the default weapon, shield, and Behavior Tree assets.

Advanced direct tuning:

* Add `FreeFlowEnemyDirector` to an enemy group/root only when that encounter needs custom pacing.
* Add or tune `FreeFlowCombatTarget`, `FreeFlowEnemyAgent`, and a GC2 Behavior `Processor` directly on specific enemies when you want those values visible before Play Mode.
* Assign the Behavior Tree to manually placed Processors with loop `Forever` and update `EveryFrame`.
* Author enemy attacks inside the Behavior Tree with `Free Flow Enemy Play Skill`, `Free Flow Enemy Execute Melee Input`, and `Free Flow Enemy Wait Melee`. The wizard-generated template writes the baseline enemy attack weapon and three baseline combo skills directly into the Play Skill tasks.

Recommended Behavior Tree:

```
Entry
  Selector
    Sequence: Interrupted Cleanup
      Condition: Free Flow Enemy Is Interrupted
      Task: Free Flow Enemy Cleanup

    Sequence: Attack Token
      Condition: Free Flow Enemy Has Attack Token
      Task: Free Flow Enemy Open Counter Window
      Task: Free Flow Enemy Telegraph
      Task: Free Flow Enemy Approach
      Task: Free Flow Enemy Close Counter Window
      Task: Free Flow Enemy Play Skill
      Task: Free Flow Enemy Play Skill
      Task: Free Flow Enemy Play Skill
      Task: Free Flow Enemy Retreat
      Task: Free Flow Enemy Release Attack Token

    Sequence: Idle Combat Movement
      Task: Free Flow Enemy Orbit
```

Expected behavior:

* The director selects available enemies, avoiding the previous attacker when possible.
* By default, `Max Active Attackers` is `1` and `Max Simultaneous Counter Windows` is `1`, so only one enemy attacks and shows a counter prompt at a time.
* Raise `Max Active Attackers` for harder encounters where multiple enemies may attack at once.
* Keep `Max Simultaneous Counter Windows` at `1` unless the encounter intentionally allows multiple counter prompts.
* The selected enemy telegraphs by requesting a counter-window slot, then setting its `FreeFlowCombatTarget` as counterable if a slot is available.
* Player `Free Flow Counter` can select that counterable target.
* A successful counter applies the director's `Post Counter Attack Cooldown` before another attack token is granted.
* The weapon's `Counter Cooldown` and `Counter Interrupt Mode` settings prevent repeated counter responses while a counter skill is resolving. Use `Force Cancel Current Skill` for responsive Arkham-style counters, or `Try Cancel Current Skill` when counters should only happen during GC2 cancel windows.
* Player `Free Flow Attack` or `Free Flow Counter` locks the selected enemy briefly so its AI movement stops while the player attack resolves.
* After attacking, the enemy retreats to its configured retreat distance and releases the attack token.

Runtime director tuning:

* Use `Free Flow Director Set Auto Grant Attack Tokens` to pause or resume automatic attack scheduling.
* Use `Free Flow Director Set Max Active Attackers` to raise or lower how many enemies can own attack tokens at once. Lowering the value does not cancel attackers that already have tokens; it limits future grants.
* Use `Free Flow Director Set Max Counter Windows` to control how many counter prompts can be open at once. Lowering the value does not close windows that are already open.
* Use `Free Flow Director Set Attack Cooldown` to change the regular attack-token delay range. Enable `Reschedule Next Attack` when the new range should replace the currently scheduled next grant.
* Use `Free Flow Director Set Post Counter Cooldown` to change the delay range applied after a successful counter.
* Use `Free Flow Director Set Per Enemy Cooldown` to change how long an enemy waits before it can receive another token.

Attack authoring examples:

```
Single skill:
  Open Counter Window -> Telegraph -> Approach -> Close Counter Window -> Play Skill Punch -> Retreat -> Release Token

Three-hit combo:
  Open Counter Window -> Telegraph -> Approach -> Close Counter Window -> Play Skill 1 -> Play Skill 2 -> Play Skill 3 -> Retreat -> Release Token

GC2 combo input:
  Open Counter Window -> Telegraph -> Approach -> Close Counter Window -> Execute Melee Input A -> Wait Melee -> Execute Melee Input A -> Wait Melee -> Retreat -> Release Token

Custom counter timing:
  Approach -> Open Counter Window -> Wait 0.3s -> Close Counter Window -> Play Skill -> Retreat -> Release Token
```

More AI-specific notes are in `Assets/Arawn/FreeFlowCombat/Assets/AI/README.md`.
