Top Down DnD & GML Tutorial in Gamemaker #4 Enemy A.I.

  Рет қаралды 50,185

Slyddar

Slyddar

Күн бұрын

Пікірлер
@chrishodgkinson322
@chrishodgkinson322 3 жыл бұрын
I just love the way you explain things in such a way that it makes potentially difficult things easy to understand. Also, kudos for the amount of effort that you must put in each episode having to film it twice and then edit it all together for GML and DnD at the same time. Much, much respect.
@WGY_Games
@WGY_Games Жыл бұрын
Although I didn't use this tutorial for a dungeon crawler, I did use it for a horror game monster. Great tutorial either way!
@sveninspace
@sveninspace 11 ай бұрын
what's your game?
@WGY_Games
@WGY_Games 11 ай бұрын
@@sveninspace Haven't done any public things regarding it yet. I wanna keep it under wraps until I'm content with how it looks. But it's a different take on the "mascot horror" trend that has become so stale as of late. (Minus Shipwrecked 64, that game slapped)
@drawfull
@drawfull 7 ай бұрын
Thanks!❤
@Slyddar
@Slyddar 7 ай бұрын
Wow, thank you!. You're my first donation through KZbin, so it really warms my heart you've done something like that. I very much appreciate your generosity, and really hope the content helps you make a cool game! ❤
@machan6635
@machan6635 2 жыл бұрын
For those of you wondering how Slyddar put down multiple enemies holding 'Alt', it's actually 'Right Alt', not 'Left Alt'. Just found out about it today
@Slyddar
@Slyddar 2 жыл бұрын
Actually I was using left Alt, but both left and right work the same.
@machan6635
@machan6635 2 жыл бұрын
@@Slyddar I'm not sure if that is true back then or that they've updated using Alt's, but currently using Windows and making something right now, you can only use 'Right Alt' to put down multiple objects. 'Left Alt' now acts like a dragging of the camera/room around
@Slyddar
@Slyddar 2 жыл бұрын
I'm using the latest stable version, 2022.3.0.625. That's normally what middle mouse does. In my Preferences, Redefine Keys, 'Paint with Resource' is set to Alt. No left or right alt, so maybe your one is different.
@machan6635
@machan6635 2 жыл бұрын
@@Slyddar Yeah honestly quite interesting and weird, my middle mouse also does same thing, but so does my alt when I have that button and left mouse clicked for the object I want to place both at same time.
@kody4bruh
@kody4bruh 2 жыл бұрын
@@machan6635 you most likely have the laptop mode turned on at the top of the panel, next to the zoom buttons.
@derDeydrihmOrcsTale
@derDeydrihmOrcsTale 6 ай бұрын
You, Sir, are more than just a hero. Without that i would struggle with hsp and vsp and collisions for ages!
@Jerementor
@Jerementor 3 жыл бұрын
Respect! Great tutorial, and unbelievably cool that you include both the DnD and GML. Great job :)
@lando1296
@lando1296 7 ай бұрын
Thank you very much for this video. Just starting out in Gamemaker and this video helped teach me a lot of the simpler concepts of making a game.
@joshbutler2563
@joshbutler2563 3 жыл бұрын
Phenomenal, top-tier quality work as always. I appreciate everything you put out. You deserve WAY more attention than you get.
@devinblack606
@devinblack606 Ай бұрын
Just in case anyone runs into the same problem I did. If you have a create event in the child enemy it will override the one in the parent enemy. This caused an error telling me I had not defined the variable "path". I ran into this problem around the 23:30 minute mark of this tutorial. The solution was simple, delete the create event in the child enemy.
@AquosFrost
@AquosFrost 2 жыл бұрын
bro you do GML and DND! thats a good tutorial!
@tjj1171
@tjj1171 3 жыл бұрын
Hey great to see you making another tutorial.
@Littlemik15
@Littlemik15 2 жыл бұрын
Just want to say im loving the series! And that im patiently waiting for part 5 🙂
@Slyddar
@Slyddar 2 жыл бұрын
Hey, that's nice to know, I appreciate the comment. I'm editing part 5 now, so shouldn't be too much longer. Hopefully you are subscribed so you can see when it drops.
@drawfull
@drawfull 7 ай бұрын
This is fantastic, thank you so much.
@duckyy3129
@duckyy3129 3 жыл бұрын
Another tutorial would be awesome your content is the best your sooooo underrated your the best
@duckyy3129
@duckyy3129 3 жыл бұрын
By another tutorial I mean part 5
@happy_run
@happy_run 3 жыл бұрын
This is a cool series
@thegamingbean953
@thegamingbean953 Жыл бұрын
Thanks for tutorial man, it really helped me with my game
@Slyddar
@Slyddar Жыл бұрын
Great to know, maybe you can sub to show your appreciation :D
@Quaffyson
@Quaffyson 3 жыл бұрын
so amazing! i wait so long but its always a good tutorial! I rather 1 GREAT tutorial a month then 1 bad tutorial a week
@t90gamemakervietnam8
@t90gamemakervietnam8 2 жыл бұрын
Thanks for your tutorial, so cool !!!
@xrqton
@xrqton 2 жыл бұрын
what an amazing tutorial - thanks so much mate. Learned so much.
@bvmgerb6357
@bvmgerb6357 2 жыл бұрын
At 17:52 my grid is drawing, but it is drawing to the right and to the bottom of the walls instead of on top of them. I am not sure what is going on, I couldn't find anything different in my code. Edit: In mp_grid_add_instances, I changed false to true. Now it correctly highlights the walls, I'm not sure why this is. For some reason it seems like it was rounding causing the grid to be drawn offset to the walls.
@kody4bruh
@kody4bruh 2 жыл бұрын
I had the same problem and your fix helped me, thank you.
@Vixii
@Vixii Жыл бұрын
Thank you!
@DEEP0
@DEEP0 6 ай бұрын
amazing video! how did move you move everything in the brackets along at 30:42, been looking for the shortcut everywhere but can't find it!
@Slyddar
@Slyddar 4 ай бұрын
In GML when you select multiple lines you can just press Tab to move text right or Shift Tab to move it left.
@DEEP0
@DEEP0 3 ай бұрын
@@Slyddar that's gonna save me an accumulation of at least...15 minutes over the span of a year! thanks buddy 😸
@specialx9856
@specialx9856 3 жыл бұрын
high quality as always thanks.
@killerkartoffl
@killerkartoffl 3 жыл бұрын
Hey im working on a game and your tutorials are helping me alot. could you please make a tutorial about how to make an inventory and how characters can equip items?
@Slyddar
@Slyddar 3 жыл бұрын
Can't promise anything, but thanks for the suggestions.
@djeka415
@djeka415 3 жыл бұрын
Thanks for tutorials 🙏
@yes3714
@yes3714 3 жыл бұрын
In this tutorial seiries, can we get a video on an inventory and different weapons?
@facundobrandi1116
@facundobrandi1116 2 жыл бұрын
hello, this is a very good tutorial, I'm waiting for the next one please
@Niandra
@Niandra 2 жыл бұрын
This video was really really useful, thanks!! Do you have any advice on how I would basically take this movement/collision and put it on a grid? So a character moves say 50 flat pixels every second, instead of continously moving?
@Slyddar
@Slyddar 2 жыл бұрын
There are answers for this on yoyo's gamemaker forum. Look for grid movement examples.
@elizabethkawinski1721
@elizabethkawinski1721 2 жыл бұрын
These tutorials are great! I'm having an error pop up in my Room Start event. My variables "_w" and "_h" are not defining, and so lower under "create motion planning grid" , the program is saying "Assignment operator expected". I've skipped back and can't seem to find the issue. Please help!
@Quaffyson
@Quaffyson 2 жыл бұрын
cant wait for the next one
@xionggdi
@xionggdi 7 ай бұрын
i love ur lesson, plz more
@matt.137
@matt.137 2 жыл бұрын
have a question about the motion planning set up when i set up the code following the video using DND and tested it, the red boxes that the function draws ends up being way bigger than the actual size of my wall tiles. how do i fix this?
@zackwhite411
@zackwhite411 2 жыл бұрын
having the same issue:(
@Sharlenwar
@Sharlenwar 2 жыл бұрын
Yeah, same here.
@stickbug-grenade
@stickbug-grenade 2 жыл бұрын
i solved it by changing the TS macro to 1
@CottonCandySnake101
@CottonCandySnake101 2 жыл бұрын
@@stickbug-grenade When i did that the enemies were able to walk through the top of the Solid
@brianfleming2801
@brianfleming2801 2 жыл бұрын
same issue here... if I set precision to true, it works. Not sure why this is necessary for me.
@TheSpooker9000
@TheSpooker9000 Жыл бұрын
no idea whats going on but it works so you dont hear me complain
@VernorsDoctor
@VernorsDoctor 3 жыл бұрын
Please make this a big and extensive series
@anthonypacitto3958
@anthonypacitto3958 2 жыл бұрын
Awesome tutorial!! I was wondering if you can provide a method for preventing enemy overlapping?
@hypn0man
@hypn0man 3 жыл бұрын
Great tutoril, it was very useful
@hypn0man
@hypn0man 3 жыл бұрын
When is the next one though?😅
@e_buffturtle
@e_buffturtle 3 жыл бұрын
Is there a way you can make the enemies avoid a tile set (tile collision) instead of solid objects? I have both a solid tiles and objects that have a variable making them “solid”
@Slyddar
@Slyddar 2 жыл бұрын
Yes. Use a height and a width for loop at a game room_start event and loop through each tile, checking for a collision_rectangle the size of the tile. When you find a collision, add that tile to the planning grid with mp_grid_add_cell().
@serdar-bayram
@serdar-bayram Жыл бұрын
hi, the enemies are shaking when in idle position. When my character moves closer to the enemy, the problem is fixed, but when the character moves away, they flicker when they go into idle position. How can i solve this problem.
@n1ght_v1be
@n1ght_v1be Жыл бұрын
"im not gonna be dumb this time" proceedes to make it be the price of 1 blood instead of 0
@Kukatoo
@Kukatoo 2 жыл бұрын
great tutorial!
@theonewhoasked9834
@theonewhoasked9834 17 күн бұрын
hello so im working on a game with similar enemy ai however im having trouble with the path finding collisions, basically when the enemy walks next to walls or near walls parts of the sprite is just in the wall it can also walk thro spaces much smaller than its sprite size
@TabbedOutRat
@TabbedOutRat 9 ай бұрын
still here from the first video.
@CoyoteArcade-182
@CoyoteArcade-182 17 күн бұрын
how did you set up a collision layer ?
@ShaneTheCreep
@ShaneTheCreep 9 ай бұрын
It works really good, I just have to figure out a small bug, very rarely I am crashing getting an error saying "Trying to assign to a non-existing path." When setting the player_found boolean. I can't quite figure it out yet, but I do know that the player is still alive when it happens.
@victorsikkim
@victorsikkim Жыл бұрын
how to avoid stacking enemies in each other?
@Qwerka
@Qwerka 2 жыл бұрын
im trying to create a hotline miami alike game, so the enemy shall look at the character whilst moving to the character. but while it is doing that, it goes straight into solid objects. how may i fix that?
@Qwerka
@Qwerka 10 ай бұрын
I have figured it out until then XD
@IMPOSTERPEELY
@IMPOSTERPEELY 8 ай бұрын
Oh my goodness I need help I want to do this but I can’t read what you write I can’t tell what you put in it’s too blurry please help
@R.P.G.G
@R.P.G.G 7 ай бұрын
none of my variable are set before reading in the check_for_player script even tho i have them in the "create" on enemy_par, any ideas why this is or how to fix it?
@imbenyt9189
@imbenyt9189 Жыл бұрын
Very good video, good details and information. But gott damn you put more ads in this video than a TV channel ad break 😭
@Slyddar
@Slyddar Жыл бұрын
Glad you like the video, but sorry about the Ads. I have no control over them. Even if I choose to put no ads and not monetize the video, KZbin will put them on there anyway.
@xxninjagaming7407
@xxninjagaming7407 2 жыл бұрын
Hey I’m trying to do the move toward poin function and when I put the 1 for the speed it won’t work can you plz help me
@EggCrafted
@EggCrafted 2 жыл бұрын
Amazing video, but can you make an tutorial entirely for dnd? I've seen you started that series, but I cannot find any episode from 2. Thanks!
@Slyddar
@Slyddar 2 жыл бұрын
Episode 2, 3 and 4 are dual DnD and GML videos.
@lordekko7277
@lordekko7277 Жыл бұрын
I Don't know if this is just me but it seems like this does not work as of right now where game maker is at, this is because i keep running into issue after issue even after rewatching the video a total of 4 times it just wont work even when I copy the code to a T.
@Slyddar
@Slyddar Жыл бұрын
Sorry to hear, but alas, it still works perfectly, with many others implementing the code and having it work for them. This may not help you, but the source code is available to Patreon members. If that doesn't help you, I hope you found a solution anyway. Good luck, don't give up!
@Tancanvin
@Tancanvin 9 ай бұрын
Hi, my enemy is not moving. I dod everything right. But it is still not moving
@Tancanvin
@Tancanvin 9 ай бұрын
Nevermind. I set the enemy as the parent instead of a child
@RPAS1
@RPAS1 Жыл бұрын
Teacher, can I repeat these codes in my commercial project?
@mileselectric3677
@mileselectric3677 2 жыл бұрын
hey this is working very well so far but im trying to get it to work for a platformer and having a few issues
@mileselectric3677
@mileselectric3677 2 жыл бұрын
first issue is i cant get them to move towards the x position of the player if i start on their left side unless ive jumped over them. i also want them to be able to jump after the player but only if they detect the player and the player is above them (i learned about the choose event because of this tutorial so i know how to set it to be random now, thanks) second i have multiple player characters in the game how can i set it so they properly chase the closest player to them or the one who hit them last and finally im having trouble setting the speed to something that works i can send code if needed thank you to anyone who can help Edit* ive kinda figured it out, the problem was i needed to place the script in my horizontal Collison code, idk why that worked but now im having an issue where if they walk off a ledge they stay in mid air until they meet my x position while im not moving only then does gravity work. fixed trhe speed with what i did above. the only thing i need now is for them to jump over my solid_obj to get to me if necessary, to detect the all players available and to pick which one to follow.
@bunnyqueen20XX
@bunnyqueen20XX Жыл бұрын
I have an issues with the ai, for some reason when im stopped the enemies will be put a ways away like the code says it should, but then for some unknown reason will inch forward toward me.
@gristlycrown6459
@gristlycrown6459 4 ай бұрын
im confused, when did the global.mp_grid receive a value? line 27 on the check for player script seems too request the value of it and now it won't launch? im lost
@Slyddar
@Slyddar 4 ай бұрын
I'm not sure what time stamp you are referring to. Come to the Discord if you need help, as it's easy to post code/screenshots there and get help.
@BSS2151
@BSS2151 3 ай бұрын
Where did you get the enemy sprites from?
@Slyddar
@Slyddar 16 күн бұрын
The link to the sprites is in the description
@thisguy3444
@thisguy3444 Жыл бұрын
I got “runtime error variable not set” after adding “execute script check_for_player” everything works if I remove that piece of code
@Slyddar
@Slyddar Жыл бұрын
Hard to tell, as you haven't provided the whole error. Can you copy and paste the whole error, and maybe I can help then.
@froggypickle10
@froggypickle10 Жыл бұрын
@@Slyddar i have the same error heres what its says ___________________________________________ ############################################################################################ ERROR in action number 1 of Create Event for object : Unable to find instance for object index 6 at gml_GlobalScript_Check_for_player (line 24) - move_towards_point(Obj_Player.x, Obj_Player.y, 2); ############################################################################################ gml_GlobalScript_Check_for_player (line 24)
@Yamatoetlafindumonde
@Yamatoetlafindumonde 11 ай бұрын
I got a problem with the room start event , at line 9 it says : GM1020 - the function mp_grid_create takes no less than 6 argument but 5 are provided. if someone can help me ! thanks
@arenndups5294
@arenndups5294 2 жыл бұрын
idk why but my enemies will just stop moving altogether if I stick close to my obj_wall. they will refuse to pathfind to walls that make a thin corridor-like space for my character to move to but the enemies wont enter it. idk what to dooo ;(
@walkanadavih
@walkanadavih Жыл бұрын
❤❤
@Lemonade-ip1jf
@Lemonade-ip1jf 5 ай бұрын
Hi, I followed everything you said but when checking for player in the enemy check for player part it keep saying that my "path" variable is not defined. Can anyone help me with why this is?
@Slyddar
@Slyddar 4 ай бұрын
At 19:08 we add the path variable to the parent object. Make sure you have done that.
@Lemonade-ip1jf
@Lemonade-ip1jf 4 ай бұрын
@@Slyddar Thanks, I checked, turns out I accidentally overwritten the create event in the parent object by adding a create event in o_enemy as well.
@Slyddar
@Slyddar 4 ай бұрын
@@Lemonade-ip1jf that was going to be my next suggestion. You can add event_inherited() to the top of the enemy create event to ensure it gets any parent code.
@gnomefisher7920
@gnomefisher7920 2 жыл бұрын
If I wanted to add more than 1 type of enemy, how would I go about this
@deathincarnatesplace
@deathincarnatesplace 8 ай бұрын
hey anyone see at 17;42 when he puts in the game object how the grid convert to like 64 or something or 32. that jumping back and forth has caught my eye but seems not to matter so far.
@Slyddar
@Slyddar 8 ай бұрын
Each layer has it's own grid size, which you can set up the top right. We were on the Collisions layer, which is 32x32 and then I click on the Instances layer which has a 64x64 size.
@e_buffturtle
@e_buffturtle 3 жыл бұрын
Is there a way to implement a minimum and maximum distance that enemies have between each other? I don’t want enemies to be too crowded up
@Slyddar
@Slyddar 3 жыл бұрын
It's a tough problem to solve. You can run a collision event with the enemies, and compare their id's, so you can decrease the path speed of the lowest id. You also set an alarm to irandom_random(30, 60), which has code to increase it again if not in a collision with another enemy.
@vohuuthang7217
@vohuuthang7217 Жыл бұрын
i love you
@kinglunar2467
@kinglunar2467 Жыл бұрын
Am I supposed to watch this in a series or something because i dont have check for player script. ik its 4# of a series but i thought it'd work on its own.
@Slyddar
@Slyddar Жыл бұрын
You probably worked this out already but they all build on from the previous episode i.e. it's a series. You can't just pick and choose which ones to follow, you have to do them all in sequence.
@lajeandom
@lajeandom Жыл бұрын
@@Slyddar oh so thats why my build is not starting! 😅I am just trying to have an enemy that chases you from left to right (it's not a top down) and I did everything you did in this video, but when I try to start it just says this (MainGuy is Player): ERROR in action number 1 of Create Event for object : Unable to find instance for object index 1 at gml_GlobalScript_CheckForPlayer (line 26) - move_towards_point(O_MainGuy.x, O_MainGuy.y, 1); ############################################################################################ gml_GlobalScript_CheckForPlayer (line 26)
@deathincarnatesplace
@deathincarnatesplace 8 ай бұрын
hello slyddar you ever want to get a lot of views just show how to replace art at the end of an already made series. it will go crazy and just add it to your old videos.
@erichernandez4192
@erichernandez4192 2 жыл бұрын
Can anyone help me? I’m having a problem when I get to the Clean Up event but I think my comment keeps getting hidden or something because I commented 2 times and it’s not showing up.
@فلورنت
@فلورنت 2 жыл бұрын
We are you
@posthuman2716
@posthuman2716 3 жыл бұрын
Where is GML ?
@reasonoflife1620
@reasonoflife1620 2 жыл бұрын
i cant download the sprites bc of the stupid winzip thing that i have to buy to open it
@Slyddar
@Slyddar 2 жыл бұрын
Windows 10 comes with 7zip, so just right click and extract it. If that fails, go get 7zip.
@reasonoflife1620
@reasonoflife1620 2 жыл бұрын
@@Slyddar thank you it really helped
@apexinn
@apexinn 2 жыл бұрын
use winrar
@yusufmuhamet973
@yusufmuhamet973 2 жыл бұрын
make a lot of GML :)
@felupan
@felupan 2 жыл бұрын
My enemies are not even appereaing on the game
@zackwellgans5265
@zackwellgans5265 6 ай бұрын
Mine too
@Gamemode_1000
@Gamemode_1000 2 жыл бұрын
i got 3 errors
@Slyddar
@Slyddar 2 жыл бұрын
If you're boasting, congrats, that's impressive! If you're after help, you'll need to post what the errors actually are.
@Gamemode_1000
@Gamemode_1000 2 жыл бұрын
@@Slyddar thy dk what obj_player x and obj_player y is
@Slyddar
@Slyddar 2 жыл бұрын
If you have an error, post the actual error so we can help you.
@BannedAccountofnsofublanvpam
@BannedAccountofnsofublanvpam Жыл бұрын
lmao bro, be specific. show some love lmao
@marcindomanski5654
@marcindomanski5654 2 жыл бұрын
you should focus on GML - its easier to understand
@Slyddar
@Slyddar 2 жыл бұрын
That's easy to say if you use GML only, but for people who like using DnD, your opinion is to just leave them be and give them no resources to learn from? Being considerate to all is in my nature, and while I prefer to develop on GML, it doesn't mean I should ignore a whole bunch of people who choose to learn the same language a different way. Under the hood DnD is still GML, it just has a layer above allowing others to appreciate it in a different way. Just like life, be tolerable of other points of view, as it can be different to how you see things, but their learning goal may still be the same.
@marcindomanski5654
@marcindomanski5654 2 жыл бұрын
You should create 2 different video - one with only gml and other with drag&drop, because in this approwach no one will be happy (or very happy).
@LaserGadgets
@LaserGadgets 9 ай бұрын
Don't wanna be the negative nelly but there is almost no difference in regular code and D&D. Without knowing what to pull over, func var or whatever, its pretty much its just copying what someone is doing who is know what he is doing.
@babybear7586
@babybear7586 2 жыл бұрын
It didn't work
@darkhunter777
@darkhunter777 2 жыл бұрын
Да вот единственное что хорошо в Game marker это свет, а остальное все говно. Там ни текстур нормальных не вставить ни менюшки сделать нормальной нельзя 😁
Top Down DnD & GML Tutorial in Gamemaker #5 State Machines
24:18
Gamemaker Top Down GML #1 - Can We Make Gauntlet?
25:31
Slyddar
Рет қаралды 39 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Top Down DnD & GML Tutorial in Gamemaker #3 Projectiles
20:47
Gamemaker Top Down DnD #1 - Can We Make Gauntlet?
27:08
Slyddar
Рет қаралды 105 М.
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 374 М.
How To Make Enemies Smarter: AI Weighted Decision-Making
11:37
Top Down DND & GML Tutorial in Gamemaker #2 Sprites
25:58
Slyddar
Рет қаралды 38 М.
The Trick I Used to Make Combat Fun! | Devlog
8:12
Game Endeavor
Рет қаралды 1,7 МЛН
RESOLUTION guide for game devs & GameMaker
8:50
Sara Spalding
Рет қаралды 70 М.
Object States | Game Maker Studio 2
22:21
FriendlyCosmonaut
Рет қаралды 139 М.
GameMaker Studio 2 - Random Level Generation
30:57
Heartbeast
Рет қаралды 115 М.
How to make a Camera for any GameMaker game in 4 minutes
3:58
Sara Spalding
Рет қаралды 54 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН