GameMaker Studio 2 Tutorial: Getting Started [EP1]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone today we're going to be starting the text-based tutorial series for game maker studio 2 but before we do that if you haven't already installed game maker studio 2 you're going to need to do that you can get a free version but it doesn't really let you do everything and well you can follow this tutorial series by using the free version but it won't be perfect you can buy the desktop Edition for $100 now what the desktop Edition will let you do is you can actually create your game and have an actual executive oh file for it which you can put online and then you can sell or do whatever you want with your game the trial version only lets you test so yeah the desktop version is $100 but if you had get game maker studio the original one you can upgrade for only 60 bucks so yes this is I'd say it a good enough deal to do it and I'd say it's actually worth it all on its own and one other things so in the description you'll be able to find a link but the files for my game are hosted on gamejolt comm we're going to be integrating our game into game show Camelot it's a very very great site and it's a great place for indie developers to really start out I mean that's what this tutorial is about I mean anyone can watch it that wants to but it's mostly going to be tailored towards people that really want to start making games and think that a game maker studio 2 is a great place to begin we should which it really is probably the best place to begin for a beginning so game maker studio has loaded for you and so this is the start page we're going to be dealing with this quite a bit so I already have two projects here but we're going to want to create a new project so we can just press new and we're going to be wanting to use the game maker language because well programming is very useful it'll ask you for a spot save your game I would recommend creating a game projects folder because with a folder you can well you can put all future game projects in one spot and then I'd recommend making a new folder and naming it's something like I'm just going to do something generic text based game is for now that's all this is we don't really have any sort of plan yet we have the folder and then we need to name the actual file text space games okay so here we go we've loaded it up we have an empty workspace here which means here is where we're going to put our new objects our new sprites our new everything and we'll edit them in this area it's like it's like a workspace or a desktop or something you use to well manage everything so we're here what do we do now well first of all you'll need to keep this in mind this will collapse this and expand stock panels as it says what that means is that well these two things are coming in and coming out these are where our resources are we have so we all go through this we have sprites which are obviously the images that you use for your game then we have the title sets these can be these are like these are things you can place in your world and they don't really use up that much code but they're kind of limited on how you can use them we'll get more in depth ended into these things in the future and there are sounds obviously you just store your sounds here and you can use them in your name pass these aren't really something we'll get into definitely not in the text-based tutorial but with paths you can set up well predefined paths and then you can have objects access those and go on those paths scripts these are useful these are extra bits of code that are separate from anything else and you can use them anywhere shaders well these are obviously very important for big games and we probably won't really get into these for a long time but obviously they can make new effects they can like change the color scheme they can do all kinds of things fonts these are going to be very important for a text-based game obviously fonts are well just fonts you'll need you'll need to import new and interesting and fun fonts because like the basic fonts really aren't that great then timelines timelines are just a sort of like system for executing code we're not really going to get into these too much either but they can be used the paths and the timelines are very a game maker specific so I mean outside of game maker you're not really going to see these two things that much then there are objects this is where almost all your time will be spent when you're making a game objects are for the most part where the code goes any time there's code it's with the object now yes there are the scripts but the objects are accessing the scripts you have an object for your characters for you have objects for basically everything so for example a Goomba and Mario is an object it would be an object in game maker so is Mario so is so is the coin block so is everything basically and then you can also have an object a controller object which controls the game you don't see it it's not an actual physical thing in a level but it's still there and it can is controlling the game next we have the rooms the rooms are well you can think of them like levels I'll load it up right now you automatically start out with a room and this is where you can put a level on but the way that programming works you might want to use your rooms differently than have every level be one room you might want to put multiple rooms to your levels together or you might want to have levels split up into separate parts and then you can have so for example you could have some sort of system where you're fading like you're going into a door and you're fading from one room to another so it looks like you're going inside the building and we'll get in we'll get more in depth with the rooms later so let's go back to the workspace when we clicked on it it automatically switched us over to a view of the room next we have the notes now these notes are just notes they're not code and then you can just right you can just write whatever you want literally okay and then there's included files these can be well obviously separate files that you use from outside and then there's extensions now these are a bit more complicated we can get more into them later but we won't really needed me know them right now and there's options in configuration these are also game maker specific so for example like Windows we can change the version we can change the name we can deal with all this stuff this is one of the stuff you deal with when your game is ready and you want to send it out to the world so let's use this note and I would like it if you would go along with this tutorial I mean I will have all this code uploaded to gamejolt so you can download this file but typing the code yourself I mean even if this really isn't code what we're doing right now but still as we go on it's really useful to types of things yourself because even if you make a mistake you can go back and try to fix your mistake and as you're trying to figure things out you'll understand your own code better and then as we get farther on I'll encourage you to do your own thing to branch off in your own direction and make the game how you want exactly even when we download fonts I might have you guys download a different font so but anyways back on topic the notes so we want to know what we're doing with this game we already know that it's text based because that's a very easy place to start so a text based game what does that mean well obviously text will appear will appear on the screen so we know that much what else we what do we want to have in our game I mean these are good things to figure out before you get started we want to have different colored we want to have colored fonts we want to have multiple on what else do we want well it's kind of boring if you just display a font or if you just display some words and then have those go away and have the next words come up or something like that we want a cool system of one character at a time in case you're not sure what I mean by character I'm saying like one letter at a time so like each of the letters appear one at a time he's like if you if you see videogames a lot of them do that where well one character appears at a time on the screen so we're definitely going to want that maybe we're going to want um Claire has choices so like he can see the player can answer yes or no to questions and honestly this kind of makes things a lot more complicated for us but this is still a very basic game and should not be super hard to implement maybe we want some sort of background background team or characters and finally we want this to come out on Windows so I think this is a good list of things we need so we have our notes in place what do we do now well we don't have anything right now I mean we have notes we have our basic notes and we have room zero one thing that we should really do is we should rename our room because there are naming standards that we have that we really need to get used to so for example for rooms we do RM underscore and then we do whatever we need the room to be called I'll just call this main level and also as you can see here I didn't put a space I capitalized VL we also do this a lot when we're naming files because putting a space there doesn't always work so we have our room it's our main level and what do we need to do now well the best thing you can probably do is go down to the corner here and right now the resolution is 1024 by 768 let's play this as you can see it's kind of just a box right now so like my monitor is sixteen by nine I'd assume your guyses are so you can have it even have the resolution be whatever you want I'm going to have a be 1280 by 7 well I'll be 1280 by 720 because well that's a very standard resolution to have so now if I press play yeah so it's a nice standard resolution it's not the full size of my computer or my monitor but I don't want it to be for now I mean you can have this be something different you can have it be whatever you want but I recommend a standard sort of view because when people are playing our game we will want them to have a good resolution to play with obviously and sixteen by nine is the sort of standard so we have all that now what should we do well we've done a little bit of stuff so we should probably save the project simply pressing on this should save it okay so we have the main level and we have everything else we probably want some fonts so you can load up the internet and you can start searching for some fonts I'll just search fonts and I'll search free to use the reason I want to use free to use is because some people require that you pay the money if you're making money off of their font what you can look for is you can go to this website and you you can look right here and if it says this font is free for commercial use that means you can use it without having to pay the person who made the font so let's go along let's see if we can find something nice I mean I'm looking for a kind of I want something maybe pixelated because that's a standard sort of like indie game look so let me see here I mean you can download whatever whatever um font you want but I'm just going to go with a sort of standard okay here we go so I just found this pixel font font it's slightly more pixelated than the others so all I need to do is press download and then when I open this up I'll get a zip okay so there's some sort of little readme okay I mean it might be it's pretty important to actually redo this just so you make sure that you're able to use it so it'll come in a zip likely so you'll need to open it up and I'll just send this over to my documents or it will let me and then once you have it out you can let left-click and press install because then your computer will have the actual font on it this is useful because then game maker can access it too so we're going to want to create a font in game maker once you have the font downloaded now the naming convention is SMT underscore and then whatever you want to call it so I'm going to call this main for now because this is going to be our main font and so the fonts online that I downloaded I already forgot what it was called that is one weird name let's see you should be able to find the font here yeah this is the font so yeah you can download the same font or something different and alright so we're probably going to want to have the size a little bit bigger because our game is text-based and the text is the focus of the game so making it be a fairly large font is probably useful okay so we have it size 29 and then whenever we use this font is going to be size 29 okay now that we have the font in place and we have the room ready all we need to do is to add a way for us to display some text on the screen add some code finally so what we're going to want to do is we're going to want to create an object remember an object is where everything is stored and so we use the obj underscore and in the name of it but actually we also have another naming standard or at least I use this naming Stan I do cont underscore and this means controller because an object to me is something that you can actually see in the room and you can actually interact with a controller well controls the game in some way so we're going to want to name this controller text because this is not an object you're going to see it's just going to display the text it might be kind of confusing but the object itself is not displayed we're going to set up code so it displays the main font that we have right here okay you got that um so yeah here are all the events we have so in the events is where we put the actual code we have a lot of different events here as you can see we have the create event it is Australia the cleanup the step the alarm draw all of these events now four times site we're just going to start with a create event the create event is well code that happens right when the object is created because there's some code because there's also the arm step event the step event is like the bulk of your code your main code that's where the the code will run every single frame so every single step as they put it the code will execute and yeah that's where you have just your normal sort of code for like movement your players depending on what type of game you have like your bullet firing but the create event only happens once this is where we kind of set things up for the game now what we're going to do here is going to be a little bit confusing I actually first we need to talk about these now what are these green things here you might be wondering so these are comments they're called comments and they're not actual code it's also called pseudocode this is where you can write stuff it's the same thing as the notes except in the actual code so I mean before any of your code you can write a comment just by putting two slashes in now this is useful because well I mean code isn't always easy to understand just by looking at it so you can have a comment before it or after it describing what it does exactly and then at the top line we have three here and then we have add description so we can put a description right here so the create event initializing yes map I'm putting that there now you're going to find out in a second what the DES map means but as you can see I can easily see right here I don't even have to open this up to know what it's going to do it's going to initialize the DES map so first of all we need to figure out what a DES map is it's something I'm introducing to you so we can press on this Help button right here this can lead us to the manual in the manual we have all kinds of information so we can go to search instead of just looking through the basic stuff we can just go straight to search and let's search des now see what comes up okay so these are actual specific code commands specific functions we just want to know what these maps are in general so a DSM F is a data structure that stores data in linked pages consisting of a key and a corresponding value now I want to ask you guys to go over this and read this yourself so you can pause this here explore a little and find out some new cool things but I'll explain it once you get back okay so what do we RDS Maps well it's a way to store data I mean okay so there are plenty of different ways to store data here let's go into our notes and I can go over it yes yes so what really are they the ball first of all the DF stands for data structure it's a type of way to store information now pro in programming there are plenty of different ways to store information but DF Maps is one of the most useful so what do you have so how do you store information in it well first of all you have a key a key can be something like a number a letter or just really anything and with the key you you input a key and then as an output you get a value so the value is the output and the output can be anything it can be like just some information some numbers or whatever now why would we want to use a DSL well so we're going to be drawing text we're going to be creating text in our room and we want to store that text that we're creating because we're going to be saying lots of different things you're going to be saying stuff like welcome to the game and we're going to be for example I don't know you might be talking to someone in our game we haven't really fleshed out what exactly we want the game to be about but we might want some description and we're going to want lots of different things and we want to store it somewhere so we're going to use a deist map and yes here are all the functions that we can use with the DS map so let's get right into creating a Diaz map as we are in the create event we're going to create Deas map so that might be easy to understand now to create one it's pretty simple vs map create now we use underscores instead of spaces because it's one function and it there needs to be no spaces that happens a lot in programming as we can see right here you don't generally want spaces when you're programming stuff when you're programming one thing and we have parentheses here but they're just clothes there's nothing inside of them but that's because every function every function will have parentheses but not every function will need anything inside of the parentheses you do put things in here for some functions for example you can just you can earn input information into the function like for example if you had a function called um go to or even as some of them are appearing down here room go to we're going to be using this eventually so like in your code you might want to say okay let's go to the main level and that's that's really all you have to do you just input what you need to input so we have the Deus map create we're creating this data structure and what do we want to do well we're in our game we're going to be having some text and we want to say what do we want to say we want to say welcome to the game we want to say that for now when we press play we wanted to say that so how do we do that well we want to store we want to store this information inside the DS map well how do we do that well we can use DF snap at and so as you can see down here here the parameters we need to put in and we need an ID what's the ID well the ID is the specific tf's map that we're accessing there are you could have multiple ODS maps inside your game so we need to store this DS map inside of something so let's just create text math now we can just do this create this is a variable and we're storing des map create inside this video variable so this variable will know that it's this DS map so for the ID we can just put text map that's the specific map that we're using if this doesn't make sense for now that'll be fine you can ask in the comments or you can ask for explanation I too like mi email each feed or email calm so yeah and in the description you'll find all my information if you need help and so a key like I said before we need a key to access the value so the key is what we need to put in to get the text so for now we can just use zero as the key into the value we wanted to say welcome to the game now I put this in quotation marks and it made it yellow there the quotation marks means it is a string now what's a string well a string is like a collection of characters or letters that you're storing together and you need to tell the computer that you're not writing code because well I could have a string that says vs map ad but it'll know that it's a string this is in quotation marks and it won't treat it as if it's code so we have the create event all done we've created RDS map we're also going to need to do something else so here's a cleanup event the cleanup event happens if the game ends or anything of that sort happens because so we created a DES map right but here's the problem when we exit out of the game we're not destroying the DS map we're just letting it continue to exist which is not a good thing we need to destroy it so we can just simply use the SMS destroy and we need the ID again so what's the ID well it's just text now so that's all done what next what did we want to do again yeah we wanted to draw the code or if we wanted to draw the text so we have a drive event now we have some before we simply draw the text there's some things we need to set up and they're not immediately apparent yes we only have one fonts but we still need to access the font so in order to access it we do draw a set font font inane and that will set it up so we're drawing with that font and also we want to have a specific color we want to draw the font in a specific color so for now we can do C white the the C in front of it is built in the game maker and it can decide a color so you will put C underscore black C underscore gray C underscore blue whatever color you want although you can't do every color and so we're going to want to align our text in H a line is horizontal alignment for our text we want our text to be centered towards like the middle of the screen for now at least so to do this we'll do FA underscore Center now now we could also just do FA underscore left or FA underscore right but basically it sets the text up and then we'll just do the same thing for this and now we should be ready to actually I'll draw the text now here's what we're going to do we're just going to use draw text pretty easy right but it needs to be drawn somewhere where do we want to draw it well what we're going to want to do is we're going to want to draw it precisely where controller text is so let's open up the room now right now so here's our instances we don't have any instances well that's a problem because we need controller text inside the level in order to see it so what we simply need to do is we need to put it in here now you can see there's a question mark here that just means there's gonna it's not going to show up in the level if I hit play if I don't get any errors okay I got an error but it'll just show up as nothing I can just comment this out and then once I play as you can see there's nothing it doesn't show up so coming back in here where is it we have a coordinate grid as you can see you can see these numbers are moving so as I move around these are the x and y values if you can think back to some sort of math class in school it can help you out a lot in terms of like using calculations and x and y variables so yeah so we have that there and we need to draw the text somewhere where do we want to draw it we want to draw it where we place controller text so all I need to do is x and y because the X is the x coordinate for controller text and the y is the y-coordinate for controller text and then it's asking for the string well what's the swing again it's welcome to the game and we added it the DS math text map at the key of zero what do we want to do well we want to find the value right and yeah fine value it's all pretty simple and then we need the ID again that's just text map that's the specific one we're accessing and then for a key well what's the key again just zero okay so there we go I'm going to hit save now and let's see if it works boom look at that welcome to the game now I don't know why that's there on the G but other than that it's working perfectly right now you just made your first lines of code and you just started your first project it might seem kind of difficult to understand exactly what we're doing here especially here some of these programming things you're just going to have to get used to over time I mean you might have a hard time navigating or anything but the more episodes of this you watch the more you will learn and the more you'll be able to understand so just leave a comment if you have any issues and anything you need to know and then you can look in the description for the gamejolt link which will lead you straight to where you can download this file but I highly highly recommend you're writing the code yourself even if it gets annoying and then you find out you're screwing up you can always just back up on the video and rewatch apart I tried to make the font for this pretty large so you can so you guys can see my code and everything I'm doing but if there's any comments and you concerns anything you can just ask so thank you for watching episode 1
Info
Channel: Etredal
Views: 12,871
Rating: undefined out of 5
Keywords: tutorial, gamemaker studio 2
Id: v59G1djKn5I
Channel Id: undefined
Length: 35min 1sec (2101 seconds)
Published: Thu May 18 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.