GameMaker Studio 2 - Random Level Generation

Поділитися
Вставка
  • Опубліковано 22 лют 2018
  • For more GameMaker Tutorials and Courses: learn.heartbeast.co
    Sprites: www.dropbox.com/s/nxg6n4vw621...
    Old GMS 1.4 version of this series: • [GameMaker Tutorial] R...
    /r/GameMaker Discord GitHub: gamemakerdiscord.github.io/
    Bitmasking: gamedevelopment.tutsplus.com/...
    Grid Data Structures: docs2.yoyogames.com/source/_b...
    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!
  • Навчання та стиль

КОМЕНТАРІ • 157

  • @uheartbeast
    @uheartbeast  6 років тому +79

    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 :)

    • @LeroyCochlovius
      @LeroyCochlovius 6 років тому +1

      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???

    • @iambluepixel4772
      @iambluepixel4772 6 років тому

      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!

    • @lp7814
      @lp7814 5 років тому +1

      can you send me the code of this game ?

  • @DYLwat100
    @DYLwat100 6 років тому +160

    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!

    • @jdmaine51084
      @jdmaine51084 4 роки тому +10

      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.

  • @krzysztofgrzybowski396
    @krzysztofgrzybowski396 6 років тому +4

    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 :)

  • @FriendlyCosmonaut
    @FriendlyCosmonaut 6 років тому +80

    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 :)

  • @LPgamedev
    @LPgamedev 6 років тому +8

    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

  • @retropipes8863
    @retropipes8863 6 років тому

    Oh yes! Am I ever glad this is posted. Thank you!

  • @Imperium6Divine
    @Imperium6Divine 6 років тому

    I love your videos and buy your courses to support you! Continue the great work.

  • @henryw4535
    @henryw4535 6 років тому +3

    Yes! Been waiting for this

  • @Narque
    @Narque 6 років тому +2

    omg been waiting for this for so long

  • @petrafye4577
    @petrafye4577 2 роки тому

    You are genuinely a kind and generous person, Ben!
    Thank you for all the content, and informative knowledge you've made so readily available!

  • @helderlimaletsgo
    @helderlimaletsgo 6 років тому +5

    Good Lord Ben, you should be hired by Yoyo Games already, your videos are awesome!

  • @kennethkline7702
    @kennethkline7702 6 років тому

    Happy to see this in GMS2 :)

  • @krishnajawale7418
    @krishnajawale7418 5 років тому +1

    Great tutorial! this helped me a lot with my roguelike game :)

  • @DarkKnightDad
    @DarkKnightDad 6 років тому

    Awesome tutorial. Thanks for your effort 😀

  • @G_O_J_I
    @G_O_J_I 6 років тому

    Great tutorial man!!

  • @ZoidbergForPresident
    @ZoidbergForPresident 6 років тому +5

    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! :)

  • @zyrolupercal2111
    @zyrolupercal2111 5 років тому +4

    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 ?

  • @DionGrimm
    @DionGrimm 6 років тому

    Just in time to help me with my project! :D

  • @aahanimation
    @aahanimation 4 роки тому

    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..

  • @thomaswareing2976
    @thomaswareing2976 4 роки тому +1

    Hi thanks for the tutorial, what variables would I change to make it 64 by 64 instead of 32?

  • @matthewstephen1257
    @matthewstephen1257 6 років тому

    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.

  • @lang_games
    @lang_games 6 років тому

    Will you be adding a way to save these random levels in the future? Great tutorial, thanks!

  • @tristanwilliams7208
    @tristanwilliams7208 5 років тому

    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?

  • @danielmyers7593
    @danielmyers7593 5 років тому +2

    Can you use the "Controller" to place objects?

  • @BrentBruthaa
    @BrentBruthaa 6 років тому

    Thanks Ben!

  • @Jsharts
    @Jsharts 6 років тому

    How would we go about integrating this into the ARPG course?

  • @cesarsantana7475
    @cesarsantana7475 4 роки тому

    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?

  • @cyrilgec8491
    @cyrilgec8491 4 роки тому

    Thank you a lot!

  • @kaedeharakazuha2003
    @kaedeharakazuha2003 6 років тому

    thank you for the video

  • @unknownclement6557
    @unknownclement6557 3 роки тому

    Will it work with a collision? And play as a top down shooter?

  • @onion9779
    @onion9779 6 років тому

    Would this system work with a 2d FPS style game like doom?

  • @wynniechan3366
    @wynniechan3366 2 роки тому +4

    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!

    • @wynniechan3366
      @wynniechan3366 2 роки тому +2

      I figured it out, I am happy and shall continue with my game.

    • @tctrax
      @tctrax 9 місяців тому

      ​@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.

  • @canibeatit3842
    @canibeatit3842 4 роки тому

    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.

  • @nickoliedanielson
    @nickoliedanielson 2 роки тому +3

    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.

  • @jdmaine51084
    @jdmaine51084 4 роки тому

    Could you also do choose(0, 90, 180, 270) instead of doing irandom(3) and then multiplying by 90?

  • @SERVACgamesstarykanal
    @SERVACgamesstarykanal 3 роки тому

    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.

  • @reymonb8977
    @reymonb8977 6 років тому

    Thank you :)

  • @1nerdsempc67
    @1nerdsempc67 9 місяців тому

    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

  • @lucaslabrecque9190
    @lucaslabrecque9190 6 років тому +8

    for the moment it's working with the trial version of Game Maker

  • @NeZversSounds
    @NeZversSounds 6 років тому

    What do you mean - can't do in runtime?

  • @dookillyou1546
    @dookillyou1546 6 років тому

    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!

  • @Julien531
    @Julien531 6 років тому

    could you do a tutorial on enemies attacking from afar please?

  • @wmelon6015
    @wmelon6015 5 років тому +3

    Its awesome !Could you show how to create a random generation like in the terraria?
    P.S ty for your lessons

  • @hotung5445
    @hotung5445 5 років тому

    why do i keep having diagonal maps, please help me out

  • @chelseyld2009
    @chelseyld2009 2 роки тому +1

    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

  • @GermanySups
    @GermanySups 6 років тому

    Am i allowed to use this sprite?

  • @remdem622
    @remdem622 6 років тому +1

    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!

    • @TheCivildecay
      @TheCivildecay 6 років тому

      Save it in a data structure and write it too a INI

  • @warzyl7090
    @warzyl7090 6 років тому +4

    Come back on game maker ? Amazing !

  • @soundrogue4472
    @soundrogue4472 3 роки тому

    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.

  • @sergeilosing7263
    @sergeilosing7263 6 років тому +1

    where do you get the sprites for your games?

    • @uheartbeast
      @uheartbeast  6 років тому +1

      Sergei Losing I made these ones. There is a link in the description of you want to download them :)

  • @dereckdiaz4061
    @dereckdiaz4061 3 роки тому +1

    This Code can be used in Game Maker 1.4 ???

  • @matthewstephen1257
    @matthewstephen1257 6 років тому +2

    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.

    • @clarkjarcus
      @clarkjarcus 6 років тому +1

      He already made a similar procedural generation tutorial some time ago for GameMaker: Studio 1.x, so you could just use that.

    • @raspberry_picker395
      @raspberry_picker395 6 років тому

      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

    • @raspberry_picker395
      @raspberry_picker395 6 років тому

      Most of the code is the same btw, 95% of it works

    • @matthewstephen1257
      @matthewstephen1257 6 років тому +1

      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.

    • @raspberry_picker395
      @raspberry_picker395 6 років тому

      Matthew Stephen no problem ;) good luck with your project

  • @gjallar8329
    @gjallar8329 6 років тому

    Will this series cover the same material as the Gamemaker 1 random generation series?

    • @uheartbeast
      @uheartbeast  6 років тому

      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.

  • @KlausWulfenbach
    @KlausWulfenbach 6 років тому

    *YESSSSSSSSSSSS!!!!!!*

  • @jiaska3889
    @jiaska3889 6 років тому

    Is it possible to follow along with Game Maker 1?

    • @KlausWulfenbach
      @KlausWulfenbach 6 років тому

      The first version of this was in GMS1. Check it out: ua-cam.com/play/PL9FzW-m48fn2gQVYFxDzq4cz2A4uGWusx.html

  • @chrishansen1236
    @chrishansen1236 6 років тому +2

    Can you make it in drag and drop version?

  • @justcore
    @justcore 4 роки тому

    working in gamemaker studio 1.4?

  • @SilverSpectre266
    @SilverSpectre266 6 років тому

    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?

  • @mehva7382
    @mehva7382 Рік тому +1

    this isnt working for me. idk why.
    I dont get any errors it just dont show the tiles :(

  • @user-zz2nl4bw6i
    @user-zz2nl4bw6i 4 роки тому

    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

    • @CoffeeAI201
      @CoffeeAI201 3 роки тому +1

      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

  • @mayathemaster
    @mayathemaster 6 років тому +1

    How do you do at 26:56 to comment all those lines so fast????

  • @marvinplayz8847
    @marvinplayz8847 4 роки тому

    mine don't work... any suggestions?

  • @MartyScorchedEarthse
    @MartyScorchedEarthse 3 роки тому

    I did not understand much but I will save this vid for later

  • @helloward9759
    @helloward9759 6 років тому +2

    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.

    • @DerDave0
      @DerDave0 4 роки тому

      Two years late, but did you find out? :D

  • @fingerlickinhood6131
    @fingerlickinhood6131 6 років тому +1

    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!

  • @Clytax
    @Clytax 6 років тому

    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.

    • @uheartbeast
      @uheartbeast  6 років тому

      Clytax which course? All the courses on my site have the same content as on Udemy.

    • @Clytax
      @Clytax 6 років тому

      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!

    • @uheartbeast
      @uheartbeast  6 років тому

      Yup. They will always have the same content :)

    • @Clytax
      @Clytax 6 років тому

      HeartBeast and when will the "saving and loading" part come?

  • @TheMrGuachon
    @TheMrGuachon 6 років тому

    Why you write vars with underscore?

    • @simonjakobsson1004
      @simonjakobsson1004 6 років тому

      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.

  • @lincolndog6502
    @lincolndog6502 6 років тому

    Though i want to create one for Platformers

  • @angerkun
    @angerkun 6 років тому

    what happened to the comment section on your courses?

  • @alexyoung8953
    @alexyoung8953 4 роки тому

    Does anyone know how you would make a randomly generating exit door?

    • @CoffeeAI201
      @CoffeeAI201 3 роки тому

      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

    • @nathaniel6465
      @nathaniel6465 2 роки тому

      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;
      }
      }

  • @lively2774
    @lively2774 6 років тому

    Sooo does it work on the trial? I don’t have the money to buy the full Game maker studio 2

    • @uheartbeast
      @uheartbeast  6 років тому

      LivelyMehOtaku Z like I said. I don't know. You just have to try it.

    • @lively2774
      @lively2774 6 років тому

      Alright I will do that

  • @tonystroemsnaes554
    @tonystroemsnaes554 6 років тому +1

    I'm telling Ariak! (just kidding ^^. Nice video)

    • @uheartbeast
      @uheartbeast  6 років тому +1

      Tony Stroemsnaes Ssssshhhhhh!

  • @samthesoupman6385
    @samthesoupman6385 Рік тому

    seems the system is using the wrong tiles to fill in the floor :/

  • @Ninololcss
    @Ninololcss 6 років тому +2

    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

  • @that_bean1793
    @that_bean1793 2 роки тому

    What the difference between irandom and random?

    • @ianblasco5322
      @ianblasco5322 Рік тому +1

      super late but irandom uses integers

  • @theonesuperx
    @theonesuperx 5 років тому +4

    I don't understand how you remember all of this code. : (

    • @chowdog8184
      @chowdog8184 5 років тому +2

      Practice. And also they usually have a reference project on the other screen.

    • @BlazertronGames
      @BlazertronGames 5 років тому +5

      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.

    • @juanybcruz
      @juanybcruz 4 роки тому

      Hes a robot

  • @aceos_
    @aceos_ 6 років тому

    This is awesome, but is it compatible with Game Maker v1.4?

    • @uheartbeast
      @uheartbeast  6 років тому

      Relja Vasic I have an older version of this series that was done in GMS 1.4

    • @aceos_
      @aceos_ 6 років тому

      oh alright, thanks for the info

    • @uheartbeast
      @uheartbeast  6 років тому

      Here is the link to the original series: ua-cam.com/video/TZtMNnXFnHE/v-deo.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)

    • @aceos_
      @aceos_ 6 років тому

      will do, thanks :)

  • @sora-ec8si
    @sora-ec8si 6 років тому

    rip grain war

  • @nedjaimes973
    @nedjaimes973 6 років тому +3

    Good tutorial. Random Generation in Godot please.

  • @narulan9325
    @narulan9325 6 років тому +1

    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

  • @JohnDoe-gb1bc
    @JohnDoe-gb1bc 6 років тому

    Will you make roblox tutorials?

  • @loukiaagoudemos3680
    @loukiaagoudemos3680 6 років тому

    Oh my gosh.... is your sprite Feghost? xD

    • @uheartbeast
      @uheartbeast  6 років тому

      Horrendously Tremendous who?

    • @loukiaagoudemos3680
      @loukiaagoudemos3680 6 років тому

      HeartBeast lol, Feghost: he's a youtuber. Big editing guy.

  • @t3597
    @t3597 3 роки тому +1

    2.3 working?

    • @CoffeeAI201
      @CoffeeAI201 3 роки тому +1

      It is for me, but a few tweaks are needed

    • @saph1987
      @saph1987 2 роки тому

      @@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 :))

  • @samuelgraus1927
    @samuelgraus1927 3 роки тому +2

    I dot care its not for beginers I will copy entire code step by step.

    • @lemonamon
      @lemonamon Рік тому

      ik im late but you wont learn anything by just copying m8

  • @jeffersonromario5936
    @jeffersonromario5936 4 роки тому +1

    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.

    • @nickgennady
      @nickgennady 3 роки тому

      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.

  • @raspberry_picker395
    @raspberry_picker395 6 років тому

    2:46 for people who are not here to learn ;)

  • @nizwiz._.5906
    @nizwiz._.5906 6 років тому +2

    Does anyone remember those old GameMaker RPG tutorials?
    Man, that was nostalgic.

  • @Shaawn743
    @Shaawn743 4 роки тому

    Pls do one for godot the tutorials for godot is very limited n confusing

  • @m1bl4n
    @m1bl4n 4 роки тому

    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.

  • @user-gr5ql2hi2h
    @user-gr5ql2hi2h 3 роки тому

    16:05

  • @sfasy2988
    @sfasy2988 5 років тому

    хех

  • @sahlikh1829
    @sahlikh1829 6 років тому

    this video is complicated

  • @AndyHope970
    @AndyHope970 10 місяців тому

    Im a beginner but im just gonna copy this I dont care

    • @AndyHope970
      @AndyHope970 10 місяців тому

      sorry not trying to be mean

  • @juggergame354
    @juggergame354 4 роки тому

    Alexis shady si vez esto respondeme

  • @anthonywalnutz9801
    @anthonywalnutz9801 5 років тому +2

    >doesn't name his events
    REEEEEEEEEE

  • @paperbag3897
    @paperbag3897 2 роки тому

    tooo many

  • @KohniHart
    @KohniHart 10 місяців тому +1

    why are all gms2 tutorials so drawn out and annoying, i dont get it,