How To Change The Graphics Settings | Creating An Options Menu Part 2 - Unreal Engine 4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back to another unrelenting four tutorial in today's video we're going to be advancing upon and continuing on with our options video which i made previously so if you haven't watched part one of that i definitely recommend watching that first and in there what we did is we just set up the visuals of this screen you can see here so what we've done is added any text and buttons so if you have something which looks like this already then you don't need to watch part one but if you don't have that then i would recommend watching that first which again will be linked in the description down below today we'll be doing is setting up the functionality of all these so we actually press these buttons is going to actually work so we'll change all of these different settings which we wanted to and we'll also be setting up the optimal settings button as you can see down here so without further ado let's get right into this video so the first thing we're going to want to do is open up our options menu widget which again we created last time so i'm going to open that here this is what we have i'm going to go straight into the event graph here so the only code we'll have in here at the moment is our back button code so we can now go back from the options to the main menu so the first thing i want to do is set up the visuals of selecting a button so when we select a button we want that one to be kind of highlighted so the player knows that is the option they currently have selected and that's the one they're using so to do that i'm gonna be utilizing functions and disabling the button what you can do is set the custom style of the image on the button but i'm just gonna do it by disabling the button that way it's also slightly more efficient because it means the player can't continually keep setting the same option over and over again so what i'm going to do is create a plus function up here naming this select window mode because that is my first option as you can see here i'm just doing an order it doesn't need to be but it makes more sense for me then if we select the input of our function you'll notice we can add inputs and outputs we want to add in two inputs so i'm going to hit the plus new parameter here naming this one full screen and i'm going to leave that as a boolean so if it's full screen or not i'm going to create another parameter naming this windowed so we can choose if it's full screen or windowed based upon what the player inputs now in here what i want to do is get my full screen and windowed buttons so i'm going to drag in my full screen button so hold ctrl try again to get it and the same with my windowed button should be down at the bottom here out of these i'm going to set is enabled just connecting that into the function here doing that for both of them like so now what we want to do is we just want to do the opposite of what they are so if it's not full screen we want to enable the full screen button so out full screen we're going to get a not boolean connecting that into is enabled there then do the same for windows so we have windowed not dragging that into the set is enabled like so and i'm going to move these out a tiny bit to give us a bit more room like so and again what we're doing here is if the user has selected full screen this will be true which means we want to disable this so if that's true the opposite is false so is enabled false means it's disabled so then if it's full screen means it's not windowed so this is false which means that's true so it is enabled true windowed button is enabled so i hope that makes sense the reason again i'm doing enabling disabling is because it does visually look different and it also acts different to the player can't use it again because the button has been disabled so we compile and save that and we're essentially going to be doing this for all of the different options which we have here so we don't need to do the display resolution so the next one for me is the frame rate limit so what i'm going to do is i'm actually going to duplicate this so i'm going to right click on the function duplicate naming it to be select fps button like so then i'm just going to change the full screen button and window button to be 30fps so i can just drag it on to change then 60fps then i want to duplicate these so i have another two buttons with this then being 120 fps and finally last but not least unlimited fps should be down near the bottom there we go unlimited fps button like that and we're going to do the same thing again so we now want to change over the boolean inputs in here to be 30 fps 60fps add in two new ones renaming these to then also be 120fps and unlimited fps again dragging in the knots into them so it just does the opposite of what the input actually is so again i hope this all makes sense to you if it doesn't just let me know in the comments down below i believe i should have explained it properly but i can always explain in further detail if you need so we'll compile and save that and obviously this will also make a lot more sense once you actually see it working and see it in action so now let's check what our next one is go to the designer it's the view distance so we'll duplicate this right click duplicate and it should be a lot quicker to set up now as all of these are four options so this one is now not fps but select view distance button then these are going to be near medium far and epic and again just change over the buttons so it's going to be vd near vd medium vd far and vd epic and that's all we need to do it's now perfectly set up although that one did set it or change it so let me just change that over there we go compile and save and then we'll do this again so the next one now is the post processing right click duplicate select post processing button not view distance and change them all over once again and after this again it will be much quicker because we won't need to change the inputs down here this will be the last time we change the inputs then we'll just change the buttons so this is now low medium high and epic i believe that's correct anyway let me just double check yes it is and then we just change the buttons so this is now the post processing so we need to go to pp low medium high and epic compile save next one is anti-aliasing so duplicate it like i said in the previous video a lot of these are going to be very repetitive tasks you do it once then you know what you're doing so duplicate and this was anti-aliasing so change this name to be anti-aliasing and there's also so many different ways of doing this but this is just the way which i personally prefer to do it especially for a simple basic system one which we don't need a lot of different images changing on the buttons so there's no a right at the top very easy a a low a a medium a a high and a a compile save next one is text quality and we've got one more after this so duplicate change this to be text quality and then change the buttons over for rtq so texture quality tq should be down at the bottom here we go tq low tq medium tq high and tq epic and then finally last but not least it should be shadow quality i believe yes it is so we will right click duplicate the shadow quality button and then we should be done for this section so sq buttons down here again sqlo sq medium high and sq epic compile save that and we can close these functions as that's all we need to do in them we will call them later on where we'll then do the code for that so that's the first part and a very repetitive part firstly set up so now let's actually do the functionality of changing the graphics the most exciting part of the video so let's start off with the viewing mode again i'm just gonna do it in this order here so viewing mode what we need first is the buttons so let's find them we've got a full screen button unclicked windowed button unclicked so again select them and choose the appropriate button for them then what we're going to be doing for this is we're going to be getting the game user settings so drag out of the full screen button and get game user settings and this is a much more efficient way of doing it over console commands out of the return value we're going to set full screen mode and the info screen mode will be full screen and that's it this is what i mean by it's a lot more efficient and also a lot easier that's all we need to do you don't have to remember a really long console command it's just this now what i also want to do is apply the settings straight away you might want to do this on a button but i want to do it here so at the return value of the get game settings i'm going to apply settings like so we don't want to check for command line override so untick that there and again if you want to do this on a separate button then just get a button get the gaming settings and apply settings and don't do it here it's that simple then after this we're going to call our function we just created so for me that is select window mode and for this one i want to tick full screen and make sure windowed is false so again full screen is selected windowed is not so that'll change the appropriate buttons then we're going to select all this ctrl c ctrl v to duplicate it down here and just change over to be windowed mode so in full screen is now windowed and you can see you can also do windowed full screen if you wanted as well but i don't want to and then select window mode is now windowed instead of full screen it's that simple so i hope that will make sense to you i'm going to select this here's you to comment it naming it viewing mode so we know what this does next is the fps cap so again i'm going to find the buttons they should be at the top it's got 30fps 60fps 120fps and unlimited which is near the bottom there we go once again a very simple and similar process so get game user settings and all we need to do return value set frame rate limit once again very very simple and in here you just input the limit that you want so for me the first one is going to be 30 as that's what this button does then apply settings once again very repetitive very easy to understand untick that and we want to again use our function that we created for the buttons and that is set fps what i call the function select not set there we go select fps button there we go and this one is 30fps there so nice and simple copy and paste all this down here changing it over to be 60fps instead of 30. so this one is now 60 and this one is also 60. i'm also just going to move all these down one just to give us a bit more space like this copy and paste it do the same process over and over again so this one is now 120 fps 120 fps and this one will be unlimited fps so how do we get unlimited fps in our set frame rate limit we just leave it as zero if you hover over the new limit you'll notice or have the hover of the button okay sometimes it says it sometimes it doesn't but essentially if we leave it at zero then what's gonna happen is it'll stay unlimited so there's no limit so there we go so if you hover over this bit set uses frame rate limit zero will disable frame rate limiting and down here this wants to be unlimited like so so perfect now we're gonna select all this and this is fps limit perfect although actually i have forgotten one the fps limit wasn't next it was the resolution so let's set that up now i'm going to move this down a bit i'm going to do that next it's here so the resolution so what we need to do that is actually slightly different so we need to select our combo box and for this we're going to be using the on selection changed event which we have here track this up here like so now we notice it's actually returning a string so how do we change the string into a screen resolution well firstly let's actually set the resolution so we'll drag out this get game user settings then it will be set screen resolution and then obviously apply settings like so and again we don't need to do a function for the button because it does it automatically for us so there's a resolution here how are we going to be setting this is an int point structure so what we can do is drag out this and make end point and now you'll notice we have an x and y integer value so the x is obviously in 1920 y is 1080 just for example so how do we get that from this string well if we drag out the selected item what we can do is split so we're going to be splitting this string the in string we're going to write x so it's going to be splitting the string on either case of the x because again you'll notice how i've done mine is if i select it we've got 1920 x 1080. so in here where it attacks the x is going to split it on the left and right so you know to be of left string and right string left will be 1920 right will be 1080. search case you can ignore case or be case sensitive if you want but you may as well just ignore it search directory you want to do it from the start then we can just drag these in so left s we'll go into x write s we're going to y it is as easy as that nice and simply done for us and also we want to make sure we untick that therefore the check for my line override again is that simple we've now got it done for setting the resolution so we select all that c to comment it and change resolution so so we again we know what this does i'll just move that over a little bit so perfect compile and save that and now the next one should be view distance so if you find a few distance buttons it should be under vd here so vd near vd medium vdfar and vd epic move these over here like so now once again get game user settings then as you might have guessed set view distance quality and you'll notice this is giving us an integer value it's not an nm so we can't choose near medium far or epic it's just giving us a value however if we hover over it once again you'll notice zero to four the higher the better now this is the same as it is in the console commands so if you know how to do it via console commands you know what you're doing here but essentially zero is near one is medium three is far four is epic so it's very simple to remember the lower the worse the higher the better so for the first one i'm gonna leave it zero then we want to apply settings and we also want to do our function for setting the button so that is select view distance button like so leaving it as near copy and paste all this down here and this one is now one and medium paste it again this one will be two and five and last but not least will be three and epic i believe that's correct anyway so i think earlier when i said i actually miscounted it so sorry that's my bad zero near one medium too far three epic four i believe will be ultra which again i mentioned in the previous video but i'm not gonna be doing that but it's the same thing you just add in another button and do ultra if that's what you wanted then i'm going to select all this comment it naming this view distance like so so this might be a bit of a boring video for you because again it's repetitive but it gets the job done and it works nicely so now let's move on to the post-processing so that should be pp here we go pp low medium high and epic and the same thing with just from the view distance it's the same so it'll be a number system so zero one two three and 4 or for us just 0 1 2 3. so of low get game user settings then set post processing quality again you see it's just a value there first one will be zero then apply settings unticking that and calling our function of select post processing button having that one is low so again the numbering value here is the exact same for all of now so it goes from zero to four the higher the better so i don't need to explain every time as you know what it does copy and paste this down here setting this one to be one and medium pasting again down here to be two and high and one final time to be three and epic like so simple as that this one will comment to be post processing compile and save now this one next is anti-aliasing so that's a a right at the top a low a a medium a high and a aa epic move them over into the space which we want and do the exact same process once again so get game user settings out of this we're going to set the anti-aliasing quality zero to four so the first one will be zero apply settings unticking this here and then our select anti-aliasing button like so setting it to low to start with then a simple copy and paste and change over the values so this one will be one medium two and high and then finally last but not least three and epic select all that c to comment it and name it anti aliasing like so only two more left to go and then the optimal settings as well so this time now it's the texture quality so that's tq low medium high and epic move them into place then get game user settings out of this what we're going to do is set the texture quality zero to four leaving this one at zero apply settings unticking check for command line override because we don't need to be doing that then select texture quality button this one is going to be low simple copy and paste change over the values this one will be one and medium do it again this one will be two and high and this final one will be three add epic and i'm going to move these all over to the left a little bit and i've given it a bit too much space there we go select comment texture quality so sorry if it seems like i'm rushing through this a little bit it's just obviously the exact same process so you know what you're doing i don't need to explain it too much and again very repetitive i just want to get through it for you to get into the next section of the code but i don't want to cut this out because i do still want to be showing you what i'm doing and then finally last but not least it's the shadow quality which is sq low medium high and epic move them into space get the game user settings if i could spell it correctly there we go get game user settings set shadow quality zero to four first one being zero apply settings making sure to come out the return value of the get game user settings unticking that then select shadow quality button like so with the first one being low duplicate it changing of the values to what we need first one being one and medium then we've got two and high and then we've got three epic comment this for the last time naming this shadow quality now we will compile and save that and that is now all of the graphics options done and set for us you'll see we've got all of these here that we can change the last thing i'm going to do in this video is i'm going to set up the optimal settings so the player's pc will actually decide what the best settings for them are and this will be unique and dynamic for each player's system this is actually a lot more simple than you might expect which is why i love the games settings everything is so easy so if we find our button for the optimal settings i believe i just called it optimal button here we are get the on clicked event i'm going to move it up here just so it's easier to find then out of this we're going to get game user settings as you may have guessed then out of this what we're going to do is a simple run hardware benchmark you can leave all always the same so work scale of one cpu multiplier and gpu multiplier also at one then as the return value of the get games settings we want to apply hardware benchmark results like so now this isn't going to update the visuals of the buttons but that is something i will do in the next video which will be a saving and loading of our options but this the moment will still work perfectly so if we comment this we can find and use optimal settings for players system like so we can compile save and close this and this should now be working perfectly for us so you'll notice it's in 1280 by 720 i've got the options i can change it to 1920 by 1080 and it has updated that once it loads in there we go and also make sure it is full screen and you'll see full screen is now selected i can change my frame rate limit like so if i actually show fps i believe it's called or not or is it just stats in actual fact i think it's just stat fps there we go so you notice on the right i'm getting 30 i believe that is if i change to 60 we've now gone up to 60 120 i do get so we've got 120 then unlimited it's going up to about 180 170 not got the best system but you'll notice that is capping the fps there and i can change our view distance here we obviously won't notice it too much but if i put them all on the lowest settings and let's cap it 30fps we'll go back we start our game you'll notice the game now looks terrible and is running at 30fps because it's on the lowest possible settings now if i was to go back into the main menu and change them to the highest possible settings we should see it looking a lot nicer so you can also see when it's windowed mode it's like this full screen will do full screen however the resolution will be horrible like this actually i've just noticed on my recording that say the same resolution but for me on your actual monitor it's full screen if i change the 1920 by 1080 once it's loaded you'll notice it is proper full screen like this so let me again put this on an unlimited fps highest possible settings let me enable my fps once again there we go go back start the game and you'll see it looks a lot nicer and i'm running around 100 fps as you can see here so this works perfectly for us so i think that'll be it for this video as we don't even want to do we've set up a graphics and options menu in which we can change all the different graphics which we want as you can see here and the visuals will update as well so the player knows what it actually is and again in the next video what are we doing is going over actually how to save and load these settings as well which is probably a lot simpler than you're expecting it to be again you can also see the optimal settings what it's doing is it's loading there it's now set them obviously the visuals haven't changed here but it will change in game so thanks so much for watching i hope you enjoyed and hope you found it helpful and if you did make sure to like and subscribe down below so thanks so much for watching and i'll see in the next one [Music] you
Info
Channel: Matt Aspland
Views: 54,510
Rating: undefined out of 5
Keywords: ue4, unreal engine 4, unreal engine, tutorial, ue4 tutorial, unreal engine 4 tutorial, how to make a game, how to, ue5, unreal engine 5, view distance, post processing, anti, aliasing, anti-aliasing, texture quality, texture, quality, shadow, shadow quality, frame rate, limit, fps, windowed, fullscreen, resolution, ue4 main menu, ue4 change settings, ue4 change graphics settings, change, graphics, settings, options, texures, ue4 how to, main menu, game user settings, hardware benchmark, screen
Id: 8-5SXGGZD64
Channel Id: undefined
Length: 23min 55sec (1435 seconds)
Published: Mon Mar 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.