# Architecture Diagram

The diagram below provides a high-level overview of the Motion's architecture.

{% @mermaid/diagram content="graph TD
InputLayer --> CharacterLayer
CharacterLayer --> Logic & State
Logic & State --> Output & Effects" %}

{% @mermaid/diagram content="graph TD
subgraph "Input Layer (Enhanced Input)"
direction LR
InputActions\["Input Actions (IA\_Move, etc.)"] --> InputMappingContext\["Input Mapping Context (IMC\_Motion\_KBM/Controller)"]
InputMappingContext --> MotionInputComponent\[C++: MotionInputComponent]
end

```
subgraph "Character Layer"
    direction TB
    MotionCharacter["BP: B_MotionCharacter / C++: MotionCharacter"]
    MotionCharacter -- Contains --> MotionCMC[C++: MotionCharacterMovementComponent]
    MotionCharacter -- Contains --> MotionASC[C++: MotionAbilitySystemComponent]
    MotionCharacter -- Contains --> MotionCam[C++: MotionCameraComponent]
    MotionCharacter -- Contains --> MotionAnim[C++: MotionAnimInstance]
    MotionCharacter -- Contains --> BPComponents["BP: Movement Components (BPC_Walk, BPC_Sprint, etc.)"]
    MotionCharacter -- Contains --> SoundComponent[BP: BPC_MovementSoundComponent]
end

subgraph "Logic & State"
    direction LR
    MotionInputComponent -- Sends Input --> BPComponents
    BPComponents -- Trigger Abilities --> MotionASC
    MotionASC -- Applies --> GameplayEffects["Content: Gameplay Effects (GE_IsSprinting)"]
    GameplayEffects -- Modifies State --> MotionCMC
    GameplayEffects -- Modifies State --> MotionAnim
    MotionCMC -- Uses --> MovementCurves["Content: Curves (Curve_WalkAcceleration)"]
end

subgraph "Output & Effects"
    direction TB
    MotionAnim -- Drives --> SkeletalMesh[Character Mesh]
    MotionCam -- Controls --> PlayerView[Player Camera View]
    MotionCam -- Uses --> CameraCurves["Content: Curves (Curve_SprintShake)"]
    SoundComponent -- Plays --> Sounds["Content: Sounds (DT_MovementSounds)"]
    MotionAnim -- Triggers --> SoundComponent
end

subgraph "Game Framework"
    direction LR
    GameMode["BP: B_MotionGameMode / C++: MotionGameMode"] -- Spawns --> MotionCharacter
    PlayerController[C++: MotionPlayerController] -- Possesses --> MotionCharacter
end

style MotionCharacter fill:#lightblue,stroke:#333,stroke-width:2px
style BPComponents fill:#lightgreen,stroke:#333,stroke-width:1px
style GameplayEffects fill:#lightgreen,stroke:#333,stroke-width:1px
style MovementCurves fill:#lightgreen,stroke:#333,stroke-width:1px
style CameraCurves fill:#lightgreen,stroke:#333,stroke-width:1px
style Sounds fill:#lightgreen,stroke:#333,stroke-width:1px
style MotionInputComponent fill:#eee,stroke:#333,stroke-width:1px
style MotionCMC fill:#eee,stroke:#333,stroke-width:1px
style MotionASC fill:#eee,stroke:#333,stroke-width:1px
style MotionCam fill:#eee,stroke:#333,stroke-width:1px
style MotionAnim fill:#eee,stroke:#333,stroke-width:1px" %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kia.dev/motion/tutorials/architecture-diagram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
