Concepts & Setup | Quest System: GMS2 [1]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys today we're going to be working on making a quest system and before you get started I want to acknowledge just how massive this topic is the quest system can form the backbone of an entire game it's often the thing that is responsible for driving the game's story and progress as well as tracking the players behavior and updating the game world accordingly so if you've been thinking about making a system like this and it seems overwhelming and you don't even know where to start the truth is just that you need to spend a lot of time thinking and planning this it's overwhelming because it has so much complexity to it it's definitely not going to be a straightforward thing to make and it will probably take a while and multiple iterations as you make the game so a lot of what I want to do today is to guide you through brainstorming some ideas and planning the system so we'll just be doing the conceptual planning today and in the next tutorial we will jump in and start coding obviously I'd recommend sitting through this one so that you know why we end up choosing what we do but if you don't care and just want to see the code then you can jump ahead and its most basic a quest system can involve simply checking and toggling variables to mark a quest is complete but of course quest systems can be as varied as games themselves some games have simple linear quests some have hundreds of quests some randomly generate them some have a limited number of quest types and some have quests that can't really be sorted into types because they're all complex and unique so these are the kinds of things you want to explore before committing your quest system occurred because as with any system you want to make it as efficient as possible but not if it means sacrificing some kind of idea or functionality that you had for a quest so have a brainstorm now about your game and what your quests are going to involve so ask questions like other quests going to be simple or complex are they going to have a dialogue before a quest starts are you always going to get a quest from an NPC or can you get some for example for just walking into a room do you want a track who gives you the quest do you want to create template quest types like gather delivery escort and kill quests to make it easy to quickly make new quests or randomly generate them or are they all going to be unique can your quest resolve differently depending on a player's choice do you want to track the outcome of a quest will requests have rewards will they have events cutscenes and so on right the possibilities here are endless so I'd recommend dedicating some time to brainstorming elements like these and making a list of everything you need the quest system to do now let's consider the case where all quests are fairly typical in structure in that you could group all of them into certain types in that case you should define those types and then set up what information you would need for each type template so a good place to start for this is a grid of data where each row is a different quest and each column defines the inputs and elements of a quest so call them 1 the first column might be the type of quest and then column 2 might always be the title of the quest so those might be common to all the quest types but from then on we're gonna get some variability on what the columns do sir but the gather quest column 2 is going to be what object I want to gather column 3 could be the number I want to gather column 4 could be the NPC I want to return to to finish the quest and then finally call five is the reward but selling else so like an escort quest we have the NBC I want to escort the coordinate that I want to escort it to the room of the game that I want to take my object to finally the NPC who talked you to finish the quest and then the rewards and really these columns could be anything you want so you could have an index for the quest the name of the quest something that tracks the stage of the quest if you've got multiple stages to it description of the stage so what might come up in the quest log to tell the player what to do so just note that you might have different columns and sort of widths of the columns for your different types that's going to be fine because once you plug this into the logic of your quest system it knows that when it's reading a gather quest it knows to just look in these five columns and when it is reading a kill quest it knows to look in these ones so your quest system code for this would just consist over general logic for each quest type so it will be able to take in whatever inputs you give it from the quest data which define what the quest is and then it will just run the quest and really once that general logic is set up you could feed it an infinite number of quests and perhaps even randomly generate some of them so this is great for a system where you would want to have lots and lots of quests it's good to put them into type so you can quickly prototype them and it would be good for you as the programmer to hand it to your designer and you could just get them to fill in the basic information here so just note that this system is general the quests are always going to work in the same way so no quest is going to have unique logic to it it's always going to be exactly the same thing the only thing that's changing is the details so you're losing a little bit of control and also unique elements to the quests if you just have them like this on the other hand we could consider a game where it has quests that are all very unique and require a lot of complex logic to them so they're gonna have let's say lots of different events in them lots of dependencies and other systems lots of player choices so basically you would have to keep looking up data to check what the play is done previously who they've talked to it would have a lot of stages to it all of this stuff so it would have to work with a lot of assistants so in that case you might want to act to find the logic for each quest individually so this is called hard coding it and obviously this is more time-consuming because you have to write the logic for every single quest so it doesn't lend itself well to a game where you would want to have quick short quests or randomly generated quests but it does allow for greater flexibility and unique quest elements and if your game is very story based in linear and you're not going to see repeated types of quests right every single quest is different from the other one then it might just be simpler and more desirable to do it this way that said even with complex quests like the one I just said it's still possible to group quest logic you could break a quest down into different components so at the start you might have a travel component then a cutscene then an escort then a dialogue component then a kill component and so on so your quest data could just involve outlining those components in a sort of modular way all right so I think we can appreciate just how varied quest systems can be but for the purposes of this tutorial let's explore some of the common underlying features of all these quest systems and get to work implementing them so regardless of what system you need you will likely have a bunch of data in some kind of grid or list or array structure containing the details of the quest and you'll want your quest system to be able to read track and update that data so this backbone of the quest system is what we'll be making today so let's have a think about how we're going to represent our quests and quest system in game maker so we could have a single quest system object that takes care of absolutely everything quest related so we'd store all the quest data and all the logic in that object or we could have a parent quest object kind of like a class and then every quest would be a child of that parent with just some unique data and variables and then once a quest is finished it can just be deleted of course if you are deleting them like that you may also want to store some of the results of that quest in some kind of Master Quest data object if you want to refer to what happened or what the player chose later but let's just start simple and have it in one object now let's say that our data is just going to comprise of a few things so something a bit simpler than what I was showing before it's essentially just going to be what's going to show up the quest log so in the first column I'm gonna have the name of the quest so I'm gonna call this paint things and then in here this is gonna be the stage of the quest so I'm gonna make all of them start at -1 by default so this is going to mean inactive quest we haven't started it and then here we can define the different stages of the quest so I'm going to put this in an array so we can define an array just by using square brackets like this so first we could put paint a tree red so that would be stage 1 of the quest and then paint a tree blue and then paint an NPC pink so there's just gonna be three stages to these quests and when I am accessing the quest log I can use this value right here to access a certain entry in this little array so paint a tree red that would be when the quest stage is 0 and then when the quest stage is 1 it would be accessing this entry the second entry and obviously you can have more columns of additional elements that you want to set out in your quests and we might look at doing some of those in future tutorials on this topic but I'm just gonna stick with these for now so now how are we going to represent this kind of grid in our quest system object so some candidates here are the various types of data structures so you could use des lists which are basically like arrays and each entry in the list could be an array of quest data or we could use a TS grid and it would just work the same way as what we've set out you know create spreadsheet or we could use DS maps and they can be good because you have a key pair where to grab an entry from your map you give it basically a key and this could be the ID of the quest but I'm just going to go with a d squared because I think is the simplest to use when we're storing and retrieving data and with the others you would likely have to be storing data structures within data structures to get all your information in there plus a grid is just the perfect analog for the way we've already been planning out our quest outter in a spreadsheet so say we create this data structure that holds all the information for our quests that data structure would exist at the very start of the game so it would have every single quest and all the data required for it but obviously those quests aren't going to be running at the side of the game because they're all set to inactive so to that minus one alright so now that we've got our data set up how are we going to update the quest in the game so how do we know if the player has painted a tree red or how do we even paint a tree red or to take a more complex example what if I had a quest where I wanted to kill a demon with the protagonists grandparents sort and no other weapons specifically that sword or how do we know if the player selected a certain dialogue option so I want to briefly mention this just so we can consider at this point that there can be a lot of complex logic to a quest and although I'm not going to cover exactly how to handle something like this in the tutorial I just want to mention that what you could do is set up an event dispatcher where we have basically any important gameplay event firing an event to this sort of controller event dispatcher so say picking up an item or if we drop one or if we kill something or if we step into a certain room or house or zone anything like that would trigger an event and then our important systems like the quest system could listen for those events and say they want to receive information about certain types of events so the quest system would say I want to receive information about killing objects and the events themselves could contain as much data as you want so for example a killing creature event could contain information about the specific instance ID that was being killed the type of creature so a goblin was something the location that it happened at what time of day what weapon killed it anything like that so it would contain all that information so that if you had a quests that was like killed ten shades with the light scroll at night you could pick up that event so I'm not going to be doing this today as it deserves a tutorial or three all in itself but it's good to keep in mind we're just going to be hard-coding everything and going through some examples all right that will do us for today so we finished our planning and in the next video we'll be jumping in and coding the system thanks for watching I'll see you then so this video was actually chosen by a vote on patreon so thank you to everyone who voted I thought this was a really interesting topic and special shoutouts to semi myths bartholomae at least one Costa toast Daniel Hargrave don't Eggman Oscar XD game studio Alberto Gonzalez Hunter T in second in shake bunny the great poultry Thomas M max Mullen r1g 72 new podcasts misstara Ricky see straya moon Spock 2018 and semi-metal alchemists take care guys and I will see you in the next video
Info
Channel: FriendlyCosmonaut
Views: 15,368
Rating: undefined out of 5
Keywords: quest system gamedev, quests gamedev, quests game development, quest tutorial gamemaker, quest system gamemaker, quest system game development, quest system gamemaker studio 2, quests gamemaker, quests gms2, friendly cosmonaut, quest system friendly cosmonaut, gamemaker tutorial, gamemaker, gms2
Id: c9IPvBdJoiE
Channel Id: undefined
Length: 12min 39sec (759 seconds)
Published: Wed Jun 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.