- The video demonstration is available to view here.
- This mini-game was built as a project for the Interactive Agents and Procedural Generation (ECS7016P) module at Queen Mary, University of London.
- The aim of the game is to complete the maximum number of levels without the health reaching 0.
- Food items can be collected to replenish the health.
- The interaction of the player with the enemy or the boundary walls of the game result in a decrease in the health of the player.
📦Assets
┣ 📂Scenes // Main Scene
┃ ┗ 📜TechDemo.unity
┣ 📂Scripts // Player and enemy definitions
┃ ┣ 📂Agent
┃ ┃ ┣ 📜Enemy.cs
┃ ┃ ┗ 📜Player.cs
┃ ┣ 📂Generator // Procedural level generation
┃ ┃ ┣ 📜BoardManager.cs
┃ ┃ ┣ 📜GameManager.cs
┃ ┃ ┣ 📜Loader.cs
┃ ┃ ┣ 📜MovingObject.cs
┃ ┃ ┗ 📜Wall.cs
┣ 📂ThirdParty // Animations and character skins
┃ ┣ 📂Animation
┃ ┃ ┣ 📂Animations
┃ ┃ ┗ 📂AnimatorControllers
┃ ┣ 📂Prefabs
┗ ┗ 📂Sprites
- This project was developed on Unity version
2020.3.32f1
. - Drag and drop the
TechDemo.unity
scene into theProject
window fromAssets/Scenes/TechDemo.unity
. - The dependencies will be loaded and the scene can be run.
- The levels are generated on an
8 x 8
board consisting of different texture tiles located in the📂Prefabs
folder.
Fig. 1: Prefabs for the level generation
- The levels are procedurally generated using Cellular Automation until the player dies i.e., runs out of health.
Fig. 2: Loading screen
- Each level loads for 3 seconds with a placeholder image to indicate the level number.
Fig. 3: End screen
- When the player's health reaches zero, the game ends.
- The food regenerates the player's health by 20 points per each item.
- The placement of the food items is randomised within the game environment.
Fig. 4: Player character
- The player can be controlled by using the keyboard arrow keys.
- The player starts off with 50 points of health that reduces every second by 2 points when the player moves.
- The health only reduces when the player, either moves, is attacked by an enemy or interacts with the boundary wall.
- The health can be regenerated by consuming food scattered around the map.
Fig. 4: Enemy character
- The enemies follow the player using a simple navigation algorithm.
- The author tried to leverage the A* Pathfinding library but due to the procedural generation of each level, the task could not be accomplished.
- The sprites, prefabs, and animations were imported from the 2D Roguelike package.
- Different procedural generation techniques can be used to produce the level texture tiles and food.
- The movement of the zombies can be enhanced by using a more advanced navigation algorithm i.e., Behaviour Trees, A* Pathfinding and Path Planning.