I know VERY minimal coding and wanted to let you and everyone know that this is still relevant, and it is still incredible. I started just a few days ago and I seriously don't know where else i would suggest that anyone go to learn their first steps. I really appreciate this entire series and thanks so much dude!!
Loving the channel, I know the basics of GML. I want to learn visual scripting so I can understand the actual logic behind stuff. You, Paul, and Shawn are my go to most tutorials are from 6+ years ago lol
This is EXACTLY what I was looking for! I've wanted to make an arpg for a while, even tho i've no coding experience yet so the movement and combat is already up my ally!
Subbed, excellent series here, perfect for my project for the upcoming game jam, addresses almost everything - I figured out the other 5% on my own, just stuff like spreadshots
I'm new to game design but teach Coding on the middle school level here in Texas, so I have a little coding experience to help. I found Gamemaker looking for an alternative to the robust Unity, Unreal world where it wouldn't be feasible to teach to 12-13 year olds in a semester. I find Gamemaker is very approachable yet robust enough to make very satisfying, creative, marketable games and 'easy' enough for the kids to have an end product at semester. I myself also own a small edu-resource company and have an American History-based game idea I am pursuing with Gamemaker. I am thoroughly enjoying your video tutorials and learning a lot at a great rate to get where I need to be to teach the engine and for my personal endeavors. Keep up the good work, and I look forward to continuing with your guidance. Cheers.
I still clip into a wall when I approach it vertically, I looked through my code and I don't see any differences. It's very frustrating because idk what's going on
ive copied everything EXACT and it still gives me an error code (ERROR in action number 1 of Step Event0 for object O_player:) it seems like its telling me that the calc_movement code isn't being read correctly. what am I doing wrong? I don't get it?
Thanks for this! Very new to GML, and did my movements with just a few lines of code. This one however takes it to another level! Though I'm having some issues with it. In my map I created a "tunnel" by putting a row of o_solid one grid square (16 pixels) away from a wall of o_solid. Sometimes the player is able to enter the "tunnel" and other times it can't get through the mouth of the "tunnel". After moving around for a bit, I might get lucky and be able to enter the tunnel. My player and solid sprites are 16x16 with automatic rectangle collision masks. Map grid options are 16x16 snap. Any idea why this might be happening?
i know this is an old comment but if youre still having issues heres some suggestions if your code is as in the video your problem might be that if the gap is exactly 16 pixels wide and your player collision is also exactly 16 pixels wide, your player object needs to be perfectly aligned with the tunnel to enter, so making the collision mask of your player object smaller should solve the issue, or offsetting the tunnel entrance so one side has one grid square "sticking out" so you can hit a wall and "slide" into the tunnel.
Old comment, but I was having this exact issue. I did change the collision of my object, and that still didn't fix it. What DID fix it was unchecking the "Solid" box on my object (something I HAD checked when looking for other solutions to collision).
The player still passes though parts of the wall but in other parts it works. I have no idea what is happening I've followed the code multiple times and still the same thing happens.
Is this your style of programming character movement and collisions? I'm learning GML as a first language and noticed that there is more than one way to achieve movement and collision.
Thank you for this. I hope this series continues. I was wanting to purchase your udemy course but it seemed a bit old and was after a top-down style of game anyway. Would it still be suitable for a beginner as I am having real trouble with understanding code.
Heya and thanks. My course was made with GMS2, but not 2.3, but I've gone back and added extra videos to cover those changes, so it's still fairly current. I understand if it's not what you are after, but wanted to note I've managed to keep it as current as I can. I also offer support via the Q&A over on Udemy for those having problems. As for continuing this series, I've released the next episode to Patreon members only so far. It will be released to non members later on.
Would this be suitable for me to attempt to grasp the basics of GML with no experience or should I start elsewhere? I am trying very hard to learn and am having trouble finding where to start.
This looks fantastic! I saw the post you made on the sprite maker's site. I just wonder if you've draw a lot of the animation yourself (such as the demons stunned and dying animation). if so, will you be releasing them in some from?
i'm pretty new to GML (and coding in general), but is using a script just a cleaner way to code movement in a step event compared to typing key_right = keyboard_check("D")); etc. right into the event?
Later on we will implement a state machine (see my platform tutorials if you don't know what that is), we will use the script to get the input in multiple locations. I'm preparing the code for when that happens. It will mean when we are in a state that does not need input, like knockback, we can just omit the get_input script to ensure the player does not move.
hey i was wondering if u have any tutorials for an idle Rpg game? like someone that lvls up with hiting monsters collect items n increase difficulty per lvl
Hello! New to gamemaker but just wondering, what’s the difference between coding the collision movement ourselves, and ticking the Solid property on the object? Thanks!
Solid checkbox moves objects back to their previous position before the collision. You have no control over when it is applied, you can't do one way platforms with it, it won't do pixel perfect collisions when moving fast as there will be gaps. It's a really really basic movement option which you will want to move on from once you start to see it's limitations.
I found that if you increase the walk_spd value it stops it from happening. for me anything from a value of 1 and blow will stop me from sliding along walls when both x and y keys are pressed. hope this helps :)
Thank you for the support! So much support though, yet not subscribed to my channel here :( hehe, I'm taking a break from making Udemy courses just for now. Working on a game instead :D
I have a weird problem where one variable will be a local variable and another will be just a variable, is there a way to fix that? (edit) I fixed it but idk how i did
whenever i run it and try to move, the player snaps to the top of the screen and i cant move up or down only left and right. Edit: i fixed it I had y =+ instead of +=
Thank you for the tutorial everything works fine but when i change player speed (walk_spd) i cant go horizontal + vertical while beside solid object. Is there any way to change player speed without breaking the collision?
This collision system is a very basic introduction, and is not meant to replace a dedicated pixel perfect system. The problems you are having is if you increase the speeds too high, the movement in one step places the player in a collision, and they are then moved back to their start position, essentially not going anywhere. To solve this there needs to be a low enough acceleration which will allow the player to get closer and closer to a solid over a few steps. The other option is a pixel perfection solution, which checks for a collision, and moves the colliding instance 1 pixel at a time up against the solid. I have already shown this method in my 2D platformer tutorial, hence why I didn't use it here again, but feel free to apply that logic to this type of top down game, and it will give you a system without the faults you have mentioned.
Hi, I have one of your courses on Udemy, but I have not seen any info on how to make touch based controlls, can you add any way to do it, this to make a game for mobile phones
Hey Pablo, I don't have any to share, but you could try looking on the Gamemaker marketplace. There are free downloads you can get which let you add touch controls.
I understood it better this way but I still think the visual is better for me to try. I think the biggest problem for me when learning is bringing up functions that aren't covered in basic programing tutorials.
Now I know your answer as a content creator is obvious but disregarding that, do you think it's typically most beneficial for one to watch a whole tutorial first with little to no knowledge or follow along?
Everyone learns differently, but when I was learning Gamemaker I would type out what they were doing while they were doing it, pausing the video when needed to either catch up, or absorb what they just demonstrated. Afterwards I'd sometimes try and replicate what they did by myself. If I couldn't I'd look back on the video, and even sometimes I'd do the tutorial again if I thought it was beneficial enough. I'd basically do all sorts of tutorials though, trying to absorb as much as possible. Good luck!
i also axcidentally put //get distance we want to move var _disx = abs(_tx = x); var _disy = abs(_ty =y); looks good except the equals signs there are supposed to be MINUS signs lol my blue guy got stuck on walls but i found it :P
@@Slyddar cant wait..wanna learn so i can make my own ARPG with random stat weapons armor trinkets ect with many classes and spells and melee attacks and bow attacks..
Don't completely understand your question, but I'll have a stab at answering it. Visual is the new name for Drag and Drop. There is a GML and a separate Visual video for episode 1. All episodes after that are dual GML/Visual. Fingers crossed somewhere in there I answered you.
instead of a reset var function just do this in get_input() function get_input() { if keyboard_check(ord("A")) left = 1 else left = 0; if keyboard_check(ord("D")) right = 1 else right = 0; if keyboard_check(ord("W")) up = 1 else up = 0; if keyboard_check(ord("S")) down = 1 else down = 0; }
What about if we want to reset the variables at some stage instead, like when we have a state where we don't capture the input. Without a reset function any variable that was set to 1 will stay set to 1 while in that state, and if we have any line that uses those variables, it will continue to run. There's a reason why I've done it like that.
The reason this method is not as good is if you have a large value for walk_speed, say 20, the character will never be allowed to get within 20 pixels of the walls. At low values it won't be noticeable, but the faster the player moves, the more janky it will feel.
Feels a bit more like "tutorial for people who already kinda know what they are doing". All the code lines is like speaking spanish by repeating what others say without know what it means at all. Create this there and [ ] there. Naw.
@@Dbap1997If there was only one code, ok, but unity is C# U5 C++ and then GML. I was hoping to do something neat and small on the side. DnD sounded kinda easy.
Does anyone know how to fix this? "ERROR in action number 1 of Step Event0 for object o_player: Variable .keyboard_check_(100008, -2147483648) not set before reading it. at gml_Script_get_input (line 13) - if keyboard_check_(ord("S")) down = 1; ############################################################################################ gml_Script_get_input (line 13) gml_Object_o_player_Step_0 (line 5) - get_input();" I looked over the code, and have attempted this twice, the problems start immediately once I put in the character object, maybe its existing undetected until I do so, but I have no idea.
one of the most helpful beginner gamemaker tutorials i've seen, thanks
I know VERY minimal coding and wanted to let you and everyone know that this is still relevant, and it is still incredible. I started just a few days ago and I seriously don't know where else i would suggest that anyone go to learn their first steps.
I really appreciate this entire series and thanks so much dude!!
I don't know any code and this feels like speaking spanish by copying a spanish lady you heard once and repeating all phonetically.
Loving the channel, I know the basics of GML. I want to learn visual scripting so I can understand the actual logic behind stuff. You, Paul, and Shawn are my go to most tutorials are from 6+ years ago lol
The production level has gone so far up every time I check your channel, it's awesome to see, I'll gladly dive into this after my current project!
This is EXACTLY what I was looking for! I've wanted to make an arpg for a while, even tho i've no coding experience yet so the movement and combat is already up my ally!
Subbed, excellent series here, perfect for my project for the upcoming game jam, addresses almost everything - I figured out the other 5% on my own, just stuff like spreadshots
Cool. I can't wait for more.
Thanks for sharing I'm new to the channel and I'm really enjoying your tutorials, this series will be of great help in a future project
Great video so far love the explanations
This is so cool!! I work on these tutorial for sure!!
고마워요. 내 게임 선생님😆😆
Can you make a shader/lighting tutorial? I like the way your shaders look!
your tutorials are amazing! thank you for your work!!
I'm new to game design but teach Coding on the middle school level here in Texas, so I have a little coding experience to help.
I found Gamemaker looking for an alternative to the robust Unity, Unreal world where it wouldn't be feasible to teach to 12-13 year olds in a semester. I find Gamemaker is very approachable yet robust enough to make very satisfying, creative, marketable games and 'easy' enough for the kids to have an end product at semester. I myself also own a small edu-resource company and have an American History-based game idea I am pursuing with Gamemaker.
I am thoroughly enjoying your video tutorials and learning a lot at a great rate to get where I need to be to teach the engine and for my personal endeavors. Keep up the good work, and I look forward to continuing with your guidance. Cheers.
I still clip into a wall when I approach it vertically, I looked through my code and I don't see any differences. It's very frustrating because idk what's going on
ive copied everything EXACT and it still gives me an error code (ERROR in action number 1
of Step Event0 for object O_player:) it seems like its telling me that the calc_movement code isn't being read correctly. what am I doing wrong? I don't get it?
Thanks for this! Very new to GML, and did my movements with just a few lines of code. This one however takes it to another level! Though I'm having some issues with it. In my map I created a "tunnel" by putting a row of o_solid one grid square (16 pixels) away from a wall of o_solid. Sometimes the player is able to enter the "tunnel" and other times it can't get through the mouth of the "tunnel". After moving around for a bit, I might get lucky and be able to enter the tunnel. My player and solid sprites are 16x16 with automatic rectangle collision masks. Map grid options are 16x16 snap. Any idea why this might be happening?
i know this is an old comment but if youre still having issues heres some suggestions
if your code is as in the video your problem might be that if the gap is exactly 16 pixels wide and your player collision is also exactly 16 pixels wide, your player object needs to be perfectly aligned with the tunnel to enter, so making the collision mask of your player object smaller should solve the issue, or offsetting the tunnel entrance so one side has one grid square "sticking out" so you can hit a wall and "slide" into the tunnel.
Old comment, but I was having this exact issue. I did change the collision of my object, and that still didn't fix it. What DID fix it was unchecking the "Solid" box on my object (something I HAD checked when looking for other solutions to collision).
I dont know Why but i ran into some issues around the 22:20 mark
The player still passes though parts of the wall but in other parts it works. I have no idea what is happening I've followed the code multiple times and still the same thing happens.
Great! But there's an 1 pixel overlap when moving to the left.
21:04 code works but I cant understand why we want to move the one pixel if we are already not colliding, great video tho
Is this your style of programming character movement and collisions? I'm learning GML as a first language and noticed that there is more than one way to achieve movement and collision.
Thank you for this. I hope this series continues. I was wanting to purchase your udemy course but it seemed a bit old and was after a top-down style of game anyway. Would it still be suitable for a beginner as I am having real trouble with understanding code.
Heya and thanks. My course was made with GMS2, but not 2.3, but I've gone back and added extra videos to cover those changes, so it's still fairly current. I understand if it's not what you are after, but wanted to note I've managed to keep it as current as I can. I also offer support via the Q&A over on Udemy for those having problems. As for continuing this series, I've released the next episode to Patreon members only so far. It will be released to non members later on.
Would this be suitable for me to attempt to grasp the basics of GML with no experience or should I start elsewhere? I am trying very hard to learn and am having trouble finding where to start.
This looks fantastic! I saw the post you made on the sprite maker's site. I just wonder if you've draw a lot of the animation yourself (such as the demons stunned and dying animation). if so, will you be releasing them in some from?
Yes, I will give a link to the sprites in the next episode.
Patreons have access to the latest episode, which has the resource link too. It will be a few more days before it's released publicly.
i'm pretty new to GML (and coding in general), but is using a script just a cleaner way to code movement in a step event compared to typing key_right = keyboard_check("D")); etc. right into the event?
Later on we will implement a state machine (see my platform tutorials if you don't know what that is), we will use the script to get the input in multiple locations. I'm preparing the code for when that happens. It will mean when we are in a state that does not need input, like knockback, we can just omit the get_input script to ensure the player does not move.
Thanks !
Edit: Also why didn't you use the key press event and set up a manual way of moving the player ?
hey i was wondering if u have any tutorials for an idle Rpg game? like someone that lvls up with hiting monsters collect items n increase difficulty per lvl
Okay so when i finish the code to test collision my blue square jumps around the place. doesnt run along the "walls" as smooth as yours
Never mind it was a ME issue
Hello! New to gamemaker but just wondering, what’s the difference between coding the collision movement ourselves, and ticking the Solid property on the object?
Thanks!
Solid checkbox moves objects back to their previous position before the collision. You have no control over when it is applied, you can't do one way platforms with it, it won't do pixel perfect collisions when moving fast as there will be gaps. It's a really really basic movement option which you will want to move on from once you start to see it's limitations.
I don't know why, but movement doesn't work for me. I am not moving, when I am at the wall and I am holding both horizontal and vertical keys. :(
Make sure to call the calc_movement() function in the steps event in your player object
yes, I'm calling it and it works, but when I am at the wall and holding both horizontal and vertical keys, I don't move.
@@lukasnohejl603 I have the same problem. Did you find a fix?
No, so I am using other collision system
I found that if you increase the walk_spd value it stops it from happening. for me anything from a value of 1 and blow will stop me from sliding along walls when both x and y keys are pressed. hope this helps :)
for some reason my game keeps on crashing when I try to press a key, I'm on the latest build of GameMaker Studio 2 and I'm unsure what to do
Comment out all of your while loops and see if it still crashes. If so, you know they are set up wrong.
Thanks Slyddar, I buy your courses in Udemy and i love it :) need more courses and videos please in Udemy :) (sorry my english haha)
Thank you for the support! So much support though, yet not subscribed to my channel here :( hehe, I'm taking a break from making Udemy courses just for now. Working on a game instead :D
I have a weird problem where one variable will be a local variable and another will be just a variable, is there a way to fix that?
(edit) I fixed it but idk how i did
whenever i run it and try to move, the player snaps to the top of the screen and i cant move up or down only left and right.
Edit: i fixed it I had y =+ instead of +=
When i try to collide with the object, the game crash, do you know what is it?
The same thing happened to me but I realized my solid object had the wrong name. It was obj_solid, but I wrote it o_solid in the code.
Is it possible to make a game just like this but being able to screen rotate like in the game Realm of the Mad God?
Anything is possible, but 3D in Gamemaker, where you rotate the screen, would be extremely difficult.
i wasnt able to move up but i found that the keyboard_check(ord("w") needed to have a CAPITAL "W"
Thank you for the tutorial everything works fine but when i change player speed (walk_spd) i cant go horizontal + vertical while beside solid object. Is there any way to change player speed without breaking the collision?
I have this issue too, plus I can't fit between small gaps sometimes
This collision system is a very basic introduction, and is not meant to replace a dedicated pixel perfect system. The problems you are having is if you increase the speeds too high, the movement in one step places the player in a collision, and they are then moved back to their start position, essentially not going anywhere. To solve this there needs to be a low enough acceleration which will allow the player to get closer and closer to a solid over a few steps.
The other option is a pixel perfection solution, which checks for a collision, and moves the colliding instance 1 pixel at a time up against the solid. I have already shown this method in my 2D platformer tutorial, hence why I didn't use it here again, but feel free to apply that logic to this type of top down game, and it will give you a system without the faults you have mentioned.
@@Slyddar Thanks for quick anwser i appreciate your help.
Thanks a ton!
great stuff! Thank you!
Hi, I have one of your courses on Udemy, but I have not seen any info on how to make touch based controlls, can you add any way to do it, this to make a game for mobile phones
Hey Pablo,
I don't have any to share, but you could try looking on the Gamemaker marketplace. There are free downloads you can get which let you add touch controls.
@@Slyddar is there one in particular that you can recommend, I been trying to learn how to do it, but haven't found any good tutorial on how to
I had used this one a few years ago when testing - marketplace.yoyogames.com/assets/258/virtual-joysticks
G'day!
G'day Gamer!
I understood it better this way but I still think the visual is better for me to try. I think the biggest problem for me when learning is bringing up functions that aren't covered in basic programing tutorials.
I think this is why the dual GML / Visual I started in episode 2 is so good, as you can see the GML equivalent at the same time.
Now I know your answer as a content creator is obvious but disregarding that, do you think it's typically most beneficial for one to watch a whole tutorial first with little to no knowledge or follow along?
Everyone learns differently, but when I was learning Gamemaker I would type out what they were doing while they were doing it, pausing the video when needed to either catch up, or absorb what they just demonstrated. Afterwards I'd sometimes try and replicate what they did by myself. If I couldn't I'd look back on the video, and even sometimes I'd do the tutorial again if I thought it was beneficial enough. I'd basically do all sorts of tutorials though, trying to absorb as much as possible. Good luck!
Anyone know why the program FAILED to run?
You will need to be a little bit more specific about the error, at what point did it fail to run/ what does the error message say?
are you going to continue making these?
Yep, it will most likely be the next video I make.
i also axcidentally put //get distance we want to move
var _disx = abs(_tx = x);
var _disy = abs(_ty =y);
looks good except the equals signs there are supposed to be MINUS signs lol my blue guy got stuck on walls but i found it :P
movement isnt working for me
does anyone know if this tutorial will still work?
It does
Yea but the collision function isn't perfect
thank U for Ur help!!
you gonna continue this series?
Yep, it will most likely be the next video I make.
@@Slyddar cant wait..wanna learn so i can make my own ARPG with random stat weapons armor trinkets ect with many classes and spells and melee attacks and bow attacks..
Well the new episode is out. Some Patreons have access to it at the moment, then it will be released publicly in 3 days time.
Isn't drag and drop, why is it titles such?
Don't completely understand your question, but I'll have a stab at answering it. Visual is the new name for Drag and Drop. There is a GML and a separate Visual video for episode 1. All episodes after that are dual GML/Visual. Fingers crossed somewhere in there I answered you.
What is the name of your game
keepersofpyrite.com/
instead of a reset var function just do this in get_input()
function get_input() {
if keyboard_check(ord("A")) left = 1 else left = 0;
if keyboard_check(ord("D")) right = 1 else right = 0;
if keyboard_check(ord("W")) up = 1 else up = 0;
if keyboard_check(ord("S")) down = 1 else down = 0;
}
What about if we want to reset the variables at some stage instead, like when we have a state where we don't capture the input. Without a reset function any variable that was set to 1 will stay set to 1 while in that state, and if we have any line that uses those variables, it will continue to run.
There's a reason why I've done it like that.
other way to create collision if it's not working for you
function collision(){
var _hmove = right - left;
var _vmove = down - up;
if _hmove != 0 or _vmove != 0 {
var _dir = point_direction(0, 0, _hmove, _vmove);
_hmove = lengthdir_x(walk_speed, _dir);
_vmove = lengthdir_y(walk_speed, _dir);
if (!place_empty(x+_hmove, y))
{
if (place_empty(x, y+_vmove)){
y+=_vmove;
}
} else {
if (!place_empty(x, y+_vmove))
{
if (place_empty(x+_hmove, y)){
x+=_hmove;
}
}
}
}
}
The reason this method is not as good is if you have a large value for walk_speed, say 20, the character will never be allowed to get within 20 pixels of the walls. At low values it won't be noticeable, but the faster the player moves, the more janky it will feel.
You should never delete things you don't need "currently" move them to the bottom. Never know where inspiration will head you
Feels a bit more like "tutorial for people who already kinda know what they are doing". All the code lines is like speaking spanish by repeating what others say without know what it means at all. Create this there and [ ] there. Naw.
Yeah almost like you actually have to learn to code
@@Dbap1997If there was only one code, ok, but unity is C# U5 C++ and then GML. I was hoping to do something neat and small on the side. DnD sounded kinda easy.
@@LaserGadgets game development isn't east
@@Dbap1997Yeah it humbles you a bit when you dive in.
Does anyone know how to fix this? "ERROR in action number 1
of Step Event0 for object o_player:
Variable .keyboard_check_(100008, -2147483648) not set before reading it.
at gml_Script_get_input (line 13) - if keyboard_check_(ord("S")) down = 1;
############################################################################################
gml_Script_get_input (line 13)
gml_Object_o_player_Step_0 (line 5) - get_input();" I looked over the code, and have attempted this twice, the problems start immediately once I put in the character object, maybe its existing undetected until I do so, but I have no idea.