This repository contains a Unity 6 third-person prototype focused on adaptive gameplay. The current project combines memory-driven NPC interactions, boss combat that reacts to player behavior, and locally persisted difficulty tuning. Everything runs locally in C# without cloud services or external AI APIs.
- A main gameplay scene at
Assets/Scenes/HubArea.unity - Relationship-based NPC dialogue using in-memory interaction history
- Adaptive boss combat with combo reading, parry and dodge windows, and phase pressure
- Player combat with light/heavy attacks, parry, flashy attack, ultimate, and roll
- Runtime combat analytics that adjust difficulty based on player performance
- Local persistence for the player's adaptive combat profile
- Runtime-generated HUD elements for player and boss combat feedback
- Unity Editor
6000.3.10f1 - Universal Render Pipeline
- Unity Input System
- Unity AI Navigation
- C# gameplay scripts
AI-NPC-Unity-Game/
├── Assets/
│ ├── Animations/ # Combat and character animation assets
│ ├── Audio/ # Audio content
│ ├── BrokenVector/ # Environment and imported dungeon assets
│ ├── Materials/ # Materials and rendering assets
│ ├── Models/ # Character, weapon, and environment models
│ ├── Prefabs/ # Player, camera, and gameplay prefabs
│ ├── Rallba/ # Imported boss/character asset pack
│ ├── Resources/ # Runtime-loadable configs
│ ├── Scenes/ # Main Unity scenes
│ ├── Scripts/
│ │ ├── Core/ # Initializers and memory manager
│ │ ├── NPC/ # NPC dialogue and boss entry logic
│ │ ├── Player/ # Movement, combat, health, weapons
│ │ ├── Systems/Combat/ # Adaptive combat, analytics, difficulty
│ │ ├── Systems/Dialogue/ # Dialogue data and rule helpers
│ │ ├── Systems/Events/ # Event bus and combat event types
│ │ ├── Systems/Learning/ # Combo tracking and counter logic
│ │ ├── Systems/Persistence/ # Local save helpers
│ │ └── UI/ # Dialogue, HUD, and death screen UI
│ ├── Settings/ # URP and rendering settings
│ └── Textures/ # Texture assets
├── Packages/ # Unity package manifest and lockfile
├── ProjectSettings/ # Unity project settings
├── Library/ # Unity-generated local cache
├── Logs/ # Unity-generated logs
└── UserSettings/ # Unity editor user settings
Assets/Scripts/Core/GameInitializer.cskeeps shared systems alive across scenesAssets/Scripts/Core/NPCMemoryManager.csstores relationship score and interaction history per NPCAssets/Scripts/NPC/NPCController.cschanges responses based on personality, relationship state, and recent interactionsAssets/Scripts/UI/DialogueUIController.csdisplays prompts and dialogue lines
Assets/Scripts/Systems/Combat/CombatSystemBootstrap.csauto-creates core combat systems at runtimeAssets/Scripts/NPC/BossAIController.cshandles boss movement, counters, attack windows, and adaptive scalingAssets/Scripts/Systems/Learning/ComboTracker.cstracks current combos and estimates player skill from combat timingAssets/Scripts/Systems/Combat/CombatTracker.csrecords combat performance for live analyticsAssets/Scripts/Systems/Combat/FightProgressionManager.csadjusts difficulty and saves the player's evolving profileAssets/Scripts/Systems/Combat/PlayerSkillProfile.cspersists adaptive combat stats between sessions
Assets/Scripts/Player/PlayerMovement.cshandles exploration and combat movementAssets/Scripts/Player/SwordManager.cstoggles drawn vs. sheathed weaponsAssets/Scripts/Player/PlayerCombatController.cshandles attacks, parry, roll, and boss targetingAssets/Scripts/Player/PlayerHealth.csmanages HP, damage, death, and temporary invulnerabilityAssets/Scripts/UI/PlayerHUD.csbuilds the player and boss HUD automatically at runtime
- Unity Hub
- Unity Editor
6000.3.10f1 - Git
- A code editor such as VS Code, Rider, or Visual Studio
git clone https://github.com/Shivom2110/AI-NPC-Unity-Game.git
cd AI-NPC-Unity-Game- Open Unity Hub.
- Add this repository as a project.
- Use Unity Editor
6000.3.10f1. - Let Unity finish importing packages and compiling scripts.
- Open
Assets/Scenes/HubArea.unity. - Press Play.
W,A,S,D: MoveLeft Shift: RunSpace: Jump while weapons are sheathedF: Draw or sheathe weapons
These actions are available when weapons are drawn.
Left Mouse: Light attackRight Mouse: Heavy attackQ: ParryE: Flashy attackR: Ultimate- Double tap
Space: Roll
E: Interact with nearby NPCs when you are not using it for combat
- Open
HubArea. - Move with
WASDand approach the playable area. - Draw your weapons with
Fbefore testing combat. - Use parries, dodges, and combo variation to influence adaptive difficulty.
- Approach NPCs and press
Eto cycle through dialogue interactions.
When creating or wiring a new scene, make sure it includes:
- A player object tagged
Player PlayerMovement,PlayerCombatController,SwordManager, andPlayerHealthon the player setup- NPCs with
NPCControllerfor dialogue testing - Bosses with
BossAIControllerfor adaptive combat testing - A trigger using
BossEntranceTriggerif you want a staged boss entrance
Combat support systems are auto-bootstrapped at runtime, and GameInitializer ensures shared memory and combo tracking stay available across scene loads.
- The adaptive combat profile is saved locally through
PlayerSkillProfile - Save data is written under Unity's
Application.persistentDataPath LocalSaveServicealso supports JSON-based local saves under asavesfolder inside that persistent data path
- This project is currently centered around the authored gameplay code and the
HubAreascene - Imported art and animation packs remain under
Assets/BrokenVector,Assets/Kevin Iglesias, andAssets/Rallba Library,Logs, andUserSettingsare local Unity-generated folders rather than core gameplay source- This
README.mdis the single maintained documentation file for the repository