The next part for Turn-Based Combat will drop in a couple weeks! Stay tuned 👾 ⚠ For those using their own sprites and getting stuck in walls: make sure obj_player has a mask sprite assigned. It can be any one of your player sprites. Alternatively, you can assign a mask in the Create event of the player: mask_index = spr_player_idle_down; This should fix the issue of the player getting stuck in walls.
Excellent tutorial Gurpreet! You've really grown as a tutor over the last couple of years. The new code editor looks nice too - I'm going to give that a try now.
having some trouble around 21:50 When I try to run the game I keep getting an error in line 1 of the step event saying it doesn’t recognize target_x but I’m not sure where I went wrong as I typed everything correctly (as far as I’m concerned)
Yea I keep getting the same error code and I have redone that part so many times. ___________________________________________ ############################################################################################ ERROR in action number 1 of Step Event0 for object obj_enemy_parent: Variable .target_y(100007, -2147483648) not set before reading it. at gml_Object_obj_enemy_parent_Step_0 (line 2) - var _ver = clamp(target_y - y, -1, 1); ############################################################################################ gml_Object_obj_enemy_parent_Step_0 (line 2)
thank you so much , i was in the middle of making all my tiles for my game and you drop this Tutorial , now i can make a basic tsting room for my game . again thank you
This is honestly really cool, well explained, well made. Great Tutorial concept and execution. Also: even though I consider myself a somewhat experienced user and hence wasn't fully sure if this video was going to be for me, I somehow only now learned about the new script editor which I already got incredibly excited about! (*happy developer noises*) Absolutely worth the watch
@fionnreidy6078 Matharoo had an RPG Udemy course in the works, but never finished it. this is because he got employed by gamemaker themselves. This tutorial looks like its successor.
@@smidy3 Gurpreet here - that's true! Although I did cover a lot in the unfinished 2-hour video I put up on my channel, I planned to cover Turn Based Battle in that course, which I couldn't get to. In this series I'll finally get to do that. Thanks for following along!
My player object is getting stuck when moving left or right onto a wall. Any fixes? Quadruple checked that the code matched and I have the beta code tester on as well
For those experiencing similar issues, a temporary (possibly permanent) fix is to just put: mask_index = spr_player_idle_down; make sure it's in the Create event, I put mine directly below the tilemap collision code. This will allow you to keep the same collision mask for all sprite directions, seems there's an issue there. I had also experienced a visual glitch when idle left or right, causing a default "image undefined" texture with the red and white squares. Try adding two more frames to the animations so that all animation frames have four for the count.
Thanks for pointing this out, I missed that in the tutorial. I've updated the starter template to make sure all sprites have the same mask, and added a note for this in the pinned comment. -Gurpreet
For those having issues with the attack animation being confined to the right side while idle, add this code for each idle direction the player is facing: if (keyboard_check_pressed(vk_space)) { var _inst = instance_create_depth(x, y, depth, obj_attack); _inst.image_angle = point_direction(0, 0, _hor, _ver); _inst.damage *= damage;
if sprite_index = spr_player_idle_left{ _inst.image_angle = point_direction(0, 0, -1, 0); } if sprite_index = spr_player_idle_down{ _inst.image_angle = point_direction(0, 0, 0, 16); } if sprite_index = spr_player_idle_up{ _inst.image_angle = point_direction(0, 0, 0, -16); } } I kept the attack keyboard assignment in the example so you can see where I placed it in the code block. I understand what I did here, but I'm also awful at explaining my process. Best I can summarize, it has to do with adding and subtracting from the player's origin point. It's already assigned while the player is moving, but not while idle. This code just makes it so that you don't always have to be moving in the direction you want to attack.
I have an issue at 20:19 where "distance_to_player" is defined as a variable and an error pops up when the game is run the "distance_to_player" is an undefined
Make sure you have defined it properly in the Variables of obj_enemy_parent. Make sure the name is correct and that the parent is set correctly for obj_enemy1.
at around 21:50 i get an error "Object: Obj_Enemy_Parent_PreCreate at line 2 : invalid token `" i did not name my object with `_PreCreate` and i cant find it in my files
Thank you person who's name I don't know who has an accent that I think belongs to india. This is a great tutorial. I would love to learn more from you.
Looking at 9:38 - is it okay to initialize variables like that inside the step event? I wasn't sure if it's bad practice. I thought I needed to initialize all my variables at the create event
Any variables created using 'var ' are local variables and only available in the event they're created in. So those variables were only needed for the Step event and will only exist during the Step event. You should use the Create event for instance variables that are available throughout all events.
Hi mate, 2 of us have tried up to 11:30 and the movement doesn't work for us. We type it as shown and press WASD but no movement :( EDIT - nvm, turns out I had collider tiles behind the background tiles so it was stuck on them lol
I've just tried to launch the project and got an error message saying "{"status":"failed","message":"session not found"}? Looking at it again, I think it's trying to download the assets, but it's failing for some reason. Edit: Got it working, turns out that for some reason I wasn't signed into GameMaker.
I’m very grateful for this video and the work u put in but I did what u did line for line and I keep getting a error message in alarm 0 of obj_enemy_parent about not setting the distance between the player and enemy parent and I’m super confused
So, I did as explained in the tutorial, but my animations doesn't end, and I can"t understand why. I checked and the code is exactly the same I have no idea why lmao
Hey I had a question, I thought itd be fun if the enemy sprite could turn and face around like the player, what type of code would I use to make this happen? I have my own sprites in all directions! ( Im very much a beginner so it would help out a lot! :> )
Hey, the same code that we used in the player to turn it, can be used in the enemy too. It's just basic conditions. Make sure you use the correct variables for the condition check as we may not use the same variables as the player in the enemy.
is this going to be a full series with a working inventory system and battle mechanics? i am in desperate need for something better than a "zelda" style one slot inventory
@@GameMakerEngine that's unfortunate. i really need an inventory system. i wasted months of work on a project and i can't get the inventory to work. please let me know if you decide to do a full inventory (equipping weapons, armor, ect.) all i can find is lame ass zelda clone one item/ cycle. until then i give up.
I just downloaded the LTS version, and it looks ALREADY different - no RPG tutorial in NEW! (today is 12 days after your tutorial was uploaded!) - what am I missing, please?
@@GameMakerEngine Thanks. However, the tutorials coming straight from the GM website suggested the LTS version. This is really confusing, and for a beginner to boot! Can I download BOTH versions?
Unfortunately, Game Maker continues to disappoint me with its shortcomings, which the developers, instead of fixing, breed new shortcomings. With each update, the engine becomes poorly optimized and heavy. The engine is capable of creating only primitive games based on simple shapes, since complex sprites lead to a decrease in fps and freezes. It is worth noting that collision handling remains at an ugly primitive level, which leads to failures in the execution of the written code. Physics modeling also remains at the level of "why is it needed if it does not work". Conclusion: Game Maker is good as a children's construction set for developing thinking and first steps. But it cannot be called a full-fledged engine, like Unity, Godot, Unreal Engine or CryEngine. It is a pity that you do not continue to develop(
Shame to hear this. Can you perhaps be more specific with your issues? Have you reported everything? We are striving to make GameMaker a powerhouse and this is even more apparent with our upcoming GMRT runtime which will be an huge leap forwards for GameMaker (See more: gamemaker.io/en/blog/winter-update-2024 & gamemaker.io/en/blog/gmrt-open-beta ) You are totally welcome to your opinion and again - we'd love to address these issues directly. However, claims like 'it's just a children's construction set' when multiple Game Awards nominees for 2024 were released using GameMaker is very clearly not the case. We want people to make games and we're doing a good job at that.
@@GameMakerEngine I am glad that you responded to my message quickly. I hope that my criticism will encourage you to make your product better. A bad rating is still better than indifference) In order not to be unfounded, I will give a recent example: the enemy character refused to execute the embedded algorithm, due to the fact that the collision of the walking sprite caught the collision of the ground surface. I spent more than two hours of manual adjustments, adjusting pixel by pixel in different directions so that the character did not catch on the ground and stopped twitching when walking. As a result, I had to reload the character sprites again. This problem arose because I wanted to slightly adjust the size of the walking sprite. Guys, are you serious? Simple manipulations with the sprite sizes lead to disruptions in the operation of the mechanism that I programmed a long time ago? Also, with the latest update, the compilation time of the project has increased significantly. I thought that the updates were aimed at optimization and improvement) And why can't we still combine physics simulation with procedural physics, for example, in the same platformer? For example, in Unity, this can be done for about 10 years) To describe elementary physics in code, it takes weeks and months and knowledge of vector algebra and physics.
@@resproject1731 You should think of game engines like characters in a game. Some characters are easier which makes them commonly better for/against beginners. Easier to perform its strengths as a beginner and beginners aren't good enough to punish its more obvious weaknesses. Then vice versa there's more high skilled characters which are better for pros because they are good enough to execute the characters strengths while the characters weaknesses are harder to punish overall since harder characters usually have more flexibility. But the point being is that even if an easier character is better for beginners and probably worst against more skilled ones, doesn't mean that it is a worst character all the time. If you know how to perform on a low skill character because you understand all of its strengths and know how to counter its weaknesses as well as in general accept the characters weaknesses then it can be equally as good as a high skilled character. Same goes for high skilled characters. In this case Gamemaker Studio 2 would seem to be more of a low skill character with some weaknesses like 3d or networking etc. but it is an extremely easy engine to pick up and can do simple things really fast and even with the weaknesses mentioned it is still capable of doing it, you just need to try harder so you have to accept those weaknesses while knowing how to use its strengths. Plus Gamemaker does get improvements overtime and doesn't seem to be getting any harder to code with and from my experience easy characters getting buffed is kinda broken 😉
here we go another goofball, without gamemaker we wouldnt have hit games like Pizza tower, Undertale, Nuclear Throne, Heartbound. You dont need to have that much power if you don't need to use it. You probably havent even released any successful titles, and no one should take your opinion seriously because ur just another generic thought in the wind.
The next part for Turn-Based Combat will drop in a couple weeks! Stay tuned 👾
⚠ For those using their own sprites and getting stuck in walls: make sure obj_player has a mask sprite assigned. It can be any one of your player sprites.
Alternatively, you can assign a mask in the Create event of the player:
mask_index = spr_player_idle_down;
This should fix the issue of the player getting stuck in walls.
Exciting. I requested this months ago, glad to see you decided to make such a series!
darn, a couple weeks is a while.
thanks so much for this!
I was just thinking about making an RPG. You guys came to the rescue once again, thanks!
Excellent tutorial Gurpreet!
You've really grown as a tutor over the last couple of years.
The new code editor looks nice too - I'm going to give that a try now.
I loved your platforming tutorial and I just got home to THIS GEM
Epic, jumping right in to use the new ide and what not. Can't wait to get back into things.
So so so so good! Thank you Gurpreet!! Your teaching style is so engaging. Thank you 🤟
Yeah thank you for coming out with this right when I need it! I love your in game sprite of you as well lol excellent video!
having some trouble around 21:50
When I try to run the game I keep getting an error in line 1 of the step event saying it doesn’t recognize target_x but I’m not sure where I went wrong as I typed everything correctly (as far as I’m concerned)
Yea I keep getting the same error code and I have redone that part so many times.
___________________________________________
############################################################################################
ERROR in action number 1
of Step Event0 for object obj_enemy_parent:
Variable .target_y(100007, -2147483648) not set before reading it.
at gml_Object_obj_enemy_parent_Step_0 (line 2) - var _ver = clamp(target_y - y, -1, 1);
############################################################################################
gml_Object_obj_enemy_parent_Step_0 (line 2)
declare the targets in enemy1 create code and it will run
@@juancarlosleyvabustamante6429 how to do that??
thank you so much , i was in the middle of making all my tiles for my game and you drop this Tutorial , now i can make a basic tsting room for my game . again thank you
I just finished watching it. Good stuff.
This was so helpful. Thank you so much. You have simplified a lot of things I had been super confused about
I did have to add
move_speed = 1;
to make the enemy characters actually run
bro i was following a different tutorial before.. i can't believe how much more simple your movement code is!
Thank the maker for move_and_collide!
i feel lucky that the day i decide to start coding again a video is put out
This is honestly really cool, well explained, well made. Great Tutorial concept and execution.
Also: even though I consider myself a somewhat experienced user and hence wasn't fully sure if this video was going to be for me, I somehow only now learned about the new script editor which I already got incredibly excited about! (*happy developer noises*)
Absolutely worth the watch
Only a few seconds in, love the chibi Matharoo sprite =)
This is a LIFESAVER! Thank you so much!
Keep up the great work! 💪💪
Finally, a RPG game of the tutorial guy
Amazing! I must try this
Your tutorials are amazing! Thanks for making these.
heck yeah!
finally!
Thank you!
unfinished udemy course not wasted :P AWESOME!
Which course did you sign up for?
@fionnreidy6078 Matharoo had an RPG Udemy course in the works, but never finished it. this is because he got employed by gamemaker themselves.
This tutorial looks like its successor.
@@smidy3 Gurpreet here - that's true! Although I did cover a lot in the unfinished 2-hour video I put up on my channel, I planned to cover Turn Based Battle in that course, which I couldn't get to. In this series I'll finally get to do that.
Thanks for following along!
these new tuts are fantastic
GameMaker Is The Best 2D Game Engine In My Opinion 😁
Very nice! Will be following this one!☺️
Finally, it is here!!
Yooo, thank you❤❤❤
15:08 I have the same problem but with the enemies when they collide with each other
Looking forward to the turn based tutorial!
now we REALLY have tutorial guy rpg before gta 6
My player object is getting stuck when moving left or right onto a wall. Any fixes? Quadruple checked that the code matched and I have the beta code tester on as well
For those experiencing similar issues, a temporary (possibly permanent) fix is to just put:
mask_index = spr_player_idle_down;
make sure it's in the Create event, I put mine directly below the tilemap collision code.
This will allow you to keep the same collision mask for all sprite directions, seems there's an issue there. I had also experienced a visual glitch when idle left or right, causing a default "image undefined" texture with the red and white squares. Try adding two more frames to the animations so that all animation frames have four for the count.
Thanks for pointing this out, I missed that in the tutorial. I've updated the starter template to make sure all sprites have the same mask, and added a note for this in the pinned comment.
-Gurpreet
@@GameMakerEngine Thank you, and great tutorial so far! Can't wait for part 2!
For those having issues with the attack animation being confined to the right side while idle, add this code for each idle direction the player is facing:
if (keyboard_check_pressed(vk_space))
{
var _inst = instance_create_depth(x, y, depth, obj_attack);
_inst.image_angle = point_direction(0, 0, _hor, _ver);
_inst.damage *= damage;
if sprite_index = spr_player_idle_left{
_inst.image_angle = point_direction(0, 0, -1, 0);
}
if sprite_index = spr_player_idle_down{
_inst.image_angle = point_direction(0, 0, 0, 16);
}
if sprite_index = spr_player_idle_up{
_inst.image_angle = point_direction(0, 0, 0, -16);
}
}
I kept the attack keyboard assignment in the example so you can see where I placed it in the code block. I understand what I did here, but I'm also awful at explaining my process. Best I can summarize, it has to do with adding and subtracting from the player's origin point. It's already assigned while the player is moving, but not while idle. This code just makes it so that you don't always have to be moving in the direction you want to attack.
I have an issue at 20:19 where "distance_to_player" is defined as a variable and an error pops up when the game is run the "distance_to_player" is an undefined
Make sure you have defined it properly in the Variables of obj_enemy_parent. Make sure the name is correct and that the parent is set correctly for obj_enemy1.
at around 21:50 i get an error "Object: Obj_Enemy_Parent_PreCreate at line 2 : invalid token `" i did not name my object with `_PreCreate` and i cant find it in my files
PreCreate is the variable definitions of your object. You may have written ` accidentally in one of the variable names or values.
This is excellent.
Thank you person who's name I don't know who has an accent that I think belongs to india. This is a great tutorial. I would love to learn more from you.
Looking at 9:38 - is it okay to initialize variables like that inside the step event? I wasn't sure if it's bad practice. I thought I needed to initialize all my variables at the create event
Any variables created using 'var ' are local variables and only available in the event they're created in. So those variables were only needed for the Step event and will only exist during the Step event. You should use the Create event for instance variables that are available throughout all events.
so good tutorial :)
Hi mate, 2 of us have tried up to 11:30 and the movement doesn't work for us. We type it as shown and press WASD but no movement :(
EDIT - nvm, turns out I had collider tiles behind the background tiles so it was stuck on them lol
Great start to 2025. Thanks gamemaker team ❤️
Can we talk about how one the project files at the 0:48 mark is literally called "ship go brrr"?
Gotta name those random projects something yknow? Or else they'll just lack personality and look alittle depressing.
I REMEMBER WATCHING THAT SERIES!
Hey i dont know what happend but the enemy wont move at all or follow me. i dont know what to do.
I've just tried to launch the project and got an error message saying "{"status":"failed","message":"session not found"}?
Looking at it again, I think it's trying to download the assets, but it's failing for some reason.
Edit: Got it working, turns out that for some reason I wasn't signed into GameMaker.
Thank you!
Great Thanks.
I try enemy how work together sprite directions
: _hor _ver= clamp(target_x, _y)
You can do it the same way as done in the player object.
I’m very grateful for this video and the work u put in but I did what u did line for line and I keep getting a error message in alarm 0 of obj_enemy_parent about not setting the distance between the player and enemy parent and I’m super confused
Make sure you have set up the Variables in obj_enemy_parent correctly, and the name matches in the event
@ thx I mistyped the distance to player var
So, I did as explained in the tutorial, but my animations doesn't end, and I can"t understand why. I checked and the code is exactly the same
I have no idea why lmao
I can't download the template. It said session not found
Same :(
Create an account or login by pressing the user icon at the top right of the main load menu, and then retry. This worked for me
@@take6letters Worked for me, Thank you!
Hey I had a question, I thought itd be fun if the enemy sprite could turn and face around like the player, what type of code would I use to make this happen? I have my own sprites in all directions! ( Im very much a beginner so it would help out a lot! :> )
Hey, the same code that we used in the player to turn it, can be used in the enemy too. It's just basic conditions. Make sure you use the correct variables for the condition check as we may not use the same variables as the player in the enemy.
is this going to be a full series with a working inventory system and battle mechanics? i am in desperate need for something better than a "zelda" style one slot inventory
Turn based battle is coming soon. Inventory is not planned but we may consider. Thanks for the suggestion!
@@GameMakerEngine that's unfortunate. i really need an inventory system. i wasted months of work on a project and i can't get the inventory to work. please let me know if you decide to do a full inventory (equipping weapons, armor, ect.) all i can find is lame ass zelda clone one item/ cycle. until then i give up.
wow que manera de trabajar esta a su mecha wow !!!
hello devs
hi
When I downloaded this tutorial from inside GameMaker, the Tile Sets are not included.
The tile set sprite should be included (spr_tileset), and then you can make a Tile Asset from that, as shown in the video.
I just downloaded the LTS version, and it looks ALREADY different - no RPG tutorial in NEW! (today is 12 days after your tutorial was uploaded!) - what am I missing, please?
Please try the monthly release instead of LTS, that should have the project and the new code editor.
@@GameMakerEngine Thanks. However, the tutorials coming straight from the GM website suggested the LTS version. This is really confusing, and for a beginner to boot! Can I download BOTH versions?
How to dowload a rpg starter pack?
As shown in the video at 0:50, from GameMaker's start screen you can select that as a template when making a new project.
17:08
BRO I WAS TRYING TO USE ASSET LAYERS INSTEAD OF LAYERS
it happens bro😔
They really know that indians make the best programming tutorials on the internet 🥰
no ai coding? this looks so 2021...
Unfortunately, Game Maker continues to disappoint me with its shortcomings, which the developers, instead of fixing, breed new shortcomings. With each update, the engine becomes poorly optimized and heavy. The engine is capable of creating only primitive games based on simple shapes, since complex sprites lead to a decrease in fps and freezes. It is worth noting that collision handling remains at an ugly primitive level, which leads to failures in the execution of the written code. Physics modeling also remains at the level of "why is it needed if it does not work". Conclusion: Game Maker is good as a children's construction set for developing thinking and first steps. But it cannot be called a full-fledged engine, like Unity, Godot, Unreal Engine or CryEngine. It is a pity that you do not continue to develop(
Shame to hear this. Can you perhaps be more specific with your issues? Have you reported everything? We are striving to make GameMaker a powerhouse and this is even more apparent with our upcoming GMRT runtime which will be an huge leap forwards for GameMaker (See more: gamemaker.io/en/blog/winter-update-2024 & gamemaker.io/en/blog/gmrt-open-beta )
You are totally welcome to your opinion and again - we'd love to address these issues directly. However, claims like 'it's just a children's construction set' when multiple Game Awards nominees for 2024 were released using GameMaker is very clearly not the case. We want people to make games and we're doing a good job at that.
@@GameMakerEngine I am glad that you responded to my message quickly. I hope that my criticism will encourage you to make your product better. A bad rating is still better than indifference) In order not to be unfounded, I will give a recent example: the enemy character refused to execute the embedded algorithm, due to the fact that the collision of the walking sprite caught the collision of the ground surface. I spent more than two hours of manual adjustments, adjusting pixel by pixel in different directions so that the character did not catch on the ground and stopped twitching when walking. As a result, I had to reload the character sprites again. This problem arose because I wanted to slightly adjust the size of the walking sprite.
Guys, are you serious? Simple manipulations with the sprite sizes lead to disruptions in the operation of the mechanism that I programmed a long time ago?
Also, with the latest update, the compilation time of the project has increased significantly. I thought that the updates were aimed at optimization and improvement)
And why can't we still combine physics simulation with procedural physics, for example, in the same platformer? For example, in Unity, this can be done for about 10 years) To describe elementary physics in code, it takes weeks and months and knowledge of vector algebra and physics.
@@resproject1731 You should think of game engines like characters in a game. Some characters are easier which makes them commonly better for/against beginners. Easier to perform its strengths as a beginner and beginners aren't good enough to punish its more obvious weaknesses. Then vice versa there's more high skilled characters which are better for pros because they are good enough to execute the characters strengths while the characters weaknesses are harder to punish overall since harder characters usually have more flexibility. But the point being is that even if an easier character is better for beginners and probably worst against more skilled ones, doesn't mean that it is a worst character all the time. If you know how to perform on a low skill character because you understand all of its strengths and know how to counter its weaknesses as well as in general accept the characters weaknesses then it can be equally as good as a high skilled character. Same goes for high skilled characters. In this case Gamemaker Studio 2 would seem to be more of a low skill character with some weaknesses like 3d or networking etc. but it is an extremely easy engine to pick up and can do simple things really fast and even with the weaknesses mentioned it is still capable of doing it, you just need to try harder so you have to accept those weaknesses while knowing how to use its strengths. Plus Gamemaker does get improvements overtime and doesn't seem to be getting any harder to code with and from my experience easy characters getting buffed is kinda broken 😉
here we go another goofball, without gamemaker we wouldnt have hit games like Pizza tower, Undertale, Nuclear Throne, Heartbound. You dont need to have that much power if you don't need to use it. You probably havent even released any successful titles, and no one should take your opinion seriously because ur just another generic thought in the wind.
i messed up the enemy tilemap collision they just phaze tru walls