>> Welcome. We are going to be looking at how we use
Visual Studio specifically with developing game in Unreal Engine.
But if you're looking to develop using
Native or C++ in order to coat,
it's going to be really useful for you to have an ID,
a program that you can use to read
and conveniently write code as you go.
I've been using Visual Studio since I
started and we're going to be having a look at
setting up Visual Studio to be developing a game.
We're going to go
from the start as if you've just got to clean install.
What we're going to do, the first thing we're going to check out
is how we reset your Visual Studio set up.
You can go down to these import and export settings
and that lets you reset
all of the settings back to basic and that'll change
the layout of my window a little bit at the moment.
It tells you what you want as your default settings.
We're going to be developing in C++ for Unreal.
We click the "CPP" one and if I click "Finish",
we don't see that much change,
but there'll be definitely some changes in the window now.
First thing that I'd like to show you as well
is the install that you need for Visual Studio.
It should be quite self-explanatory. You install it.
If you go into modify,
you can get back to the screen you see when you're installing it,
which is what added extras,
do you want to include?
But the main one that we're interested
in is this game development with
CPP and then the second thing that I'd recommend doing,
and this is quite an important one if you're going to be using
debugging based on what engine version,
you're using an Unreal,
you want to make sure that you've got the debug symbols.
What that allows you to do is
you can debug not just your own code,
but you can debug the engine code.
The next step then you would pretty much be working in VSTN.
There's two ways. Let's say that you started a new project.
Let's close Visual Studio for now.
Let's go ahead and open a project.
I'll go into Cattenburg. This is
where you would make a new project that I was on about.
You choose game,
you go to next,
and then you choose what type of
template you want and this is what I was on about.
You choose whether or not you're going to do it in Blueprint.
I'm going to do a couple of things in here.
First off, I typically use an extension called Visual Assist,
which I highly recommend.
I'll talk about it a little bit later.
When you create a project,
you'll just be launching the editor, when I say editor,
I mean the Unreal Engine editor and
you won't really be doing anything with Visual Studio.
As you add more stuff to your project,
you need to update the solution
to know about all of the new files and changes to your project.
But you run that and what it does is it'll generate a new solution
for us and it'll give you a warning once
it's finished to pretty much say,
this is changed, I need to refresh normally.
You'd refresh if there had been any changes based on that,
but I'd run that before,
so there's no real changes for me.
Once you've done that, you're essentially able
to work entirely from Visual Studio.
From now on, we're not going to be launching
our project from Epic Games Launcher you can
attach with debugger and that'll launch the editor for you
and allow you to actually debug when you need to as well.
First thing, let's have a look about setting up VS.
Some of the things that I like to do when setting up VS
initially there is an extension called Unreal VS,
which is the official from epic,
they make a small extension to help with a couple of things.
We're first going to go through trying to set that up.
This is quite handy.
This is a command-line parameters that you can add on.
This button here is really nice.
If you remember earlier I showed you
the weird thing you do when you go,
if we go back to where I was in my project,
here we go in Cattenburg that generate project files.
Instead of always having to go to this location to do it,
you can use this button here,
this refreshed project that will
also generate your project files for you.
Then we have this button here for the Batch Builder.
First off, I want to show you that you
can actually just get rid of stuff
you don't need and this is true for any of the toolbar at the top.
The little drop-down at the end and remove
buttons and you can just get
rid of the things that you're not going to use.
I'd like to try and clean down the things that I don't use.
The command line I do use,
the refresh projects I do use,
and the Batch builder I won't use on a small project like
this and I'm going to take it off
this menu because I don't need it.
You can always get it back if you need.
You can just come back in and enable the button.
You can do some cool things in this box here.
But one of the main uses
I have of it is you can pass it like a map.
That is one use of this command line
and there is extra things you can do,
you can launch it so it builds.
You can do some things to skip, some compiling.
You can see that it's
launched us into this map and this map is my test scene.
We were just talking about this top bar
up here and one thing that I don't like about
this top bar is I can't see the argument on the end of it.
All we need to do is tell these boxes to be wider.
To do that, it's quite straightforward.
You go to the end of the section that is in.
If you go into customize,
you can go in and you can change anything that is in that menu.
We want to make this wider.
If you've got to modify, you can go
ahead and you can change how wide you want this to be.
I'm going to just set mine to like 325, let's say.
We do that we press "Close" and you can
see now that that box is gone wide.
I can actually see what's at the end of it.
This comes in really handy and if you don't understand this,
it's also something that I just didn't know
for ages what it means.
This is basically telling you when you press "Compile"
and you're going to build how much you need to build.
I tend to have it in debug game always
the downside it's a bit slower.
But what we're trying to address here is basically,
how can we make this box bigger?
We've learned before that we can just go in and remove buttons and
go down to the customized section
and then we just go to the line that we want.
We can make this a better width.
Let's just go 180. There you go,
I can actually see what it is.
There we go, so if I press "Close" now,
whichever one of these we choose,
we can actually see what version it's on.
That is how we can fix some of
the simple issues that have been in VS
for a while so that we
know what configuration that we're building.
What I like to do then is to customize my toolbar.
Let's go on this first group,
this is your standard group.
If I right-click and we see what toolbars that we've got up here.
If I get rid of text editor,
you'll see that some of them disappear.
The ones that I found useful in here,
navigate forward and backwards, super-handy.
Some of the things I don't use,
the Apply Code Changes.
I've not had that working,
but maybe it's something I don't understand,
so I'm going to turn that one off.
We then have browser link now, It's not even up there.
Finding files and then we have some extra ones down here.
But that has made this a bit smaller for us now at
least we basically just have things that we know what they do.
Then we've got Unreal VS that we've already
tidied up and then we've got another block over here,
which is add to our editor ones.
There's one extra menu that I do recommend that
we have on here as well and there's one called the Build Menu.
If I'm honest with you, the most useful thing I
get out of this is this Cancel button.
The cancel I find useful here.
What I'd remind you about is there
is extra things in here like debug,
which will give you a bunch of debug options as well.
What happens is you'll notice VS
changes the toolbar at the bottom.
Along the bottom will change from blue to orange.
When you do that, it changes the configuration of VS a little bit.
It will enable that debugging.
You'll also notice that this bottom
section of the screen changes as well.
We get new windows at the bottom,
we've currently just got output.
We've set up our toolbars now.
There's some options we're going to go through in configure.
I know this is a lot of setup stuff,
but these is things that I've learned.
Once you get more comfortable with using Visual Studio,
these are just things that you learn over time or
you feel comfortable enough to switch
off because you know that you never use them.
I think we'll probably have a look at this window that's
over here because we got code files along here.
This will show you the different projects that you have.
As we're working in Unreal,
we'll have UB04 as our engine as a separate project.
Now, what we've got then is
our Cattenburg project or whatever the name of your project is.
This is where you'll see pretty
much the structure of your code folders.
If I'm honest with CPP,
you generally can just jump into the header and you get
an idea of the structure any way you know.
It still may be useful for some people who like
using the mouse and
to use this site menu as well. The error list.
If you compile and there's a problem,
you will see the wonderful error list.
Now, in something like C#,
this is wonderfully useful.
What happens is we just look at the output and I used
that to determine where the errors are.
We'll see, here we go.
We've got a bunch of errors,
but this is what I use.
Now, this is where you'll get a list of stuff.
Sometimes it's right, don't get me wrong.
But generally, when you're compiling,
you want to make sure that you've got the option
of this doesn't automatically show.
The way to do that, if we just go to Add Tools in our Options.
If you go into our Project and Solutions,
and this is something that I personally recommend turning off.
Otherwise, it will always bring up
this window even if you close it.
Another thing that I've done during options
sometimes is if I want to change the font size,
you can control the mouse wheel to make
your actual code font bigger.
But sometimes like this output list or you find results.
Can you see how large this is? That's gigantic.
If you want to change the font settings to that,
you can go into the options the way I did before.
But you can just search here. If I just go font settings,
change the font color. Yeah, that's probably the one.
We go into this window and you choose.
You can change fonts and that if you want,
generally here what I've done,
you go into the output window and you can
just change the size of this.
Say, if it's a bit small for you.
But when I'm streaming it's quite useful.
If I'm debugging, it helps chat and be able to see,
what am I trying to understand.
The other thing I want to show you now,
this is the last bit of setup in
Visual Studio, if I'm on a Studio.
Just how you can move around Windows and get a set-up as you want.
This follows on from pinning a
super-handy as is dragging and rearranging your Windows.
One thing that I tend to do is to try
and rearrange it so that actually,
this window goes across,
and then I can split this window in
half and get more information out.
I can whack this on the side of this window instead.
Then this takes up less room.
If I go to, I think it's in view, isn't it?
View and then well there should be a Bookmark Window.
Yeah, there it is. If we click on that,
you can now see that I've got bookmarks bar as well.
But what I want to do is I want to drag this
across to be on the side of this window,
so then I can keep my bookmarks over
here so I can jump around code to bits that I want to.
The other thing is I generally sometimes do find it handy just to
pin these windows down at the way to give
us more vertical space in our window.
The scroll bar is pretty useful.
All the results that you find are going to be
highlighted in this brown, maroon color.
It's also useful to know,
have I actually included something.
But we can't change the scroll bar
to be a little bit more useful as well.
In here, you can use bar mode, that's the one.
If you take that instead,
this gives you a little preview.
It also highlights changes in your documents.
If I was to write, you see how I get
this little marker on the sides and I've changed it.
The other things you are seeing is the breakpoints as well.
That map mode is pretty useful on the scroll bar.
A couple of things then that I wanted to talk about was the tabs.
When you start working in a big code base
with other people and then
you end up hang to open files just to see
how stuff works even if you're not changing it,
it can get a bit of a mess. This is not good.
I don't know how it works memory-wise,
but I like to try not to have too many things open at once.
One of the main features I use is this pinning.
If I was going to be working on this file that I was in earlier,
let's say, I would pin this one.
One of the things I like to do,
we do lose a bit of vertical space doing this.
But if you go into the settings for it,
put in some settings that will make this stand out a lot more.
Show pinned tabs in a separate row.
If you do that, well,
that puts them all on the top.
You can choose that way in new tabs go. You can actually change.
Tabs can be on the side if you prefer to keep the vertical space.
I tried it for a while but I couldn't get used to it.
There's a thing called previewing that we saw a bit of earlier.
You can turn that off and control that in there as well.
The thing way if we have this on,
that it'll do a preview of it.
The problem is I have these files opened already,
it's not doing a preview button here.
You can click it and say, I want to keep that open.
But otherwise, if you click on another file, it's gone.
Enabling preview is quite useful if you only referencing files.
It can be pretty handy.
One of the main things that I tend to do is
just pin everything I need,
and then I can just go ahead and just close all the pinned.
That's how I work with tabs.
The final few things that I want to show then.
First off, this bookmarked window.
Bookmarks is super handy in my opinion.
They just allow you to put
key points in code that you find yourself revisiting.
Me personally, sometimes I like to use bookmarks for these,
this is where this certain code
happens and I know I might want to go back there in future.
They're easy enough to add when you're there.
I think you'd press Control and then you can tap K twice.
If we wanted to add one here for the set of
Character "Control+K" two times,
and then it adds a bookmark and it makes it a bit
easier to jump between key parts as you're working.
It's pretty handy in my opinion, at least.
Now there's a window called the Call Hierarchy as well.
This is something I feel I probably should use more.
But also it can lock up
your Visual Studio if you use it at the wrong time.
Essentially, you select a function and you just see,
well, where is this called.
Then you get presented with these options.
We want to see Calls To TurnCard and Calls From TurnCard.
This will look through and see where in
your code is calling this function.
We can see the two places that Call TurnCard,
it's in this function RevealCard and UnrevealCard.
I find that quite useful sometimes just to know,
if I'm changing this logic, what calls it?
I think that's pretty much all of the setting up your editor,
at least that I wanted to go through.
Hopefully, there's been a few little pointers of setting
it up and making sure that you feel that your edit is clean,
that you're in an environment where you're not got clutter on
the screen that you don't need.
That's what this next section is going to be about.