⚠️ LAG FREE Scrolling in Scratch 🐱 RPG Tutorial Episode 3

Поділитися
Вставка
  • Опубліковано 30 лип 2024
  • In episode 3 of our Scratch RPG tutorial we improve our tile engine to be lag free, fast and efficient even for huge legend of Zelda style maps. To do this we implement a tile viewport, and also optimise the painting to only paint important tiles, and use a background painter to cover the rest of the grass areas. This Scratch tutorial is filled with helpful tips that will help you create the best Scratch Games ever!
    🚀 Boost Your Creativity with Griffpatch
    The Griffpatch Academy will take you from "Gamer to Game Creator"
    Learn more at 👉 griffpatch.academy 👈
    😺 Scratch was developed by the Lifelong Kindergarten Group at the MIT Media Lab. See scratch.mit.edu
    👀 Episodes in the series:
    Ep.1 - Craft your dream Scratch Game - • RPG Tutorial | Craft y...
    Ep.2 - Infinite Scrolling & Tiles - • 🐱 Infinite Scrolling &...
    Ep.3 - I AM SPEED - • ⚠️ LAG FREE Scrolling ...
    Ep. 4 - Build a LEVEL EDITOR in Scratch - • Code a LEVEL EDITOR in...
    Ep. 5 - Split Screen & Multi Tile Assets - • EDIT FASTER ⚡ Tile Tra...
    Ep. 6 - Layers & Onion Skinning - • LAYERS 🧅 "Onion Skinni...
    🐱 Scratch Starter Projects with Assets - Remix this!
    scratch.mit.edu/projects/7255...
    🐱 Scratch Studio for Your projects
    scratch.mit.edu/studios/32038...
    -------------Video Chapters-------------
    0:00 Intro
    0:54 Stamping the tiles within a viewport
    5:52 Expand draw region to fill screen
    8:57 Fence Scrolling Region to Level Size
    11:44 Restore the background
    14:39 Check out this Big Worlds Performance
    15:50 Sprucing up the Map, just a little
    18:38 Outro

КОМЕНТАРІ • 1 тис.

  • @scientistdivitdudegaming1080
    @scientistdivitdudegaming1080 8 місяців тому +20

    Mr. Griffpatch this project was awesome.... Please keep teaching us projects like these. I'm in 6th grade right now. My teacher asked us to make a scratch project..... I made this project and I'm hoping that I will receive an A+ for it.... Once again, thank you for teaching me.

    • @Lawfayette
      @Lawfayette 2 місяці тому

      6th grade is for nerds 🤓

    • @AnmarRaml-hn8de
      @AnmarRaml-hn8de 24 дні тому

      @@Lawfayette get a life

    • @Lawfayette
      @Lawfayette 23 дні тому

      @@AnmarRaml-hn8de life is also for nerds

  • @funut2541
    @funut2541 Рік тому +133

    Good idea to use one variable for width and height. Easy to expand to different values for those who want. Nice and simple for those who don't

    • @utterdonkey
      @utterdonkey Рік тому +5

      What happened to all your videos?

    • @LeReubzRic
      @LeReubzRic Рік тому +2

      The legend is back

    • @BrynGriffithsVideo
      @BrynGriffithsVideo Рік тому +3

      BRING BACK VIDEOS

    • @BombasticTom492
      @BombasticTom492 Рік тому +2

      yooo hi funut

    • @N8-Squared
      @N8-Squared Рік тому +7

      I feel bad because he knows if he reply's or even speaks there will be people asking where his old videos are. I don't disagree but it's still kinda sad.

  • @UltroGmr
    @UltroGmr Рік тому +3

    Thanks for this tutorial! I was able to apply this to a tile engine of my own (that coincidentally worked the EXACT SAME way, even using the exact "cam x/y" variables with the exact same capitalization, but instead it used an "if" condition on EACH TILE to check which ones were on screen, which definitely caused more lag than this)!
    You literally just saved my game for lower end computers (my school Chromebook used to run my terribly-optimized game at 4 frames per second)

  • @KaydenAP
    @KaydenAP Рік тому +9

    In love with this series 💗 part 4 is going to be amazing!

  • @connorclub6244
    @connorclub6244 Рік тому +3

    It was 3 am and I was just getting ready for bed, but as I look at my youtube recommended, I see "LAG FREE Scrolling in Scratch - Griffpatch posted 4 minutes ago". The one thought in my head at that very moment was "4 minutes ago? It's 3 am!" lol

    • @SasakiSatana
      @SasakiSatana Місяць тому

      Do you think he's a REALLY hard-working guy?

  • @l712doesstuff7
    @l712doesstuff7 Рік тому +5

    EPIC! Thank you again- for your awesome tutorial- can't wait for ep. 4!

  • @theblazingspud
    @theblazingspud Рік тому +2

    These tutorials are really awesome! Thanks so much! I can’t wait for episode 4 to come out 😃😃😃

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

    Thanks, I needed help for an rpg andthis is so cool griffpatch! I feel you've outdone yourself at this point!

  • @thethree13o
    @thethree13o Рік тому +2

    yay! i was waiting for this! love your videos as always. Hope your doing well

  • @arc_galaxy7777
    @arc_galaxy7777 Рік тому +56

    Hey Griffpatch, I’ve been a subscriber for a month or two and I just wanted to say thank you for everything you’ve helped me with! Can’t wait for future tutorials and devlogs 😁

    • @griffpatch
      @griffpatch  Рік тому +19

      You are most welcome - glad you enjoy the tutorials!

    • @1080GBA_SC
      @1080GBA_SC Рік тому +3

      @@griffpatch pin that :D

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

      @@griffpatch When can we make enemys

    • @sahildas.
      @sahildas. Рік тому +1

      @@griffpatch I've been a subscriber for 1 year

    • @catgamedev
      @catgamedev Рік тому +2

      @@griffpatch request:i want to make player with trail on scrolling game how to make it? If player still on x:0 y:0

  • @sifugraham2918
    @sifugraham2918 Рік тому +3

    So smooth.. You are awesome for teaching this. Thank you, learned so much.

  • @artemygaming4439
    @artemygaming4439 Рік тому +3

    Thank you for your tutorials, I really enjoyed them!

  • @winman7486
    @winman7486 Рік тому +3

    Your videos are the best, they really helped me learn scratch!😀

  • @FeniteFr
    @FeniteFr Рік тому +15

    I have juste followed the episode 2 This serie is going to be my favourite one ! 😸 This will help me sooo much ! 😻

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

    Once again I'm super excited to get working on this rpg!
    My other project is going well, just needs a few more engaging play features and polish, then I can share it :)

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

    This is the best episode so far! And I believe it will get even better!

  • @fridaee
    @fridaee Рік тому +4

    Thank you so much griffpatch, this is absolutely wonderful!!!

  • @superstargaming642
    @superstargaming642 Рік тому +12

    If you are still experiencing lag you can try clicking into a sprite with little to no code. This will allow scratch to run smoother. It also works if you go to full screen mode or the progect page. The reason this happens is that it renders less scripts while they're running, allowing scratch to use more prosesing power for actually running the project.

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

      or go fullscreen

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

      You can make a sprite called blank and place it in the first place. Thant would be even better

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

      That explains why my unfinished platformer lags when I click into the Player sprite

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

    Griffpatch your videos are awesome! You can create anything in such a easy and basic coding
    Program. Cant wait for the level editor episode!

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

    Oh griffpatch! thanks so much for these awesome tutorials! you always find the best way to do them! awesome work!!

  • @mcl_playz
    @mcl_playz Рік тому +9

    Edit: You always respond super quickly as well, thanks for the heart
    You release educational content so often. I absolutely love your work.
    I remember when I first found your channel, I watched every video on the channel. I think I might be a bit crazy lol.

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

      Aren't we all? I mean, its GRIFFPATCH we're talking about here!

  • @giuseppelucacorreale5843
    @giuseppelucacorreale5843 Рік тому +17

    Griffpatch you will be the first person ever to create an AI that will conquer the world in Scratch

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

      ai in scratch?

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

      ​@@cheesepop7175 It only works like Siri where you need a bunch of keywords so it isn't AI

  • @i-like-walruses
    @i-like-walruses Рік тому

    Griffpatch, your content is AMAZING and I can't wait till the next episode comes out. Keep up the good work and stay strong.

  • @crackerpooppop
    @crackerpooppop Рік тому +3

    Woo hoo! I love seeing a new notification and its a griffpatch video! Keep doing what you are doing! :)

  • @XELLOUGames
    @XELLOUGames Рік тому +5

    I love the fact that this is based of my favourite game the Legend of Zelda! I plan to design the world to look like The legend of zelda's latest game, the open-world Breath of the Wild when the editor comes out! full support on this channel, hope to see it grow to massivie amounts to subs in the future, you have inspired me to code more, griffpatch, keep up the good work!!

  • @mrquethisway
    @mrquethisway Рік тому +5

    The only reason I joined scratch is because of your tutorials. They are simple and fun to follow!

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

    I enjoy this so much! Thanks for making this. 😊

  • @blurrysquire6671
    @blurrysquire6671 Рік тому +2

    Hi, I love the videos! Keep up the good work!

  • @Iminsanealr
    @Iminsanealr Рік тому +3

    This series is amazing! I really want to see the finished game!

  • @jje675
    @jje675 Рік тому +20

    i know its a bit nit picky but calling it the "y eccess" is false because its y is virtcal instead you should name it the z acccess

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

      What?

    • @griffpatch
      @griffpatch  Рік тому +5

      Ha, you may be right... but on a map you would still label them x & y no doubt...

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

      @@griffpatch why?

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

      @@jje675 i think its because the screen is virtcal

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

      It's still a 2d game, no need for a third (z) axis.

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

    Can't wait to see the rpg level editor tutorial! Nice Griffpatch! :D

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

    i was waiting for this :3
    thanks like always

  • @quneptune
    @quneptune Рік тому +7

    really good at scratch but still can't remember how to perfectly ditect colesions
    ⬇️

  • @pfreakadvance3895
    @pfreakadvance3895 Рік тому +11

    Is there any way to make the Tiles appear less distorted or blurry while moving the Player? The grass feels weird while moving and gives a feeling of it being animated but along its black lines inside it but is fine while moving vertically. This happens only in the Normal View and is good in the Full Screen View, so I was curious.

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

      I don't think so. Pretty sure that's just your screen resolution
      EDIT: nevermind, it's most likely your refresh rate 😀

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

      Does it look the same on my video or different to yours?

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

      @@griffpatch I think its mostly the screen resolution as in the video it is always in full screen for our clarity. So I think it might be due to the Normal View in the Scratch editor or something that might have to do with the grass tiles

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

    WOW Im so exited!! Ty for this tutorial Have a Great Day!

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

    Thanks! I did not know how to limit the camera movement. That helped a lot!

  • @jurreverbruggen8542
    @jurreverbruggen8542 Рік тому +3

    I can't wait for the next episode! maybe we're going to make NPC's? Or houses? But i'm sure that it will be fun! Thank you so much for the help! I'm going to play around with the level generation code, so bye! And thanks!
    Edit: I also have a question. Are we gonna add enemies? Because i saw no enemy sprite. (My friend made one for me himself. He made a "Dark Blobfish"!)

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

      we will need a level editor to make the house before we get working houses

  • @cheesepop7175
    @cheesepop7175 Рік тому +3

    fun fact: the scrolling limit glitch at the start was because it tries to position the BIG costume offscreen too far and Scratch's fencing limit stops it

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

      Scratch fencing is a constant wrestling match.

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

    This is very helpful! Griffpatch always teaches me new things whenever I watch his videos

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

    YES! I've been trying to learn how to make an rpg! Thanks! 👍

  • @crackerpooppop
    @crackerpooppop Рік тому +4

    Griffpatch, a bug I noticed is that when you get to the edge of the screen and keep holding down a key, the player x and y keeps moving, so when you try to exit, it takes a while for the player to be able to move out again. :)

    • @griffpatch
      @griffpatch  Рік тому +4

      That's because we have no collision detection yet

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

      @@griffpatchthats true, didn’t think about that

  • @Speed-TV
    @Speed-TV Рік тому +3

    Griffpatch has game theory level video editing!

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

    I love it this game is really coming together!

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

    Griffpatch ive been a subscriber fpr over a month and ive used scratch for over 3 years and i could not get to this level of coding. Thank you for sharing your tutorials, im hoping more will come

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

      Great to hear! - And yes, lots more to come!

  • @Isakube
    @Isakube Рік тому +7

    Notes regarding the Lagbolisher:
    My plan was to just not draw tiles that were offscreen, but that still had the problem of getting stuck at random boundaries.
    Fun fact: That “getting stuck” happens in part because of the perspective we gave ourselves. since our only gauge of where we are in the world is via our tilemap, if the tiles stop scrolling suddenly, it looks like we hit a wall. Now, the only thing in our project thus far that would stop the tiles from moving is….
    Scratch’s fencing limit!
    wait… didn’t we already circumvent this?
    Yes!
    *and also no!*
    The “BIG” sprite still hangs on the edge of the screen if it moves far enough away, so if our first rendered tile is stuck at a certain position, all of the other tiles will be stuck too, giving us the illusion of not being able to move. (granted, you could *try* to set size to 1000%, or change the “big” costume to be “humongous” instead, but that all has a limit at some point.)
    Fun video! Glad it didn’t pull a raycaster episode(tm) where it showed up in the playlist before the release date, endlessly mocking me

  • @MiniRoehAngelMiguel
    @MiniRoehAngelMiguel 4 місяці тому

    This tutorials are SOOOO cool!!! Thank you so much Griffpatch

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

    This is amazing! Time to continue fixing the bug 🛠!

  • @joluni6511
    @joluni6511 Рік тому +3

    i wonder if you are the one to type your captions or is it youtube employees🤔
    because the captions on alot of videos(not nassasarly yours) nolonger feel automated

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

    woah! i really like the intro, its really, "music-y" i guess, but this, this is awesome!

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

    Couldn’t wait, very nice

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

    how can you think such a briiliant idea
    i have watch 3 episides in a row
    excited to make it and vew the result
    hanks buddy

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

    WOWWWW awesome work man, i love it!😍♥♥♥♥♥♥

  • @-EdgeflamePertoshi-
    @-EdgeflamePertoshi- Рік тому

    Thanks! Now i'm using this tutorial for making RPGs!

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

    Thanks for the tutorials. This really helped fix the issues from part 2! Though there is some things I would like to address.
    1. Shouldn't we put back an erase all block somewhere? It seems to be continuously stamping sprites without any erasing in the process. Wouldn't that lead to an overload of stamping at some point? The visuals of the continuous stamping occurs if you remove the stamp block from the background sprite's script.
    2. If you keep moving the player toward the edge of the screen, you eventually get "locked" into the edge for a little bit. I think this happens because we are moving the player at a variable position, which never has a minimum value. Perhaps to create a method to check where the screen stops moving to set these player values like we did with the stage camera values?
    3. In the tiles object, in the define Paint script, is there any difference using ((16) - (180)) which equals to -164, and ((16) - (240)) which equals to -224? If these values is what we get in the calculation, wouldn't it be faster to use these absolute values without it having to process the math for us?
    In any case, thank you for all your tutorials! They are really appreciated! :D

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

    This is very helpful! Thank you Mr. griffpatch!!

  • @bomboverdrive1735
    @bomboverdrive1735 3 місяці тому

    Griffpatch you are my savior without your tutorials i would be toast im making a Pokemon game right now and this map building is a life savor

  • @Tyrio-or-babas
    @Tyrio-or-babas 7 місяців тому +1

    Thx for the tutorial! 😁

  • @literallyaloafofbread
    @literallyaloafofbread 7 місяців тому

    IM IN LOVE WITH THE CONCEPT

  • @enixtwo3366
    @enixtwo3366 Рік тому +2

    Hey Griffpatch, after seeing your first dev log i wanted to create my own rpg without any of your tutorial. Its really interesting how you made things different. Keep on the good work.

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

      Name of the game: Bobbi's adventure V 1.0.0

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

    19:43 anevedublublu 😂
    I love this channel

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

    A nice trick in scratch for getting past the size cap it by making a small sprite and then setting it to the size you want then change it back to the sprite you want. Like the opposite of a big sprite for scrolling off the screen.

  • @user-tz7xu4uu3n
    @user-tz7xu4uu3n Рік тому

    this is amazing bro!!!

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

    My fav scratch tutorial series's new episode is here let's go!

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

    Thank You The Tutorials Griffpatch!

  • @X-step_
    @X-step_ Рік тому

    I love your tutorials! So Cool.

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

    I love this series!

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

    Griffpach i realy like you videos and your content its fantastic and i love it . Im making game for my brother and you realy helped me .

  • @platinumapartmentownersass9164

    You are the best griffpatch. I liked all your videos and I am subscribed too.

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

    I would really love to watch the level editor but I must go to bed cuz its 10 PM...I'm soo excited for the next part!!! 😁

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

    Awsome, as usuall 😃

  • @g4m3zb0y7
    @g4m3zb0y7 Рік тому +2

    this look so cool
    I love it

  • @memetreemapping
    @memetreemapping 7 місяців тому

    Even if i am not following the tutorial, it still is a pleasure to watch and laern as he turns a blank slate into a fully coded project.

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

    Can’t wait for the next episode!

  • @user-el4tt5pd6b
    @user-el4tt5pd6b 6 місяців тому +1

    hey griff i love ur vid they are soo fun and good thx for ur tutorials

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

    Hi, GriffPatch! I'm loving how simple this tutorial is for someone who has never even coded a myspace page. I'm having a great time with it.
    I ran into a weird issue that I cannot seem to resolve. When trying to eliminate wrap on the top and right side. After putting in CamX>GMAX*32-240 Then set CAMX to GMAX *32-240 and same with CAM Y but 180 instead of 240 my entire canvas goes blank and if I pull those bits off then I see my canvas again but I still have the wrap on the top and right side.
    Thank you so much for helping out all the people with a dream to get into making games!

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

    Hooray new episode!

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

    @griffpatch ive been subbed for 4 years love your videos you definitely the best scratch youtuber

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

    i bet griffpatch will influence many future popular game developers from his scratch tutorials, i have no words to describe how cool griffpatch is.

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

    I've always wanted to do this, thank you!

  • @user-zo1mo3yq6y
    @user-zo1mo3yq6y 4 місяці тому

    I found it so fun to design the map after the video!😎

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

    Love IT!!! Can't wait for level design... hopefully it's episode 4??

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

      Maybe, but I think tile collisions should come first. Never know what griffpatch has in mind!

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

    I’m waiting so long hope the next tutorial comes soon😀

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

    Great as always!

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

    Hi griffpatch, loving this series right now in my opinion it might dethrone the tile scrolling series

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

    Awesome tutorial as always. I wonder if you can add wave function collapse algorithm to map generation.

  • @user-kh1nx3uy9g
    @user-kh1nx3uy9g 7 місяців тому

    So much fun!😆

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

    Thanks this really helped!!!!

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

    Waiting for this!!

  • @minecrafterandmoregames9989

    Following this tutorial has been a blast Griffpatch! Love it! Can't wait for the finished result. (By the way, when is episode 4 coming out?)

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

      About to begin work on it... but I expect not this next week as it is going to be a busy one for me sadly, so possibly the week after is more likely.

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

      @@griffpatch ok. I can wait!

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

    Amazing!!

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

    I love your vids! awesome

  • @princemaxi4008
    @princemaxi4008 Рік тому +2

    I did episode 1 and 2 yesterday and 3 today can’t wait for episode 4!!🎉
    Also could you add sounds to the assets?

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

      I need help with moving when the background disappears, I cant fix it myself.

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

    Just letting you know, you are truly the GOD of scratch. I'm literally not even joking. You are the best!

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

    At last. Couldn’t wait :)

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

    OH MY GOSH!!! THIS IS AMAZING!!! ...also when will you make a rocket physics tutorial?

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

    日本人です!
    あなたのスクラッチの作品がとても好きです!
    僕もあなたを目指して頑張ります!
    これからも応援してます!

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

    TY =D I LOVE THIS PROJECT

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

    OMG you already share a new video thanks :D

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

    Awesome exciting!!

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

    Wow, so clever solution!