GameMaker Studio 2 - Random Level Generation
HTML-код
- Опубликовано: 19 сен 2024
- For more GameMaker Tutorials and Courses: learn.heartbeas...
Sprites: www.dropbox.co...
Old GMS 1.4 version of this series: • [GameMaker Tutorial] R...
/r/GameMaker Discord GitHub: gamemakerdisco...
Bitmasking: gamedevelopmen...
Grid Data Structures: docs2.yoyogame...
Follow me on Twitch for GameMaker livestreams: / uheartbeast
Follow my twitter: / uheartbeast
Like my Facebook page: / heartbeast.studios
Follow me on Tumblr: / uheartbeast
GameMaker Tutorials on Reddit: / gamemakertutorials
Thank you all so much for your support!
Silly me. I forgot to destroy the grid_ data structure in the Clean Up Event. I'll be adding that at the start of part 2.
Until then, I highly recommend you all do it yourselves :)
can you add item spawning in the random world, in a following tutorial ???? and / or structure spawning like i can make a dungeon and it will be places far from eatch other in the random world???
Can you Please add in items and enemys that will randomly generate in the room, and is a finish or a room end or something like that possible too? :D thanks a lot!
can you send me the code of this game ?
Hey HeartBeast, just wanted to let you know that your tutorials helped me win a Hackathon at my university, I got a small scholarship and a job interview thanks to you!
Yeah dude... I got a job in IT Release Management because of a game I learned to make by watching HeartBeast. Dude is a legend.
I've been holding off on tackling autotiling myself, hoping for the new functionality to arrive - but that Bitmasking stuff is great! Awesome tutorial, as usual :)
Thanks! :)
Awesome tutorial. It would be awesome to get a follow up for random level generation using chunks or a similar system to Spelunky, where there are pre-designed "rooms" randomly placed around the game room. I would love to see HeartBeast do this! Or a follow up that puts simple enemies in this random level generator
Amazing job Benjamin! I've been working on level generation module for your udemy course game. I was excited when i saw you made new video. It helped me refactor my code and use new better methods for autotiling! Keep up the good work, I'll always support you :)
It's interesting but I gotta say I have a couple issues with the way you're doing it:
1) Doing something to prove it works then undo it is counter productive I'd say. We trust you, don't worry, just do your thin.
2) Also, this video was a little too much "copy-pastey", we just follow and copy the code. I like your "mini challenges" and I definitely missed them here.
But all in all, neat video, thanks for doing it! :)
Good Lord Ben, you should be hired by Yoyo Games already, your videos are awesome!
Gah! I know this video is years old but I really can't get this to work.
I downloaded the file, tested yours and it works fine. Even attempting to copy the work over from yours to my game just breaks it entirely and it stops working. I have looked through every single line and character and I have no idea why it's doing this, I'm sad and frustrated. I don't know if I'm just stupid or blind and can't seem to notice the issue.
My DS grid is being initialized but nothing seems to update it. Was there a change that I would have to work this into the Step function or should it still work in the Create? I have no idea what's going on and my brain hurts!
I figured it out, I am happy and shall continue with my game.
@wynniechan3366 I know it's been a year since you posted this, but do you remember what was wrong?
I can't find any videos explaining random generation that isn't just using a sold product and following along with this tutorial doesn't work.
Yes! Been waiting for this
I followed this to the second and couldn't for the life of me figure out why it wasn't working.....
I was spelling grid wrong the whole time lmao.
omg been waiting for this for so long
Ah, that's awesome ! It's really gonna help me to build levels for my project, thank you. Altho, is it possible for objects that are not tiles (trees and rock for example) to be placed at random inside the cells ?
for the moment it's working with the trial version of Game Maker
Oh yes! Am I ever glad this is posted. Thank you!
You are genuinely a kind and generous person, Ben!
Thank you for all the content, and informative knowledge you've made so readily available!
i know im a few years late but in the NORTH * _north_tiles ect. section i keep getting this error plz help
Object: Obj_level Event: Create at line 51 : unexpected symbol "*" in expression
Great tutorial! this helped me a lot with my roguelike game :)
Happy to see this in GMS2 :)
I love your videos and buy your courses to support you! Continue the great work.
Come back on game maker ? Amazing !
I never left ;)
Just in time to help me with my project! :D
Hi thanks for the tutorial, what variables would I change to make it 64 by 64 instead of 32?
This method doesn't seem to be working right for me. The Wall tile set isn't drawing like it does for you. So all the levels I create just look like a mess instead of having defined walls. I'm sure it's something I did, just have to skim through my code and look for a mistake.
Two years late, but did you find out? :D
Awesome tutorial. Thanks for your effort 😀
I dot care its not for beginers I will copy entire code step by step.
ik im late but you wont learn anything by just copying m8
Can you use the "Controller" to place objects?
How do I always create from the middle to the edges of my room? I don't want the rooms to be generated by the corners
this isnt working for me. idk why.
I dont get any errors it just dont show the tiles :(
Great tutorial man!!
Guys if you are interested in learning a lot, i gotta say you should take Benjamins Udemy course, by far its been amazin no bullshit and even thoe its still not completed, there are some future lectures that will be amazin and i bet it would help a lot of you are even a medium lvl dev with gms2
Its awesome !Could you show how to create a random generation like in the terraria?
P.S ty for your lessons
I did not understand much but I will save this vid for later
Nice tutorial man, just wanna point out that you could`ve put line 62 in the `else` block of the conditional @ line 52, making the second double `for` loop useless and the whole thing a lot lighter.
I think I'll just use an array or use a switch statement style random chunk load system where I can use functions to make this kind of random generation easier to deal with.
Thanks Ben!
how'd you make the wall tiles? I tried comaring your floor tilemap with the bitmask tutorial tilemap structure, couldn't find much correlation with the last few tiles..
Will you be adding a way to save these random levels in the future? Great tutorial, thanks!
Is it difficult to try to convert the code in Gamemaker studio 2 into code that's compatible with Gamemaker studio 1.4.x? Sorry if this is a stupid question, I just want to be able to use some of these gmstudio 2 tutorials.
He already made a similar procedural generation tutorial some time ago for GameMaker: Studio 1.x, so you could just use that.
As Paxx said, he already did a 1.x tutorial for this, but to answer your question i think this particular one won't work in gms1.x as i think he uses layers in this one and not actual objects, but i still havent watched the video
Most of the code is the same btw, 95% of it works
raspberry_picker39 thank you for the information, you answered pretty much all of the questions I had. I will check out that 1.x video.
Matthew Stephen no problem ;) good luck with your project
Followed along and got to the end product, still mega confused; looks like I need to brush up on some new things. Thanks for the video anyways!
Thank you a lot!
thank you so much for the video HeartBeast! I was wondering if you could make a video on how to make a high score that saves, so Evan when you exit the game your high score will still be saved. thanks!
Save it in a data structure and write it too a INI
Could you also do choose(0, 90, 180, 270) instead of doing irandom(3) and then multiplying by 90?
What if i have 8bit tileset? It actually doesnt work, i tried to set array for all indexes of tiles, but i dont know how to find them later.
thank you for the video
I don't understand how you remember all of this code. : (
Practice. And also they usually have a reference project on the other screen.
It's not necessarily remembering every single line of code, it's just thoroughly understanding the code, so when he wants to write it again, he has the understanding of what to do.
Hes a robot
I'm telling Ariak! (just kidding ^^. Nice video)
Tony Stroemsnaes Ssssshhhhhh!
This Code can be used in Game Maker 1.4 ???
when ever i try to start up the game it says "tilemap_set()couldn't find specified tilemap" and a map wont appear. can you help me?
Question: Is this the new method for making macros in GMS2? You have to make a script and type #macro? Or is this one of the methods you can use to make macros?
Isaiah Butler It is new to GMS 2
Ah okay. Thanks
Will it work with a collision? And play as a top down shooter?
can someone help me stou with a bug in the sound of game maker 2 I select more than once the start button and the sound doubles?
Thank you :)
*YESSSSSSSSSSSS!!!!!!*
What do you mean - can't do in runtime?
How would we go about integrating this into the ARPG course?
Would this system work with a 2d FPS style game like doom?
where do you get the sprites for your games?
Sergei Losing I made these ones. There is a link in the description of you want to download them :)
Can anyone tell me how to random respawn enemies outside the walls? Usually we use place_meeting but this random level generation did not contain a "wall" object. In addition, grid_place_meeting works only if we put a object in argument, which not meet my need because I should pick a x&y to check the collision and then spawn the enemies. Thank you guys
You can add wall objects and use those for collisions instead of tile collision.
Just place a wall in the same loop as the tile placement.
Then you can use the walls to check for an empty space beside themselves and have a chance to spawn an enemy
I bought your course on your website. Are you gonna update that one to the state of the udemy course? because other wise that would be pretty unfair to sell an unfinished course.
Clytax which course? All the courses on my site have the same content as on Udemy.
HeartBeast I meant the rpg course from the thumbnail. I am only 36% through the course, just wanted to make sure that they are the same. Great work btw!
Yup. They will always have the same content :)
HeartBeast and when will the "saving and loading" part come?
seems the system is using the wrong tiles to fill in the floor :/
How do you do at 26:56 to comment all those lines so fast????
mayathemaster control + k
OMG, this is so useful !
I am breaking my head, trying to create one in unity, I love that it is 2d, but adding some shadows and details, it makes me feel that it is 3d.
There is a trick you can do to make it more dungeon like. Every time you change direction you can draw a square room of tiles in-front of direction. Room such as 20 by 20.
why do i keep having diagonal maps, please help me out
Will this series cover the same material as the Gamemaker 1 random generation series?
Pretty much, only it will be much better (using bitwise operators for collisions). Tiles are quite different in GMS 2 and I've gotten lots of questions on my old series, that is why I made this video.
2:46 for people who are not here to learn ;)
could you do a tutorial on enemies attacking from afar please?
Hi HB, I just started trying to code with this video (yes I know this tutorial isn't for beginners but I really wanted to create a bullet hell roguelike) and when I try to run the game at at 21:23 it loads but then comes up with a white code error window that says this:
FATAL ERROR in
action number 1
of Create Event
for object o_level:
Variable o_level.grid_(100005, -2147483648) not set before reading it.
at gml_Object_o_level_Create_0 (line 10) - ds_grid_set_region(grid_, 0, 0, width_, height_, VOID);
stack frame is
gml_Object_o_level_Create_0 (line 10)
I really wanted to get around this. Excuse my noobiness. I'd really like your help! Thank you!
mine don't work... any suggestions?
My level generation is weird:
They often small and their rooms aren't united, I mean there are two rooms with not any ways to unite
x2
2.3 working?
It is for me, but a few tweaks are needed
@@CoffeeAI201 hello :D what sort of tweaks are needed? trying to get it to work and getting pretty stuck would really appreciate some tips if you have time :))
Does anyone know how you would make a randomly generating exit door?
That’s going to take place in the loop.
After you add the wall tiles, set a one time variable to set 1 exit object.
It’ll take place in the same loop as the tile placement
var exit_placed = 0;
in the wall place loop:
var place_object = SOUTH*south_tile + 1
if place_object == 1
{
if place_exit == 0
{
instance_create_layer(x_*CELL_WIDTH+CELL_WIDTH/2,y_*CELL_HEIGHT+CELL_HEIGHT/2,"Level",obj_exit);
place_exit = 1;
}
}
Can you make it in drag and drop version?
what happened to the comment section on your courses?
Am i allowed to use this sprite?
Sooo does it work on the trial? I don’t have the money to buy the full Game maker studio 2
LivelyMehOtaku Z like I said. I don't know. You just have to try it.
Alright I will do that
Good tutorial. Random Generation in Godot please.
Yes please!!
working in gamemaker studio 1.4?
Is it possible to follow along with Game Maker 1?
The first version of this was in GMS1. Check it out: ruclips.net/p/PL9FzW-m48fn2gQVYFxDzq4cz2A4uGWusx
What the difference between irandom and random?
super late but irandom uses integers
Though i want to create one for Platformers
Look, this might have nothing to do with the concept of the video, but for some reason I find it mildly interesting that the video has 1.3k likes and 13 dislikes.
This is awesome, but is it compatible with Game Maker v1.4?
Relja Vasic I have an older version of this series that was done in GMS 1.4
oh alright, thanks for the info
Here is the link to the original series: ruclips.net/video/TZtMNnXFnHE/видео.html
Some things about it are old and could be improved (you could use the code from the old one as a base but then upgrade the collisions and tile logic using bitwise operators and bitmasking)
will do, thanks :)
Oh my gosh.... is your sprite Feghost? xD
Horrendously Tremendous who?
HeartBeast lol, Feghost: he's a youtuber. Big editing guy.
Why you write vars with underscore?
I think that he does it only as a precaution to not have Gamemaker confuse it with some built-in function such as x, y, image_angle, direction, etc:) Vars can't have the same name as built-in functions.
rip grain war
Does anyone remember those old GameMaker RPG tutorials?
Man, that was nostalgic.
Will you make roblox tutorials?
Im a beginner but im just gonna copy this I dont care
sorry not trying to be mean
Pls do one for godot the tutorials for godot is very limited n confusing
16:05
???
this video is complicated
why are all gms2 tutorials so drawn out and annoying, i dont get it,
>doesn't name his events
REEEEEEEEEE
Alexis shady si vez esto respondeme
Aqui estamos.
хех
tooo many
Is it difficult to try to convert the code in Gamemaker studio 2 into code that's compatible with Gamemaker studio 1.4.x? Sorry if this is a stupid question, I just want to be able to use some of these gm2 tutorials.