Terrain, Probuilder, Scripting and NavMesh


Terrain

To create the basic shape of the terrain the 'set height' brush was used. This sets the height of the terrain to the desired value. In this case I set it to the ground level of the lighthouse.



After that the 'raise terrain' brush was used to make the ground level terrain not as smooth.


The 'smooth height' brush was used after that to make the cliff faces smoother followed by some erosion brushes. Finally, the raise terrain brush was used again at ground level to add some small hills.



The final terrain is shown below.



Probuilder

To create the maze I started with creating a new 'poly shape'. This allowed me to map out the shape of the walls easily. After mapping it out it was extruded upwards to give the walls height. This process is shown sped up below.



I then added a few obstacles within the maze and painted some trees onto the terrain



Tree Reference - https://assetstore.unity.com/packages/3d/vegetation/trees/realistic-tree-9-rainb...


Scripting and NavMesh

A navmesh allows non-player characters to move around the environment. The navmesh is created automatically by Unity on selected objects. It takes into account various factors such as the radius of a character and the maximum slope that characters can go up. The initial navmesh is shown below. The blue areas are where AI characters can walk.

After that the navmesh was remade to include jumps and falls. This involved setting a maximum fall height and a maximum jump distance.

I then set the various objects in the maze to be navmesh obstacles. This means that the enemy AI will avoid these objects when moving around. The blue walk-able area can be seen below.

A moving navmesh obstacle was added. It moves following a curve making it slow down near the end of its path and speed up in the centre. Enemies are spawned in by clicking. This was done using 'raycasting' which is where the a ray is shot from the point on the screen where the mouse is into the world. Where it hits is the position the enemy is spawned. Enemies are also made to follow the player by taking into account the player's position and velocity. 

https://imgur.com/a/34Sktng

Get UTAS KIT207 Portfolio

Leave a comment

Log in with itch.io to leave a comment.