Open Godot RPG v0.1: Code Overview

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I'll wait for the "How to Make a Godot JRPG in 6 Minutes" video.

just kidding of course, I love GDQuest <3

👍︎︎ 8 👤︎︎ u/UndeadWaffles 📅︎︎ Nov 22 2018 🗫︎ replies
Captions
in this video we're going to look at the code structure for the RPG demo 0.1 it's the very first version of the project it's simple consider this a game prototype and it will give you an example of a few things first how as a professional you may prototype a game not everyone will code the way I do I try to make the code readable and to make it scalable to make it so I don't have to rewrite the entire demo from scratch after I've done the first prototype because it's a standard type of game so we have a turn-based JRPG here as you follow some codes when it comes to the gameplay you can easily have a solid idea on how you're going to structure your game systems note that the project runs in guru 3.1 alpha 2 at the time of recording so it's an unstable version in the future world ported to good at 3.1 but good o 3.0 will not work with this the main scene is game dot t-- SCM in this one you will find the main game node that just starts the encounter at the moment so it's supposed to manage the game later there will be things like the ability to pose and all that stuff but for now all it does is get that transition color node that can find on our open a RPG that's going to play the transition to fade it in and out and then it will call battle starts on the combat arena which is the entire combat scene here so I'll open the combat arena TSC and far next here we are in the combat arena the place where the battles happen so let's look at the nodes and combat arena that's just a no 2d so that we can reposition the battlers as you can see the background is kind of stuck in place the first node you have is the spawn positions right now they are hard place for the monster and the party later the ideas that you will be able to place them programmatically to create group formations or to place them based on the backdrop you would have but as we don't have art just yet and it's really not too important early on in a combat system right now there are just a hunt play so the idea if I hide the turn cue is that I can go get one of the battlers one of the characters so I'll grab Dan battler for example place it on one of the positions and then reverent it and the turn cue so these are just here to help me place the battlers early on to test the functionality in the game one of the most important nodes here is the turn cue and there's going to be a dedicated tutorial so we're not going to look at the code but this is what manages the turns in the game it has some code that's just for that and it's not specific to a combat system it would work just the same for a puzzle game or something like that with minor code variations in this game it is a Weishaupt note meaning that it will automatically change the Z order of the battlers based on their position on the battlefield and so even if you attack even if you have a character that well in this case if it jumps over the other character is not going to work with if it goes behind a big monster like that the engine will take care of handling v z order for us then in this turn queue you have a list of battlers so battler is the class or the scene type that holds these characters and these monsters all the functionality that lets them attack defend also manages their health and all that stuff we're going to look at that in a moment and then you have a layer for the combats interface and this one displays the light bars and hooks them onto the battlers spawn position it also handles the arrow that you can see and used to pick a monster to pick a target the way the interface works is disconnected from the turn queue and the actual combat so the idea is to keep as much of a separation as possible between the actual game mechanics and the interface that helps you you the player to pick a monster and to see the light balls so when a turn starts the next battler in the queue becomes active and for example if this is blue here this is this blue character as it's a party member the combat arena will check for that suitable as the turn cue for the active battler and it will then send the data that the combats interface needs to let you select the right opponent so if you have blue active that turn it will say okay let me grab the three monsters here the openings of the party and I will send them to the Select arrow so you will only be able to select one of the three porcupines so we already have tutorials on the channel for UI you can find a card on the screen right now to access the playlist and that said we're going to look at the essential scene in the game the battler where a lot of things happen so I'm going to open one of them blue for example and these battlers inherit from a base scene called battler dot T SC n so you can find it in the combats folder and the battlers subfolder let me open it you're not going to see a skin here because as you can see under the skin node on that scene there is nothing the skin by default is empty and when you create a new character or a monster you add the animated character that you want to use for that battler so it's really up to you to pick what animations what set of animations you want to have for that character now the base battler so has the skin that's going to hold all the animation and the skin is a position 2d in itself so we can offset it from the starting position of the Butler and use it as a root position if I go to the blue Butler you will see that in our animation player on the skin node we have some animations to make the battler appear we have one to make it blink when you have this battler active when it's this character's turn and you have an idle animation that doesn't do anything for now plus eight we node to separately animate the character moving like appearing at the start of the battle then the characters animations themselves are going to be in a separate scene and the point is that the animators in your team can work on that character specifically they can rig it we can create animations like this attack animation on the character and in the meantime the developers can keep working on the skin on the battlers base functionality and basic animation that's are coming to all battlers so this way you can keep working productively and not step on each other's toes back to the battle scene you also have a job node and this one is a scene in itself I'm going to make children editable just so that we can see them so the job is going to hold everything that has to do with the characters starting stats it's like the the characters class in an RPG so it can be an eye to fighter mage anything you'd like so it has some stats node that's going to manage the health the strength of the character etc and only job node you will find a starting stats and we use it to set the starting stats on the character these are of type starting stats you have a GD script file for that that allows us to create a custom resource with these few properties so you have the jobs name or the class's name maximum health strength defense and speed and we can extend it moving forward having this allows you to select these resources like the default job here and to set the can does stats in the inspector directly if I take the example of the fighter and open it in the inspector can see that the fighter has high health a bit of strength low defence and high speed and when we play the game you will see that the players the playable character has 15 health and the monsters have 7 health well this is due to the starting stat and later you can add some more info here like the experience curve if you want to change it depending on the character class more importantly you can also create some base skills or traits on the character in the same way so with a script that extends the resource in Godot and anything's on the job node you can create an exported variable that's using one of these resources and this is how you get this starting stats slot that you can replace with anything you'd like really any class the job scene has a skills node that is empty at the moment I am not decided on the skill system yet I guess this will work with some database and a resource note as well that lets you decide in which order this class will unlock skills then you have the actions node each action that can use in the game for example attacking is going to be a separate node and right now there's only attack but the idea is that we can create new commands new battle actions like these and we can place them inside of that action node and later the UI will be able to give you a menu based on the nodes that you put in here so if you were to add a magic option magic action can place it in the menu and you will be able to select between attack and magic the butler has an interface anchor node and a target anchor so interface anchor is the position on which the life bar will appear and you can up set it based on the size of the monster or the character that you have in the and the target anchor is gonna be the position that the battler the the characters move to when they attack in the fight so in the battle when the characters attack they don't move on the monsters position they move in front of it and this is done with this targets anchor they move to the target anchor with that this is the extent of the first demo version 0.1 so you have the main combat loop and there's going to be more tutorials that are specific to different nodes and scripts I hope this is useful please tell me in the comments if you have any questions or suggestions for improvements on this format you can find the project on github it is completely free and open source again made with go-to 3.1 contributors are much welcome you have a few issues there you will find a contributing guide but that said I won't thank you kindly for watching be creative have fun and we'll see each other in the next one good bye
Info
Channel: GDQuest
Views: 16,445
Rating: undefined out of 5
Keywords: godot rpg tutorial, godot jrpg, godot turn based, godot turn based rpg, godot turn based tutorial, godot engine turn based, godot engine rpg, godot 2d rpg, godot 2d rpg tutorial, gdscript, open source rpg, open source, godot engine, game engine, game creation tutorial, game dev, godot 3, game programming, godot 3 2d rpg, gdscript tutorial, open source rpg games, open source rpg system
Id: tk8nOkwCOrc
Channel Id: undefined
Length: 12min 12sec (732 seconds)
Published: Wed Nov 21 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.