A Unity 3D game demonstrating advanced AI behaviors, procedural generation, and group coordination mechanics. This project showcases intelligent enemy agents with different AI architectures working together in dynamically generated environments.
This project implements two distinct gameplay experiences:
- Section 1 (NPCScene1): Close-quarters combat in procedurally generated cave arenas
- Section 2 (TerrainScene2): Open-world exploration with procedural terrain and biome systems
- Smart AI Enemies with Finite State Machines and group coordination
- Procedural Content Generation using Cellular Automata and Perlin Noise
- Dynamic Pathfinding with Unity's NavMesh system
- Probabilistic Combat with critical hits and miss chances
- Dual Camera System (First-Person and Top-Down views)
- Technology: Raycast-based perception and navigation
- Behavior: Uses Finite State Machine (Patrol โ GroupChase โ Retreat)
- Intelligence: Dynamic path selection with anti-predictability algorithms
- Special: Long-range planning with randomized decision-making to prevent loops
- Technology: Unity's A* pathfinding system
- Role: Squad leader that coordinates group attacks
- Behavior: Advanced terrain navigation and global communication
- Special: Broadcasts player location to other AI agents
- Leader-Follower dynamics between Hunter and Patrol bots
- Shared state management through global memory system
- Synchronized attacks when player is detected
- Coordinated retreat when health drops below 30%
- Algorithm: Cellular Automata for organic cave-like structures
- Grid Size: 50x50 with 4 smoothing iterations
- Parameters: 45% fill rate with fixed seed for reproducibility
- Result: Bounded combat arenas with natural cover and open spaces
- Heightmaps: Generated using Perlin Noise with Animation Curves
- Biomes: Altitude-based placement system
- Features: Rivers, ice spikes, vegetation, and collectibles
- Validation: NavMesh pathfinding verification ensures all areas are accessible
- Movement: Physics-based with Rigidbody (WASD controls)
- Combat: Projectile-based shooting (Spacebar)
- Health: 100 HP with damage cooldown and respawn system
- Camera: Toggle between First-Person and Top-Down views (C key)
- Player Critical Hits: 10% chance for double damage
- Enemy Miss Chance: 20% probability of missing shots
- Asymmetric Design: Favors player engagement while maintaining challenge
- Unity 3D with Universal Render Pipeline
- NavMesh Surface for AI pathfinding
- Physics System for realistic movement and collisions
- Finite State Machines for AI behavior management
- Raycast-based sensors for environment perception
- A pathfinding* through Unity's NavMesh system
- Shared state management for group coordination
- Probabilistic decision making for varied behaviors
- Unity 2022.3 LTS or newer
- Git (for cloning the repository)
- Clone the repository:
git clone https://github.com/[username]/GameAI_CW1.git-
Open Unity Hub and click "Add project from disk"
-
Navigate to the cloned folder and select it
-
Open the project in Unity
- Open either
NPCScene1orTerrainScene2from the Scenes folder - Press the Play button in Unity
- Use WASD for movement, Spacebar to shoot, C to toggle camera
| Key | Action |
|---|---|
| W/A/S/D | Move player |
| Spacebar | Shoot |
| C | Toggle camera (First-Person โ Top-Down) |
| Mouse | Look around (First-Person mode) |
- Generation Time: 0.5-8.3 seconds (depending on complexity)
- Frame Rate: Optimized for 60+ FPS
- Memory Usage: Efficient object pooling for projectiles
- AI Response: Real-time decision making with configurable update frequencies
This project demonstrates:
- AI Programming: FSMs, pathfinding, sensor systems
- Procedural Generation: Multiple PCG techniques and algorithms
- Game Systems: Combat, health, respawn, and UI systems
- Performance Optimization: Efficient algorithms and Unity best practices
Assets/
โโโ Scripts/ # Core game logic and AI controllers
โโโ Scenes/ # Game scenes (NPCScene1, TerrainScene2)
โโโ PreFabs/ # Game objects and enemy prefabs
โโโ Materials/ # Visual materials for different biomes
โโโ Documentation/ # Academic documentation and images
โโโ Resources/ # Runtime loadable assets
- Modify detection ranges and movement speeds in enemy prefabs
- Adjust FSM transition conditions in AI scripts
- Tune pathfinding parameters in NavMesh settings
- Change terrain parameters in TerrainGeneration script
- Modify cellular automata settings for different arena layouts
- Adjust biome placement algorithms for varied environments
This project was developed as part of the 6CCGD007W Game AI coursework, demonstrating:
- Advanced AI implementation techniques
- Procedural content generation algorithms
- Unity game development best practices
- Performance analysis and optimization
- Dynamic AI Behaviors: Watch enemies adapt and coordinate
- Procedural Worlds: Every playthrough offers unique environments
- Intelligent Pathfinding: AI navigates complex terrain seamlessly
- Engaging Combat: Probabilistic mechanics create exciting moments
- Professional Quality: Polished systems ready for portfolio presentation
This project is for educational purposes and portfolio demonstration.
Nipun Kariyawasam
- Student ID: w1901979 / 20212143
- Course: 6CCGD007W Game AI
- Institution: University of Westminster
This project showcases advanced Game AI techniques including intelligent agents, procedural generation, and group coordination systems implemented in Unity 3D.