It's finally come to the last night of working on my project and making sure everything is as good as it can be, and included. I do keep looking at my game and thinking about things I wanted to add, but simply run out of time. It was a bit of a nightmare trying to get my discs burned in the early hours of this morning. I realised the DVD drive on my laptop was no longer being recognised, another problem to sort out later, but I had my desktop I could use instead. Next the files wouldn't copy over to the desktop, seriously it crashed 3 times! Then, when I did get a disc burnt, it hadn't burnt all the files! Why did it say it was complete? In the end, I FINALLY got two discs burned, and they worked (I also made sure they worked on the university computers).
I have enjoyed working with Unreal, you can get some nice results fairly quick using the blueprint system. It also makes things a little clearer on how different components are working with each other through the nodes, compared to Unity. I would have liked more time to work on the final game though, I feel I did waste too much time with my first attempt that I later abandoned. I did learn quite a lot from working on it, and it did make it easier to produce a second game in such a short time.
Maya is both enjoyable and frustrating in equal measures. I found modelling to be very time consuming, and getting the smaller details in could be quite tricky. I do feel that I have become more proficient the more I have used it, making less mistakes, and relying less on reverting to back ups. I would definitely recommend making plenty of back up copies of your work though, especially when starting out. I did spend more time working in Unreal, but I could of easily spent just as much working in Maya.
The blog. I do actually think its a really good idea to write a blog throughout rather than just writing a report at the end. It does take a bit of time to get used to writing about the process of creating part of the game or model as you go though, hence my blog improving over time. I was going to go back and edit the posts, but its more of true reflection of how my skills and confidence progressed over the semester as it is. I must admit though, when I was frustrated with something not working, or something took a really long time, the last thing I wanted to do was write about it. Also, sometimes I would have to recreate my actions in order to take screenshots, which sometimes made blog posts take longer than actually working on that particular aspect of the game.
Overall, I have enjoyed the module and working in both Unreal and Maya. I've learnt a lot in a short amount of time, and thinking about what else I could create with them in the future is an exciting prospect. Gary and Dominic have been excellent throughout the semester, and have made understanding the tools and software a lot easier with their support. I'm tired now (unsurprisingly), but I'm already looking forward to what we'll be producing in the next semester!
Systems Modelling 2018
Thursday 13 December 2018
Unreal: Addng a pause screen
The Next feature to add was a pause menu. I used a couple Virtus's YouTube videos for reference on the nodes that I should use, but generally a lot of the blueprint functionality is similar to what I've used previously. I will go through steps involved in getting it working.
Firstly, a key binding needs to be created, basically setting up an input that will do something in the game. To do this, go to Edit > Project Settings. Scroll down the list on the left until you find the 'Input' option. Now click on Bindings > Action Mappings and hit the '+' to create a new one, I called mine Pause. Next you need to select what key (or controller button) will pause the game, I used the escape button as it generally is the pause key in most games.
Now right click in the content bowser, select User Interface and create a new widget blueprint, name and open it. From the Palette on the left, drag and drop in two buttons, these will be the pause and quit buttons, you can rename the buttons in the details panel on the right or the Hierarchy panel on the left. To finish the buttons off, drag and drop 'Text' from the palette on to the buttons, and enter appropriate names in the details panel and press compile.
Next open the First Person Character blueprint, or whatever is the main character blueprint you are using. Go to the Event Graph tab and find a space to create new nodes. First we need to call an event when the escape key is pressed > a branch is needed to check a Boolean variable, because we only want to have one instance of the pause menu open. If the Boolean is false > we move to create widget, with the class set to the pause menu widget > now we add the widget to the viewport (screen) > as the pause menu is now open, the pause variable needs to be set to true > the game is now set to paused > finally the mouse pointer is set to visible, the target is the Player Controller. Click compile.
Now we just need to add some functionality to the those buttons. Return back to the pause menu blueprint and select 'Graph' in the top right corner. On the right you'll notice that buttons you created now appear as variables. Select the quit button, and scroll down to events and add the on the click event. A new node will appear 'OnClicked(Quit)', we just need this to return to the start screen (or quit the game).
Next is the resume button. From the clicked on event > game paused is set to false > the pause screen widget is removed > we need to cast to the first person character to gain access to the pause active variable > and set the mouse pointer to false. The last step is to make the pause menu close with the escape key. Starting from Event Tick > we add in a slight delay > this leads to branch which is checking every 0.2 of a second if the escape is being pressed > if it is, game paused is set to false.
Next is the resume button. From the clicked on event > game paused is set to false > the pause screen widget is removed > we need to cast to the first person character to gain access to the pause active variable > and set the mouse pointer to false. The last step is to make the pause menu close with the escape key. Starting from Event Tick > we add in a slight delay > this leads to branch which is checking every 0.2 of a second if the escape is being pressed > if it is, game paused is set to false.
Gun Model: From Maya to Unreal
After the test run of importing the barrel into Unreal, it was time to give importing my gun model ago. Most of the steps were similar to what I have explained in my previous post, the only extra step I carried out in Maya was to combine the separate components of the model into one mesh. This was done by selecting everything (right mouse button > select all) and then going to the Mesh tab > Combine. The Model was now ready for exporting to Unreal.
The next step was importing into Unreal. As I wanted the gun to be carried by the first person character, I would need to import the gun as a skeletal mesh. This is done by selecting the skeletal mesh check box in the import options. The skeleton should be set to none, this will force the engine to generate a new one for the model.
The next step was importing into Unreal. As I wanted the gun to be carried by the first person character, I would need to import the gun as a skeletal mesh. This is done by selecting the skeletal mesh check box in the import options. The skeleton should be set to none, this will force the engine to generate a new one for the model.
The gun model was now in the game, complete with textures, now to get it to actually work. Although I have set up a gun from scratch in my previously disbanded project, the easiest way to get it working quickly is to exchange the existing gun model for the newly imported one. Firstly, you need to find the first person character's skeleton, this is fact just a pair of arms. Once opened in the editor, you should see a list on the left that contains of all the bones that the skeleton consists of. Scroll down the list until you find one called 'GripPoint', this is not a bone but a socket on the skeleton where an another object can be attached. This one already exists as its where the default gun is held. You can use this one, but I duplicated it so I can easily revert to the default gun if needed. Now right click on the newly created socket and select 'Add Preview Asset'. A box with all your available assets will appear, just find your gun and it will appear in the right hand.
At this point the gun may look like its being held strange, or too big/small, this can be changed in a moment. First you need to change the skeleton to a more natural in game pose, such as an idle position. This done through the 'Preview Scene Set' on the right. Change the 'Preview Controller' to 'Use Specific Animation' and then select the idle animation. You should now see the skeleton in much more natural position. Select the socket you created again, now you can adjust the scale and position of the gun until you are happy with it.
After you are happy with how the gun looks, hit save and then close. Next, go to the first person character blueprint and then select the viewport tab. In the components list (top left), find the one called 'FP_Gun'. The details panel on the right will have the default gun as the skeletal mesh, change this to your gun. Don't worry if it looks strange again, or the size has changed, this will be fine in a moment. Now go to the construction script tab and you should see an 'AttachToComponent' node, change the socket name to the one you created on the skeleton, make sure it is spelt correctly! If you go back to the view port you should now see the gun being held as you intended.
The last step is adjust where the bullets are spawned from for your gun. You should notice there is a sphere component as a child of the 'FP_Gun', this is the location that bullets will be spawned at, so just line this up with the muzzle of your gun and now you should have a gun that fires projectiles. I also added a point light to my gun, as my Halo assault rifle has a flashlight mounted on the front.
Wednesday 12 December 2018
Creating a flamming barrel - from Maya to Unreal
I decided that I would try and create a simple flaming barrel to add to my game level, just using what I had learnt so far, and a test run before importing my gun model into Unreal.
Firstly, in Maya 2017, I went to the create tab > polygon primitives and turned interactive creation on. Next, I selected the pipe shape from the polygon shelf, and dragged out the base, height and thickness to create a barrel type shape.
The last step in Maya was to export my model for use in Unreal. Before exporting, I went to edit > delete all by type > history to reduce any risk of errors. With my model selected, I then went to file > send to Unreal > selection, and I chose the directory where my Unreal project was located. Next was the export selection settings. I made sure the file type was to FBX export, and importantly for exporting models with materials, I checked the box for embed media in the options. You can also check geometry > smoothing groups to stop Unreal throwing a warning when importing, but found it makes no real difference if I didn't.
Moving into Unreal, I used the import button in the content browser to find my barrel in the import folder, it imported the model and material fine. Next, I created an actor blueprint called 'flaming barrel'. I added a static mesh component and selected the barrel model in the details panel. The model was small, so I scaled it up a little (R). I then added a particle system component, and added the 'P_fire' effect from the engine starter content.
The model was now ready to add to the level. I decided to duplicate it a couple of times, and have a group of three in the corner. I added a point light with an orange glow to give it a little more atmosphere. The finishing touch was a sound effect, this again came from the starter content. I wanted the sound to only play when the player was close to the barrels, to do this I used sound attenuation. This allows a sound to activate and play at different volumes depending on how close the player is to the source. This was achieved by adding the sound directly to where the barrels were, then in the details panel for the sound, override attenuation must be checked. Finally, to adjust the distance the sound travels, the falloff distance can be adjusted, and is represented by a sphere in the editor window.
I'm quite pleased with the overall effect this adds to the game, it just adds to the atmosphere. It was also it was fairly quick to do, in fact it took less time than this blog post!
Firstly, in Maya 2017, I went to the create tab > polygon primitives and turned interactive creation on. Next, I selected the pipe shape from the polygon shelf, and dragged out the base, height and thickness to create a barrel type shape.
Now I wanted to add a little detail, and metal barrels generally have several ringed ridges. To do this, I added in several edge loops (mesh tools > insert edge loop) by clicking on an edge and dragging the loop into place. Six edge loops were created to make three bands, I then selected face mode and selected all the faces in each band, next I used extrude (Ctrl+E) to pull these faces out slightly. Lastly, I used the bevel tool (edit mesh > bevel) to round the extruded faces.
I just needed to give the barrel a base now, this was done by adding another edge loop on the inside bottom of the barrel. I selected the newly created faces, and went to edit mesh > merge to centre to form the bottom of the barrel. Now the shape was finished, I wanted to add a material. Holding the right mouse button and selecting object mode, I had my barrel selected with a green outline. Pressing the right mouse button again, I now selected assign new material. There are various material types available that represent different material effects, I wanted a metal finish, so I chose blinn. This brings a panel up on the right of the screen where various material attributes can be set. I set the colour to a darkish red, and turned down the reflectivity. My barrel model was now complete.
Moving into Unreal, I used the import button in the content browser to find my barrel in the import folder, it imported the model and material fine. Next, I created an actor blueprint called 'flaming barrel'. I added a static mesh component and selected the barrel model in the details panel. The model was small, so I scaled it up a little (R). I then added a particle system component, and added the 'P_fire' effect from the engine starter content.
The model was now ready to add to the level. I decided to duplicate it a couple of times, and have a group of three in the corner. I added a point light with an orange glow to give it a little more atmosphere. The finishing touch was a sound effect, this again came from the starter content. I wanted the sound to only play when the player was close to the barrels, to do this I used sound attenuation. This allows a sound to activate and play at different volumes depending on how close the player is to the source. This was achieved by adding the sound directly to where the barrels were, then in the details panel for the sound, override attenuation must be checked. Finally, to adjust the distance the sound travels, the falloff distance can be adjusted, and is represented by a sphere in the editor window.
Monday 10 December 2018
Unreal: Adding a main menu
I've now added a main menu to the game, and although it was a fairly straightforward task, I wasted a few hours trying to achieve something more complex. My main issue was with the in game HUD either always displaying, or not at all. I think I know what I was doing wrong now, but I've stuck with a more simple solution. I used a YouTube tutorial for guidance.
Firstly, I created a new level and a new game mode for the menu. After opening up the menu level, I went to the window tab to gain access to the world settings, from here I could change the game mode override setting for the level to the menu game mode I hade just created.
The next step was to create a user interface widget blueprint, this is essentially where the menu lives. I kept it simple this time, black screen with buttons anchored to the bottom left. I created buttons for 'Play', 'Options' and 'Quit'. Further buttons for resolution settings were created for the options screen.
Visibility bindings were created for both the menu buttons and the option screen buttons, with an Eslate visibility variable allowing an easy transition between them.
The last step was to create On Click Events for each of the buttons. The play button simply opens the selected level, similarly, the quit button just exits the game. The options and return buttons toggle the visibility variables for the associated buttons. Finally, the resolution buttons allow the game to be played in 1080, 720 or 480. This is achieved through Execute Console Command node, and scales resolution accordingly. An example command for changing the resolution is 'r.setres 1920x1080f'. The 'f' is added to display in full screen, where as a 'w' would set a windowed screen.
Although its fairly simple to create a menu screen when you know how, I do think its a little long winded to have to create a separate game mode. Maybe there is another way to do this, but from my research it appears to be the most common solution.
Tuesday 4 December 2018
Adding atmospheric fog
This is only going to be a short post, as I've just spent the last few hours adding an atmospheric fog effect to the game and adjusting it until I was happy. The process of adding the effect is quite tricky to explain, and better to watch. I used a series of 3 YouTube videos to learn how to create the effect. The fog itself is a particle system, which can react to player (as well as enemy if desired) movement. Overall, I'm really pleased with the visual effect Its added to the game.
Monday 3 December 2018
Fixing new problems
I always find when I add something new, it generally causes more issues to fix. So, I realised that after adding the death animation, the zombies continued to follow the player, even though they were dead. I tried to add a condition in the AI behaviour blueprint, however this didn't work. Again, I found the solution on the Unreal Forums. I needed to use the node "detach from controller pending destroy", this would remove any AI control from the zombie. This caused another problem! Now the radar enemy icon was appearing in game after it was detached from the controller, it didn't take me long to realise I could use the "Set Visibility" node to hide the icon after I detached the controller.
Subscribe to:
Posts (Atom)