GameMaker Studio 2 - Random Level Generation

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

Комментарии • 159

  • @uheartbeast
    @uheartbeast  6 лет назад +80

    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 лет назад +164

    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 5 лет назад +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.

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

  • @GameoverGamedev
    @GameoverGamedev 6 лет назад +9

    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

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

  • @bryymiller2475
    @bryymiller2475 Месяц назад

    This will be on interest to me greatly, as I am working on a Dredmore-type game.

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

  • @helderlimaletsgo
    @helderlimaletsgo 6 лет назад +5

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

  • @retropipes8863
    @retropipes8863 6 лет назад

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

  • @petrafye4577
    @petrafye4577 3 года назад

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

  • @henryw4535
    @henryw4535 6 лет назад +3

    Yes! Been waiting for this

  • @Narque
    @Narque 6 лет назад +2

    omg been waiting for this for so long

  • @zyrolupercal2111
    @zyrolupercal2111 6 лет назад +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 ?

  • @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 Год назад

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

  • @Imperium6Divine
    @Imperium6Divine 6 лет назад

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

  • @lucaslabrecque9190
    @lucaslabrecque9190 6 лет назад +8

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

  • @kennethkline7702
    @kennethkline7702 6 лет назад

    Happy to see this in GMS2 :)

  • @danielmyers7593
    @danielmyers7593 5 лет назад +2

    Can you use the "Controller" to place objects?

  • @1nerdsempc67
    @1nerdsempc67 Год назад

    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

  • @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

  • @krishnajawale7418
    @krishnajawale7418 5 лет назад +1

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

  • @mehva7382
    @mehva7382 Год назад +1

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

  • @Red-4man
    @Red-4man 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

  • @thomaswareing2976
    @thomaswareing2976 5 лет назад +1

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

  • @tomgola3
    @tomgola3 2 месяца назад

    Instead of o_level, can I create a script and run the script when needed instead?

  • @aahanimation
    @aahanimation 5 лет назад

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

  • @DarkKnightDad
    @DarkKnightDad 6 лет назад

    Awesome tutorial. Thanks for your effort 😀

  • @soundrogue4472
    @soundrogue4472 4 года назад

    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.

  • @mayathemaster
    @mayathemaster 6 лет назад +1

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

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

  • @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 5 лет назад

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

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

  • @cesarsantana7475
    @cesarsantana7475 5 лет назад

    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?

  • @dereckdiaz4061
    @dereckdiaz4061 3 года назад +1

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

  • @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!

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

  • @warzyl7090
    @warzyl7090 6 лет назад +4

    Come back on game maker ? Amazing !

  • @DionGrimm
    @DionGrimm 6 лет назад

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

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

  • @goudlikeomsi
    @goudlikeomsi 3 года назад

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

  • @Jsharts
    @Jsharts 6 лет назад

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

  • @于致远
    @于致远 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

  • @canibeatit3842
    @canibeatit3842 5 лет назад

    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.

  • @wangsoft
    @wangsoft 6 лет назад

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

  • @hotung5445
    @hotung5445 5 лет назад

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

  • @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

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

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

  • @theonesuperx
    @theonesuperx 6 лет назад +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

  • @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

  • @onion9779
    @onion9779 6 лет назад

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

  • @chrishansen1236
    @chrishansen1236 6 лет назад +2

    Can you make it in drag and drop version?

  • @G_O_J_I
    @G_O_J_I 6 лет назад

    Great tutorial man!!

  • @NeZversSounds
    @NeZversSounds 6 лет назад

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

  • @Julien531
    @Julien531 6 лет назад

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

  • @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!

  • @marvinplayz8847
    @marvinplayz8847 4 года назад

    mine don't work... any suggestions?

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

  • @alexyoung8953
    @alexyoung8953 5 лет назад

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

  • @GermanySups
    @GermanySups 6 лет назад

    Am i allowed to use this sprite?

  • @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: ruclips.net/p/PL9FzW-m48fn2gQVYFxDzq4cz2A4uGWusx

  • @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

  • @samthesoupman6385
    @samthesoupman6385 Год назад

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

  • @MartyScorchedEarthse
    @MartyScorchedEarthse 4 года назад

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

  • @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

  • @angerkun
    @angerkun 6 лет назад

    what happened to the comment section on your courses?

  • @justcore
    @justcore 4 года назад

    working in gamemaker studio 1.4?

  • @that_bean1793
    @that_bean1793 2 года назад

    What the difference between irandom and random?

    • @ianblasco5322
      @ianblasco5322 Год назад +1

      super late but irandom uses integers

  • @tonystroemsnaes554
    @tonystroemsnaes554 6 лет назад +1

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

    • @uheartbeast
      @uheartbeast  6 лет назад +1

      Tony Stroemsnaes Ssssshhhhhh!

  • @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

  • @raspberry_picker395
    @raspberry_picker395 6 лет назад

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

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

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

    • @aceos_
      @aceos_ 6 лет назад

      will do, thanks :)

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

  • @lincolndog6502
    @lincolndog6502 6 лет назад

    Though i want to create one for Platformers

  • @t3597
    @t3597 4 года назад +1

    2.3 working?

    • @CoffeeAI201
      @CoffeeAI201 3 года назад +1

      It is for me, but a few tweaks are needed

    • @saph1987
      @saph1987 3 года назад

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

  • @cyrilgec8491
    @cyrilgec8491 4 года назад

    Thank you a lot!

  • @Samipales
    @Samipales 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

  • @BrentBruthaa
    @BrentBruthaa 6 лет назад

    Thanks Ben!

  • @kaedeharakazuha2003
    @kaedeharakazuha2003 6 лет назад

    thank you for the video

  • @nedjaimes973
    @nedjaimes973 6 лет назад +3

    Good tutorial. Random Generation in Godot please.

  • @reymonb8977
    @reymonb8977 6 лет назад

    Thank you :)

  • @Yisnhbc3688
    @Yisnhbc3688 6 лет назад

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

    • @uheartbeast
      @uheartbeast  6 лет назад

      Horrendously Tremendous who?

    • @Yisnhbc3688
      @Yisnhbc3688 6 лет назад

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

  • @KlausWulfenbach
    @KlausWulfenbach 6 лет назад

    *YESSSSSSSSSSSS!!!!!!*

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

  • @Shaawn743
    @Shaawn743 5 лет назад

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

  • @sora-ec8si
    @sora-ec8si 6 лет назад

    rip grain war

  • @JohnDoe-gb1bc
    @JohnDoe-gb1bc 6 лет назад

    Will you make roblox tutorials?

  • @СергейЛукомский-ю9й

    16:05

  • @AndyHope970
    @AndyHope970 Год назад

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

  • @nizwiz._.5906
    @nizwiz._.5906 6 лет назад +2

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

  • @sahlikh1829
    @sahlikh1829 6 лет назад

    this video is complicated

  • @juggergame354
    @juggergame354 4 года назад

    Alexis shady si vez esto respondeme

  • @sfasy2988
    @sfasy2988 6 лет назад

    хех

  • @anthonywalnutz9801
    @anthonywalnutz9801 6 лет назад +2

    >doesn't name his events
    REEEEEEEEEE

  • @KohniHart
    @KohniHart Год назад +1

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

  • @paperbag3897
    @paperbag3897 3 года назад

    tooo many

  • @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