# tranek/gasshooter architecture

> Architecture diagram of the GitHub repository tranek/gasshooter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tranek/gasshooter
- Repository: https://github.com/tranek/gasshooter

## Overview

##### Project type and purpose
- GASShooter is a UE4 sample game project (FPS/TPS) built on the GameplayAbilitySystem (GAS) plugin.
- It demonstrates advanced GAS techniques: equippable weapons, ability batching, targeting (TargetActors/Reticles), custom GameplayEffects, attribute sets, GameplayCues, UI integration, AI, and replication.

##### File structure
- Root files:
- GASShooter.uproject – ties together modules, plugins, content.
- Config/Default*.ini – engine/game/editor configuration.
- LICENSE, README.md
- Content/ – all game assets, organized by functional domains:
- FPWeapon – reusable weapon materials, meshes, textures
- GASShooter – Blueprints (GameMode, Characters, Abilities, UI, Items, Weapons, Maps, Effects)
- InfinityBladeFireLands & ShooterGame – third-party Epic assets used for visuals/audio
- Source/ – C++ code split into two modules:
- GASShooter (runtime)
– Public/ & Private/ folders with core game classes: GameModeBase, PlayerController/State, Characters, AbilitySystemComponent, Abilities, AttributeSets, GameplayCueManager, Weapons, Items, AI, UI Widgets
- GASShooterEditor (editor-only targets)
- Build scripts & target files: .Target.cs, .Build.cs

##### Pulling insights from the README
- Confirms UE4.27 + GAS plugin, not production ready but a rich learning sample.
- Enumerates key GAS concepts covered and input bindings.
- Shows mapping of weapons to abilities (Primary, Secondary, Alternate).

##### Main components
a. Unreal Engine Core & Editor
b. GAS Plugin Subsystem (AbilitySystemGlobals, ASC, GameplayAbility, GameplayEffect, GameplayCue)
c. GASShooter Runtime Module
– GameModeBase
– Player Subsystem: PlayerController → Character (GSCharacterBase) → AbilitySystemComponent → AttributeSets
– Abilities & AbilityTasks (GA_*, AsyncTask*, GSAT_*)
– Weapons & Projectiles (GSWeapon, GSProjectile)
– Items & Pickups (GSPickup)
– AI (GSHeroAIController)
– UI (GSHUDWidget, DamageText, StatusBar, Reticles)
d. Content Assets (Blueprints & DataAssets)
– Drive configuration and tuning of C++ systems
e. Config & Build Scripts (initialization)
f. External Modules (ShooterGame, InfinityBlade assets)

##### Relationships & interactions
- Startup: Editor/Engine reads uproject → loads GAS plugin + GASShooter module → reads Config.
- At runtime:
1. GameModeBase spawns PlayerController
2. PlayerController possesses GSCharacterBase
3. GSCharacterBase houses an AbilitySystemComponent (ASC)
4. Player input → invokes ASC to activate GameplayAbilities (Primary/Secondary/Alternate)
5. GameplayAbilities issue GameplayEffects against AttributeSets → modify Health/Mana/Stamina/Ammo
6. GameplayCues trigger VFX/SFX & update UI Widgets
7. Physics & Projectiles handled by GSProjectile, collisions feed back into GAS via GameplayEffects
8. Pickup actors (GSPickup) apply Effects on overlap
9. AIController uses ability and movement components to drive NPC behavior
- Blueprint assets mirror and extend C++ classes for rapid iteration.

##### Architectural patterns & design principles
- Modular C++ modules for runtime vs. editor
- Component-based (Actors + Components, esp. AbilitySystemComponent)
- Data-driven: Blueprints/DataAssets configure C++ systems
- GAS pipeline: Input → GameplayAbility → GameplayEffect → AttributeSet → GameplayCue
- Separation of concerns: Input/Controller, GameLogic (GASShooter module), Presentation (UMG/Blueprints), Assets (Content)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Engine Layer
    subgraph "Engine Layer"
        UProject["GASShooter.uproject"]:::engine
        UE4Core["UE4 Engine Core"]:::engine
        GASPlugin["GAS Plugin"]:::engine
        ConfigENG["DefaultEngine.ini"]:::engine
        ConfigGame["DefaultGame.ini"]:::engine
        ConfigInput["DefaultInput.ini"]:::engine
    end

    %% Game Module Layer
    subgraph "GASShooter Runtime Module (C++)"
        Module["GASShooter Module"]:::module
        BuildScripts["Build & Target Files"]:::module
        GameMode["GameModeBase"]:::module
        PC["PlayerController"]:::module
        Character["GSCharacterBase"]:::module
        ASC["AbilitySystemComponent"]:::module
        Abilities["GameplayAbilities & Tasks"]:::module
        Effects["GameplayEffects"]:::module
        Attr["AttributeSets"]:::module
        CueManager["GameplayCueManager"]:::module
        Weapons["GSWeapon"]:::module
        Projectiles["GSProjectile"]:::module
        Pickups["GSPickup"]:::module
        AI["GSHeroAIController"]:::module
        UI["UI Widgets & HUD"]:::ui
    end

    %% Asset Layer
    subgraph "Content Assets (Blueprints & DataAssets)"
        ContentG["Content/GASShooter"]:::assets
        CharAssets["Characters"]:::assets
        WeapAssets["Weapons"]:::assets
        ItemAssets["Items/Pickups"]:::assets
        UIAssets["UI"]:::assets
    end

    %% External Asset Modules
    subgraph "External Asset Modules"
        IB["InfinityBladeFireLands"]:::external
        SG["ShooterGame"]:::external
    end

    %% Runtime Flow
    UProject -->|loads| GASPlugin
    UProject -->|loads| Module
    GASPlugin --> Module
    Module --> GameMode
    GameMode --> PC
    PC --> Character
    Character --> ASC
    ASC --> Abilities
    Abilities --> Effects
    Effects --> Attr
    Effects --> CueManager
    CueManager --> UI
    Abilities --> Weapons
    Weapons --> Projectiles
    Pickups --> Effects
    AI --> Character

    ContentG -.-> GameMode
    CharAssets -.-> Character
    WeapAssets -.-> Weapons
    ItemAssets -.-> Pickups
    UIAssets -.-> UI
    IB -.-> ContentG
    SG -.-> ContentG

    %% Click Events
    click UProject "https://github.com/tranek/gasshooter/blob/master/GASShooter.uproject"
    click ConfigENG "https://github.com/tranek/gasshooter/blob/master/Config/DefaultEngine.ini"
    click ConfigGame "https://github.com/tranek/gasshooter/blob/master/Config/DefaultGame.ini"
    click ConfigInput "https://github.com/tranek/gasshooter/blob/master/Config/DefaultInput.ini"
    click Module "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/GASShooter.Build.cs"
    click GameMode "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/GASShooterGameModeBase.h"
    click PC "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Player/GSPlayerController.h"
    click Character "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Characters/GSCharacterBase.h"
    click ASC "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Characters/Abilities/GSAbilitySystemComponent.h"
    click Abilities "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Characters/Abilities/GSGameplayAbility.h"
    click Effects "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Characters/Abilities/GSGameplayEffectTypes.h"
    click Attr "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Characters/Abilities/AttributeSets/GSAttributeSetBase.h"
    click CueManager "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Characters/Abilities/GSGameplayCueManager.h"
    click Weapons "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Weapons/GSWeapon.h"
    click Projectiles "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Weapons/GSProjectile.h"
    click Pickups "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/Items/Pickups/GSPickup.h"
    click AI "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/AI/GSHeroAIController.h"
    click UI "https://github.com/tranek/gasshooter/blob/master/Source/GASShooter/Public/UI/GSHUDWidget.h"
    click ContentG "https://github.com/tranek/gasshooter/tree/master/Content/GASShooter/Blueprints"
    click IB "https://github.com/tranek/gasshooter/tree/master/Content/InfinityBladeFireLands"
    click SG "https://github.com/tranek/gasshooter/tree/master/Content/ShooterGame"

    %% Styles
    classDef engine fill:#AED6F1,stroke:#2980B9,color:#1B2631;
    classDef module fill:#A9DFBF,stroke:#27AE60,color:#1B2631;
    classDef assets fill:#F9E79F,stroke:#B7950B,color:#1B2631;
    classDef ui fill:#F5B7B1,stroke:#C0392B,color:#1B2631;
    classDef external fill:#D7BDE2,stroke:#8E44AD,color:#1B2631;
```
