Welcome to my tech demo ! First Time building a Unity3D Project :) Enjoy !
Video Link: https://www.youtube.com/watch?v=xDA5jfo7tg4
- The project was built using Unity Version 2020.3
- Prefabs folder contains all the game objects + materials.
- Dowload the files.
- Open the files using Unity3D (Version 2020.3)
- Inside the Scenes folder (Assets > Scenes > TechDemoScene) press the Techdemo.unity file.
- Press play and this will run the generator and agents (as shown above).
- This will also show the different game objects in the hierarchy window as shown below.
-
This project was built for ECS7016P Interactive Agents and Procedural Generation module assingment.
-
The aim of the assignmet was to create a level generator and an interactive agent.
-
The generator should use some Procedural Generation (PG) techniques.
-
The agent should use some behaviour and navigation techniques.
-
The aim of the agent is not to fall of the platform and land on the moving terrain.
-
The enemy is in control of shooting randomly at the agent trying to get the agent off the platform.
-
The agent can run and take cover using the walls (Yellow Cubes - as shown above).
-
The terrain generator moves rapidly and is dangerous for the agent if they land on it.
- The Terrain Generator uses the TerrainGen.cs script located in the Generator folder (Assets > Generator > TerrainGen.cs) .
- The level generator generates random heights and levels using a PG technique called Perlin Noise. This is explained and shown in the TerrainGen.cs script.
- In the TerrainGen.cs script it uses the dimensions and heights/width of the terrain to create the perlin noise.
Below shows how the inspector window should look like for the terrain:
- The purple platform (plane) should be baked using the AI navigation (Window >AI>Navigation) make sure the plane is static and press bake.
- This allows the agent to move around the platform.
-
The Agent (Green Capsule) uses the AgentMove.cs script located in the Agent folder (Assets > Agent > AgentMove.cs).
-
The Agent uses the Wandering and Cover, Navigation Behaviour techniques to move and hide from the enemy.
-
In the AgentMove.cs script the agent uses different waypoints to move around. This should be added into the Inspector Window in Unity.
-
MAKE SURE YOU CHANGE THE SPEED FOR THE AGENT AS ITS SET TO 0 (The agent will not move). INCREASE THE SPEED SO THAT THE AGENT CAN MOVE AROUND (change in Inspector Window).
-
MAKE SURE YOU ADD THE Waypoints in the inspector tab under the AgentMove.cs script.
Below shows how the inspector window should look like for the agent:
-
The Enemy (Red Capsule) uses the AdvancedEnemy.cs script located in the Agent folder (Assets > Agent > AdvancedEnemy.cs).
-
The Enemy uses the shooting and rotate behaviour techniques to attack the agent.
-
The AdvancedEnemy.cs script explains the code.
-
MAKE SURE YOU ASSIGN THE ENEMY AGENT(Enemy), GREEN AGENT(Agent) AND SHOOT (bullets) IN THE INSPECTOR WINDOW UNDER Advanced Enemy (Script).
Below shows how the inspector window should look like for the enemy:
- Implemented some different techniques to the generator like Wave Function Collapse (WFC) or Evolutionary algorithm.
- The movement of the agent could be advanced using Behaviour Trees or A* algorithm.
- Could have used some THIRD-PARTY Assets.
Terrain Generator + Perlin noise:
- https://www.youtube.com/watch?v=IKB1hWWedMk
- https://www.youtube.com/c/SebastianLague
- https://www.youtube.com/user/brackeys
Agent + Navigation + Behaviours: