Thursday, 13 December 2018

Unreal: Project Evaluation

Unreal is visually enticing and appears to be extremely user-friendly. In the beginning stages, I found it really nice to use and I was excited to learn more. My game was looking extremely fancy without trying too hard, and perhaps this was a bit of a trap.

I got carried away with the visuals, and when it came down to accomplishing solid mechanics, I found it far more challenging than using C# in Unity. The blueprints to me look inevitably messy and there is such a huge range of nodes available that it is quite confusing, to begin with - especially with being used to Unity, and all the keywords are different.

In the early stages, I spent a lot of time getting the scene complete - the terrain, character retargeting, the building and using materials etc. I was really pleased with my progress, and once I started to work more on the blueprint side of things, the mechanics, I started to struggle and encounter lots of bugs in my game.

I felt as if every time I managed to fix one thing, another broke. I found fixing bugs and errors in Unreal is quite challenging, and not clear where the problem is. By the end, I believe I am getting more used to reading the error messages and navigating to where they are located, but using Visual Studio combined with Unity seems to offer much more support for error handling. 

Even though I have struggled with blueprints and getting used to all the options and windows available in Unreal, I have learned a huge range of elements in areas I would not have expected, such as retargeting a character and animations, creating terrain and using a blend of textures and materials to create various surfaces.

If I were to do the project again, I would spend far less time getting into the visual side of Unreal and focus heavily on the fundamental mechanics. My game is missing a huge amount of features, and as a game would be very unsuccessful. The visual side of it is impressive, but that only goes so far.

I should have taken more time to learn the basics of blueprints, and tried to relate it to C# as much as I could. It was not till later on, I started to discover several nodes that were the equivalent to C# functions, and it became easier to understand. If I had focused on this from the start, I would probably have got myself into creating a greater range of elements and learning much faster. The graphics could have been added at a later date, instead, I found myself struggling and spending most of my time trying to fix bugs with the few features that I did manage to implement. 

Maya: Model Evaluation

Maya is difficult for beginners to grasp at first. Even the navigation itself is quite confusing, to begin with. I find myself flying around Maya quite naturally now, however, if I switch to Unreal after using Maya it becomes extremely difficult to navigate around Unreal naturally. The first week of using it was primarily getting used to it, and once I got past that stage and was familiar with the basic tools, I started to feel far more confident and begun enjoying it. I have come to realise that many tools in Maya are quite unreliable and 'buggy', which makes it confusing as a beginner to know which tools to use, and which ones to avoid - or which ones to use in certain situations.

Once I began getting into the model, I had to discover the hard way to ensure the model is as clean as possible. I restarted my model because of it becoming deformed every time I tried to progress any part of it, this was because I did everything on one object and did not keep the edges and vertices clean and organised.  

From using Maya, I have learned about a small range of tools, but mostly getting used to Maya in general, the interfaces, options and the importance of being organised and clean has been a focus for me, oppose to learning a huge range of tools. I think it is extremely important to get into good habits and keep your model clean and professional from the beginning. I found myself restarting my model twice because I had not kept it as clean as I could, which resulted in huge problems later on, that it was actually easier for me to start again. 

If I were to restart the project, I would start much earlier and devoted more time to learning the ropes by following online tutorial series. By jumping into the project, even though I made mistakes and had to restart, it was a valuable lesson learned and perhaps better I did jump in and learn the hard way. In the future, I would attempt a practice model which has little to no detail and work my way up in difficulty. In hindsight, I should have taken the time to search up about the most popular tools that are used by the professionals, and tried to learn a few key ones that may have made my project far more efficient. I spent too much time making my own mistakes and learning the difficult way, rather than taking more time to learn from the best and avoid the mistakes they have already made.

Unreal: Texture Streaming


Another error I seem to have encountered is "Texture Streaming Pool Over X MB". This is visible in the top left-hand corner of the editor during run-time. However, it does not appear to cause any issues whilst running the game.

After doing some research online and checking out the documentation: https://docs.unrealengine.com/en-us/Engine/Content/Types/Textures/Streaming

It seems that it appears when there is an issue with the number of textures being used that are causing performance issues. However, this message has appeared after deleting a huge amount of unused assets and I have not added any additional textures to the game.

According to users on various online forums, the texture streaming pool size by default is very small and can be enlarged via the Engine.ini file, or via command line in the console.

https://www.reddit.com/r/unrealengine/comments/9ex9l3/why_do_i_get_texture_streaming_pool_over_xxxx/
https://forums.unrealengine.com/development-discussion/content-creation/94843-texture-streaming-pool-over

Unreal: RunTime Error (Damage Volume)



My project was 8gb and I was aware I had a lot of asset packs that I was only using small amounts of. I decided to go through the entire project and delete as much as I could without breaking links in the project.

After I did this, it appears that I have a run-time error with the Cast To FirstPerson in the Damage Volume blueprint. I am not sure why this would be linked to any of the assets I deleted, or it could be unrelated. It still works but displays a run-time error which is a bit confusing.

The run-time error is the equivalent of a null reference exception in Unity. Meaning whatever it is trying to access, does not exist. I am confused about this situation, because I have searched for a long time trying to fix it, and I can not spot any problem.

In Unreal, the errors that I have received do not seem to be particularly clear and helpful. This one does point to the location and the node which is far more than any of the others. However, in Unity, if there is an error it seems to be a lot easier to locate and carry out testing to find the solution i.e. break points etc. Whereas Unreal has not provided much support for error handling, and quite unclear of all the existing references in the blueprints.

Unreal: Max Zombie Spawn Over Time



I created a very simple method of increasing difficulty in the game. I have set the game to allow a maximum of 20 zombies at one given time, to begin with, and I have run out of time to create a wave system so as an alternative I implemented a system to increase the number of zombies allowed at one given time based on the time survived.

We begin with 20 zombies allowed, and increase the number allowed by 10 every 30 seconds of survival. This means over time, if the player is not keeping up with killing the zombies, there will be a huge number to the point movement and survival becomes more difficult.

This is an extremely basic and poor way of increasing difficulty and only intended to be temporary. Ideally, I wanted to create a wave system where I had X amount of zombies per wave, and increase the number of zombies per wave, as well as their health and damage.

The zombies are currently 3 shots per kill, and quite easy to spam shoot them all dead in a number of seconds. To make it slightly harder, I increased their fixed damage to 10% rather than 5% and lowered the rate of armour regeneration considerably.

Currently, the game still has not got much of a purpose and could seem boring. I should have added a simple timer to display to the player which could add an element of fun to 'survive' the longest.

Unreal: Key Pickup not working correctly

After recreating the NavMesh in an attempt to fix the problem that has reappeared with walking up the stairs and becoming stuck, it appears to have affected the key pick up. This did not solve the stairs issue, but it did unexpectedly help with the movement of the AI hugely.

The collider appears to be solid, and not a trigger, meaning I cannot walk over the item and pick it up. It seems to pick up sometimes, after standing by it for several seconds or if I sprinted at it. But whilst walking up to it, it did not allow me to pick it up.

I spent a long time testing it and trying to figure out what was happening. Eventually, I realised that the zombies were picking the key up, and not me. However, if I sprinted at it at the beginning of the level, it allowed me to pick it up sometimes. Whilst playing around with settings, either I could not pick the key up, or the zombies could...





After a lot of trial and error, attempting to achieve the correct results, I managed to find the solution.

I knew what I was trying to achieve, but I was confused about the settings and looking online did not particularly help me to get the results I wanted.

After getting to the point of almost guessing, I decided to look at other actors and try to achieve the original settings I had to begin with in an attempt to retrace where I went wrong, as it was originally working with those settings. I decided to add a node Cast To FirstPersonCharacter to ensure it was the player colliding, and not the zombie.

Finally, I was able to find the results that allowed me to pick the key up as I once did, and the zombies are ignored by the collision.









Unreal: Fixing Key (Shooting key picks item up)



Picking up the silver key works as expected, except for that I found that by shooting the key it destroys it, and it proceeds to unlock the corresponding door still. So essentially, we can pick the key up by shooting it.

After some trial and error, I found that I could edit the collision settings to make it custom. This way I set the collision to block everything except for the player. The bullet is considered a pawn, meaning it will be blocked now.

This solved my problem, and everything appears to be functioning as expected.

Unreal: Fix Bullets Firing Twice



Every time I shot my weapon, I found there was a second line of bullets being fired from the side. I found within my character BP file there was a "Sphere" used as a reference point to shoot from.

By deleting this, I was receiving errors which lead me to the default First Person firing. I had set-up my own shooting and did not need the blueprints here.



I deleted all of it except for the audio because I had not set that up elsewhere. Now, all this is doing is playing the default shooting audio clip at the actor's location every time the Fire button is triggered (Right Mouse-Click).

This has solved the problem of more than the expected amount of bullets being fired, and the audio is still there upon shooting. Realistically, it may be wiser to combine the audio with the other blueprint responsible for firing the bullet. But for the time being, it seems simple enough for me and it works - perhaps at a later stage it should be moved though.

Maya: Magazine Catch



Using a polygon cube, I rescaled it to the correct size of the magazine catch, then copy and pasted it (Ctrl + C / Ctrl + D) and used the boolean tool to subtract one from the base. With the other one, I rescaled it to match the inner part.

The edge loop tool was used to create numerous edges within the cube, which I rescaled inwards and outwards to create the zig-zag effect.

I am really pleased with how simple this was to create, whilst it looks very accurate in comparison to the schematics.

Maya: Ejection Port (Remake)



Due to attempting to clean up the model, and deleting vertices and edges whilst not realising the other areas it had effected, I lost the main section of the ejection port.

Previously, I accomplished creating it with the aid of the edge loop tool, which was used to create a rectangle, that I beveled and extruded.

This time, I decided to create a cube and rescale it to the correct size. Again, using the Bevel tool to create smoother edges and create an accurate shape in comparison to the harshness of the cube. By doing it this way, I saved creating a lot of edge loops, which inevitably became messy.



Bevel is accessed via Edit Mesh > Bevel. It creates new edges parallel to the selected edges, which gives it a rounded-off effect rather than a sharp edge.

In the schematics I have used, the ejection port does not have sharp corners but rounded off, whilst the rest of the shape is not smooth or round. This made the bevel tool perfect to achieve the smoother corners, but maintaining the rectangular shape.

Maya: Operating Rod



I created a polygon circle, and rescaled it to the correct width and length, and squared off the ends slightly. If I attempted to do a Boolean Difference, it was removing the entire base of the gun. To get around this, I selected the settings for the boolean difference tool. In the settings menu, there are two options, so I selected the opposite to the default version.

Rather than making the shape invert into the weapon, it was simply deleting a face on the gun. Leaving me with a black hole in the model. I switched back and tried once more and it worked again - I'm not sure why. According to many sources, online the Boolean tool is very unreliable and experienced users tend to stay away from it.

To create the second part of the operating rod, I used a cube which I dragged the vertices of the bottom inwards to create a smaller bottom. The smooth tool was used to take the harshness of the edges, but the middle part had defined edges so I rescaled the middle section to give it sharp edges along the middle, whilst the rest was smoothed around the outside.

The edges through the center are not quite as harsh and defined as they are in the schematics. However, I did manage to create a flat central face which definitely comes close to the image and overall I am pleased with the outcome.

Monday, 10 December 2018

Unreal: Fixing Stairs Bug & FPS Camera

FPS Camera

After changing the default First Person, I lost the ability to move the gun verticle to follow the camera. Apart from this, everything was working but due to this, the aiming was off.

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/22186-using-first-person-camera-to-see-the-player-character

https://wiki.unrealengine.com/Oculus_Rift#True_First_Person_Viewpoint



From the two links provided, I tried to take some advice on the first person camera set-up, especially the hierarchy. After trial and error, I finally found a solution to the problem.

By creating the Head slot as the parent of the camera, it will follow the head. If I made the mesh a child object of the camera, it fixed the problem of looking up and down with the weapon, however, the aiming was very off and the camera always resulted in being too close to the hands, or being able to see the head whilst running - regardless of how much I moved the camera position and rotation.

Instead, I gave up trying to fix it this way, and made the camera a child actor of the mesh, and investigated the "Yaw Rotation".

 

Eventually, I came across a setting that I tested, and it solved my problem. The weapon now follows the camera on the Y axis and the X axis. The only problem now is the accuracy of the shooting.



Previously I edited the positioning of the crosshair to match the aiming more accurately. I readjusted these settings to match it better. It is not perfect, but it is far more accurate than before. This is a problem to look into later. At this stage, some shots are accurate, whereas others are slightly inaccurate, but still in the correct direction. This is not a major issue right now, and I suspect it is due to a setting requiring adjustment from the default FPS for a deliberate offset to give a sense of realism.

Stairs Bug

I was facing issues with the stairs, the zombies were occasionally getting stuck on the staircase, which appeared to be at certain angles. After I fixed the rotation of the camera, it appeared the player was getting stuck on the stairs sometimes, but others time it was not. I had no idea how these two would be related, but I noticed I was getting stuck on the same step.

This leads me to believe perhaps one of the steps was too high, and I was getting 'caught' on it, and perhaps the zombies were too. The entire staircase was being changed as one, rather than individual steps so I am unsure how I would have ended up with one higher step. Still, I decided to go ahead and make the steps smaller, and create more of them, and make the floor thinner because it acts as the final step.



After completing this and fixing the materials, I tested it out numerous times and my character was no longer getting stuck. The zombies also appear to have no problem getting up the stairs anymore, regardless of the angle!

Unreal: Unlocking a door

I found a free 3D model of a key to use in my game from https://free3d.com/3d-model/key-v1--203749.html




I set up an OnComponentBeginOverLap and OnComponentEndOverlap to detect when the player is within the collider space of the door. By enabling and disabling the character controller means we can prevent the player from interacting with the door whilst they are already in the door space.

We create variables to keep track of the door status, whether it is unlocked, and whether it has been opened. Using the Timeline node we can trigger the timeline of the door 'opening' (animation) to play. I have intentionally left the Reverse output to be blank so the door can only be opened, and not closed. This is because I want to prevent the player from locking themselves in a room and 'camping', meaning the player can find a strategic spot and wait for zombies to come to them, eliminating the level of intensity and danger.

To open the door, we are simply rotating the door on the Z axis. When we complete this, we use the FlipFlop node to alternate between setting the value of the boolean IsDoorOpen.



Using the door provided in the Starter Pack, I used the same method as the previous door. This required setting up the frame and door in the viewport, matching their positions up and adding a Box Collider to set an area for the player to be able to interact with the door.




OnComponentBeginOverlap we use a foreach loop to iterate over the array of locked doors. If the last index is less than 1, we unlock the door and destroy the actor (silver key object).



I created another Blueprint and created a Static Mesh, which I changed in the details window to the 3D model of the key I downloaded. Then using a Capsule Collider I created an area around the key that the player can walk into to pick up the key.

By adding a RotatingMovement it generates a rotation on the X axis in-game for a nice effect, giving the player some feedback that it is an item that can be picked up.




By selecting the door, I have access to the details panel where I can set the door to be locked "IsDoorLocked" (boolean) is set to true. I have also named the door SilverKeyDoor so we can tell which is the corresponding key in case we add more doors that require keys etc later on.

For the key, I have set it to have an array element containing SilverLockedDoor so our blueprint file can find it.



Thursday, 6 December 2018

Maya: Ejection Port Update

I accidentally deleted vertices linked to the Ejection Port without realising. By this point, it was too far along to revert that far back, so I had to recreate it. I had difficulty due to deleting vertices to clean my model up, and unable to place new ones in the correct places using the Insert Edge Tool or Multi-Cut tool.

I decided to create a cube, and scale it up to the correct size according to the schematics. I then used the Bevel tool to create a less harsh.



I moved the corner vertices out to create a more rectangle shape, rather than cutting the corners off, which is what the bevel tool did.



It was sticking out too much, so I used the rescale tool to flatten it further, which created a much nicer effect. In the image, the part should ideally be going inwards, rather than out. But at this stage, I was not sure how to achieve it. I believe the way I have done it appears better than it originally did, and I am quite happy with the outcome.

I have learned that I can use the Combine tool, accessed via Mesh > Combine to merge the objects as one, which I have tested. At this stage, I am keeping them separate in case I need to make any adjustments later. Once I am happy in the end, I will bring all the components together.

Unreal: Nav Mesh




I already had a Nav Mesh, but I discovered by pressing "P" activates the green surface to represent the area that can be walked on by the AI.



Through this feature, I was able to see part of the stairs is not covered. I managed to raise the level the Nav Mesh sits to cover it a bit more, but the sides are still clear. This could explain why the AI has been getting stuck on the stairs, and I need to look into this issue more later on.

Unreal: Error



Every time I hit play, I was getting an error located in the FirstPersonExampleMap. There was no other error information available other than this. I was unable to locate where the FirstPersonExampleMap was.



After a while, I realised the way to access the blueprint file was via the Blueprints menu rather than the content folder.



It turns out that I had made an unconnected node at some point, without realising the error. It took me far too long to find where it was located, but for future, I know how to access the blueprint and this type of error produced will make more sense.



Another error I encountered was the project not saving.

I was able to find the solution on https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1960-the-asset-failed-to-save and it turned out to be because I accidentally managed to open two instances of the project. Unfortunately, I had to close both and lose a small amount of work to continue saving my progress.

Wednesday, 5 December 2018

Techniques #5


Maya: Detail



 I came across having a vertex out of place and found a solution to fixing it accurately by holding down "V" whilst moving the vertex, which makes it snap into place.



I have started to add curves and making the handle have smoother edges oppose to it looking blocky. I achieved this by adding more subdivisions and extending the outer two back to create a smoother edge.

The handles need further smoothing, which I will achieve with the smooth tool, but for the time being the gun is starting to take shape.






















I have tried to add extra detail by adding the indentations of the gun.



The way I have tried to accomplish this is by using the edge loop tool to insert vertices. The tool would not allow me to create vertices where I wanted them, unlike before. I think the reason for this is because I have created additional subdivisions along the top and bottom, and in areas rotates edges.

The alternative was to use the multi-cut tool, target weld and connect tool to create them in the correct positions. It was not ideal, as it is long-winded to create all the vertices in this way, and does not ensure precision all the way around.

Target weld is particularly useful for merging two vertices together, especially close together that are unnecessary. However, I need to practice using the tool more because quite often merging two vertices results in deformations of the model.

Using the extrude tool to push the faces into the model to create the indentation resulted in a piece on the end and bottom of the indents. I am unable to delete the edge or face existing there, and attempted to fix the problem by creating extra vertices to essentially cut around the gap.

I have not been successful, and think I should have attempted this another way. Attempting to delete the edges in place now results in the model becoming horribly broken. I tried to delete the history to see if it would help the situation, but it did not. I think using the boolean tool to subtract a rescaled cube into a long, thin rectangle may have been a better method of achieving the desired result. I will try this approach for other indentations.

Maya: Fill Hole



The Fill Hole tool is accessed via the Mesh drop-down menu. It is a tool used for filling in faces like shown in the image above. As I copied and pasted the pieces from the top railing part of the gun, the bottom faces were removed. In this case, I want them filled in, so I used the Edge Selection to highlight the edge of the piece missing the face, then selected Fill Hole, resulting in a new face being created.

Monday, 3 December 2018

Maya: Ejection Port



My aim now is to start adding some detail to the weapon itself, focusing on the indentations now that I have the bulk of the weapon complete.

The first part I have added is the Ejection Port. This consists of creating two faces with the Insert Edge Loop tool and moving edges around. Once I had the faces, I used the Extrude tool to push one face inwards, and the other outwards. Following this, I saw and experimented with the Emboss feature, applying it to the faces, which implement a smoother effect that is not as harsh on the outlining.



The next step from here will be to figure out how to implement the screws and possibly smooth the edges of the faces slightly as they are quite square, whereas in the image they have softer/rounded corners.


Maya: Assault Rifle Railing



To create the railing on the gun, I created a new cube and scaled it to the correct length and width. By using the Insert Edge Loop I was able to input the positioning of where I would need to extrude, in order to replicate the connection between the railing and the rest of the gun.



The pieces that run along the top of the railing are more or less the same in shape, except for the first two and the last one. Therefore, I created those three first, then duplicated the rest using Ctrl + D and simply used the move tool to move it only on the X axis to ensure they are all in line with each other

Based on the issues I encountered before with moving/smoothing parts of the weapon, I have begun to create new aspects of the gun with new objects if it seems reasonable. In this case, the railing consists of a series of cubes, which are child objects of the main block of the railing as seen in the image above.

Maya: Multi-cut Tool


I have come across several issues where I have ended up without edges, or I have black holes in the model. Usually, I have fixed these problems using Bridge, Connect or Fill Hole. On this occassion none of the above would work, so I found another solution to the problem. By selecting on the object, I Chose the Multi-Cut tool.



The Multi-Cut tool allowed me to draw an edge by clicking a vertex and holding shift whilst clicking the other vertex I want to connect to. In this case, I chose 50% meaning it would be central. In other cases, I could hold shift and draw around an entire object rather than between two vertices.



So far I have managed to create the majority of the gun's base. So far I am finding it slightly tedious and restrictive due to there always being something connected, meaning every action I make, it seems to affect another part of the model. Perhaps I should have created more objects to create individual parts of the gun, such as the handle and trigger etc. However, it seems everyone else works in the way I have been, and it is more a case of experience.

Unreal: Project Evaluation

Unreal is visually enticing and appears to be extremely user-friendly. In the beginning stages, I found it really nice to use and I was exc...