Devlog2



Dev Log 2

Week 5 to Week 8

Contents

  • Gliding System
  • Drone System
  • Ladder System
  • Material Creation
  • Nanite
  • Procedural Generation
  • Train System
  • Note System
  • Door System
  • Elevator System

Gliding System - Accessed - Jun 5, 2024 

Link to youtube video I followed for gliding system -

Unreal Gliding System Tutorial

Youtube Channel (CodeLikeMe)

I followed this video to make my glider system. I made changes for integration into my project that uses the H key input. I use the flip flop node to switch back and forward opening the glider and closing it. I set the Gliding bool to true when gliding and reduce the gravity. I attach the glider to the capsule component and move the location to the top of the capsule collider.

I change the scale of the glider and play the animation montage on the player for hang gliding. I increase the speed of movement and change the camera to use the gliding camera boom.

I made two custom events to stop gliding when landing on the floor or being called. I stop the Anim montage for gliding and change the gravity scale and max walk speed.

This attached the glider back to the normal position and camera boom.

Drone System - Accessed - Jun 6, 2024 

Link to Drone system I followed on youtube -

Unreal Engine - Drone Tutorial (1/3) (youtube.com)

Youtube Channel (Reids Channel)

This gets all the drone objects in the level and stores it in the variable DroneRef.

I use the T Key to stop the character from moving and to possess control of the drone. When T is pressed again then the drone controller is unposessed and the player character is possessed.

I added functions to control the Drone. I get the altitude of the drone by using the line trace from the drone to the floor. I also have the distance from the current camera direction to the first object it hits.

I use the Q and E input keys to move the drone up or down. I use the WASD keys to move forward and back, left and right. I use the mouse x rotation to rotate left and right.

I use an enum to control the Drone state. When the Drone is toggled on it creates a widget on the screen to act as a camera view.

Ladder System - Accessed - Jun 5, 2024

Link to youtube I followed to create Ladder System -

Unreal Procedural Ladder Climbing System - Part 1

Youtube Channel (CodeLikeMe)

I added a new interface to the MasterCharacter called BPI Climber. This gets activated when you press the b key and the player collides with the ladder.

This custom event sets the character movement mode to flying, turning the collision off and to allow it to move freely. Depending on the direction of the movement on the ladder it will play a different animation montage.

Animation Montage keeps playing as it loops.

The Exit Bottom custom event and Exit Top either plays the animation montage or sets the movement mode to walking.

I initialise all the variables for the ladder in the beginplay event. 

These events check to see if the player character with the BPI Climber interface is either entering or leaving the ladder collider.

Material Creation

I followed this video because a master material has control over a lot of settings and I don't need to fill up my project and use more memory and processing as the material can be used on a lot of objects and easily customised.

Link to youtube video I followed for material creation -

Unreal Engine Materials in 6 Levels of Complexity

Materials in Unreal Engine define the surface properties of the objects in your scene. In the broadest sense, you can think of a Material as the "paint" that is applied to a mesh to control its visual appearance. 

Material instancing is a way to create a parent Material that you can use as a base to make a wide variety of different looking children.

The shader is the code that controls how it's rendered, the material just determines what is put into the shader. So each material has a shader that it's using and then whatever colours or textures that it is telling the shader to use

I'm creating a master material and a material instance of it in the content browser in the materials folder.

In the material I dragged in 3 wood textures maps first was the diffuse map that I connected to the base  colour of the result node. 

I added a wood roughness map and used only the red channel for it one value and plugged it into a Roughness pin. The Roughness input controls how rough or smooth a Material's surface is. In the Material this manifests as how sharp or blurry reflections appear on the Material.

I added a wood normal map and connected it to the normal pin. This  provides significant physical detail to the surface by perturbing the "normal," or facing direction, of each individual pixel. a good way to make a 3D object appear to have more detail. Normal mapping is best used to add smaller details like wrinkles, bolts, and other details that need lots of triangles to model. It saves computational processing power and memory as it fakes geometry.

I added a specular map and connected it to the specular pin. I used just the red channel as it only needs one value. The specular input takes a value between 0 and 1, and controls how much specular light the surface reflects. A Specular value of 0 is fully non-reflective. A Specular value of 1 is fully reflective.

I right clicked on the texture sample nodes and the constant and converted to parameters.

I selected all the texture sample parameter nodes and  gave them a group called textures. This helps organise the parameters in the material instance into categories.

I added a multiply node with a scalar parameter node that helps control the brightness of the Base Color. Next I used the power node to help control the contrast of the color with a scalar paracter connected. I used a Desaturation node to control the desaturation to make the colours in a specific area of an image less vivid and vibrant. I used the 1-x to flip the value to help show and render it, plus a scalar parameter to expose the value to the material instance. I also created a tint value by using the multiply node and connecting it with a constant 3 node.

I gave the albedo and base color a comment and I selected the parameter nodes and gave them different sort priorities to organise their position in the parameter list.

I added to the base colour pin a Enable Base Color node to use a checkbox to switch between my texture and constant 3 node colour

 in the material instance.

I added more scalar parameters and multiply and power nodes to the specular and roughness map. I also added a FlattenNormal node to change the detail of the bumps in the normal map for example making it look more smoother.

I added 2 more SwitchParameter nodes for the Specular and Roughness, plus two scalar parameters. I added a scalar parameter and Static Switch Parameter to switch between the scalar value and texture for both Specular and Roughness.

I created a new Material Function named MF_PSR and clicked the Expose to Library checkbox. This is added to the Material Function Library accessible to the material editor.

I added a TexCoord node and connected it to a CustomRotator node. I dragged off the rotation angle pin and created a divide node. I created a function input node and changed its input type to Function Input Scalar. This allows me to rotate the texture up to 360 degrees with one value in the material.

I added 2 Function Input Scalar for the scaling of the texture and material and connected it to the divide node. I did the same for the Offset of the texture as iot only needs two values for the U an V coordinates of the texture.

I promoted the material function input pins to Scalar parameters and Sort Priority from top to bottom.

I added to the Albedo section the Static Switch Parameter node that switches between the constant3 node and the texture sample parameter by checking the checkbox in the material instance.

I added a dirt section to the Base Color path. I did the same as the previous section and dirt is only blended and passed through if the Enable Dirt checkbox in the Material Instance is checked.

I added the Surface imperfections to the roughness section to switch between the Roughness Texture Sample and the Surface Texture Sample based on the Enable Surface Imperfections Static Switch Parameter checkbox.

I added this to the Emissive color pin to give access to the values in the Material Instance. It can either use a color or a texture by switching using the Static switch Parameter checkbox.

I used the M_Master and  which is the parent of all master materials I will use. I duplicated it and changed the name M_Concrete. I created a Material Instance from it MI_Concrete. I changed the texture maps and played with the parameters to make a brick wall effect. I used the MI_MasterInstance on the fences.

Nanite

I'm using the view mode nanite visualisation triangles. To show that nanite is active and when I move further away from the mesh with nanite on the triangles get less. Nanite automatically sorts out the LOD (Level of Detail). This saves on process power for rendering the extra triangles. Nanite meshes render faster. It loses less quality of texture when transitioning  from one LOD to another. 

In the static mesh editor nanite is enabled on my SM_Fence model.

The Enable Nanite support allows if nanite cannot be used in the level it will go to a fallback mesh.

This window holds details of nanite being enabled and the triangle and vertices produced and the memory it takes up.

Procedural Generation

I created a Structure to hold 3 static meshes for the different size rocks.

I created a  Blueprint of type Actor to be used at the spawned actor in the level. In BeginPlay I choose a random rock from the OnSelectionList array. I get the static mesh from it and set the static mesh component to it. I also make sure the OnPhaseCounter is zero to make sure the largest rock is spawned first. 

I added the InteractionInterface to this actor. This allows me to use the input action key interact to call the interaction event. It checks to see if you have reached the last rock and then stops setting the static mesh.

I added a Set Timer event to set another random set of rocks in the same position and reset the rock list to large.

Plant PCG

I created 4 target points to act as location points to spawn my plants. I get all the target points in the level and use a foreach loop to spawn the plants. 

 

Each spawned Asset1 will produce 4 plants at set locations in the Asset1 blueprint. The MeshLibrary1 variable holds 4 static meshes.

The ObjectOrigin_Tr variable is used as the pivot point for all the static meshes.

Train System

In Beginplay event I get the spline path for my train line and store it in the Active path variable. I also do it with the Train Spawn Points that are used for the position of the spawned train when going in the opposite direction. 

I store the references of the player character and compass marker.

These blueprints draw the quest marker and location of the quest, plus update the current stage of the main quests.

If the quest is still active then the quest marker on the compass is shown and the text of how far your player is from the objective.

The Event Interaction is called when you press the Interact key E. It first checks to see that the train is not moving. If so it will move the train down the spline to the speed of the timeline TrainSpeed.

The MoveAlong function is looped around until it reaches the end of the spline and the train stops and sets the Travel bool to false.

When the train stops then the train2 is spawned in place of the train1.

Note System - Accessed - May 29, 2024

Link to the youtube I followed for note system -

Pick up And Read Note System In UE5

Youtube Channel (Eremental Studios)

I followed this video to createthe note system. When the player character collides with the note’s collider it displays the userwidget  W_InteractPrompt on the screen. When leaving the collider it removes the widget from the screen. When the widget is on screen you can press the interact button key E. The Note will display on the screen with an animation and stay. Press E Key again and the Note disappears. 

Door System - Accessed - June 7, 2024

Link to youtube video I followed for Door System -

Unreal Engine 4 Tutorial - Doors Part 3 - Key-card Doors

Youtube Channel (Ryan Laley).

I used this video to create the door system using key cards.The door_keycard_bp blueprint allows the player to open the keycard door by checking if the player has picked up the correct key. If you have the correct key and press the E Key then the door will open. 

The door opens using the values from the OpenDoor Timeline.

The Keycard3_bp blueprint when the player overlaps the keycard it disappears and the number on the keycard is used as the index to check the bool array index number in the MasterCharacter blueprint.

The door_proximity_bp is an automatic sensing door  once the player overlaps its collider the door slides open using the DoorAnimation Timeline.

Elevator System - Accessed - Jun 9, 2024

Link to youtube video I followed for Elevator System -

Unreal Engine 5 - Lift/Elevator Tutorial

Youtube channel (CodeLikeMe)

When the game is loaded the bottom switch of the elevator is made active. The Update Gates function makes sure the bottom gate is vertical and open and the top gate is horizontal and closed.

When this event is called  it activates the elevator switches and changes colour It closes the red barrier gate. Then the lift movies upwards or downwards depending on if you are coming from the top or bottom. The elevator moves over time to get to the next location. The bool IsAtBottom is set to the opposite value when it reaches its new location. 

The Elevator can be activated when the player character overlaps the lift platform or by overlapping the switch and pressing the E Key interact button.

Leave a comment

Log in with itch.io to leave a comment.