⚠️ 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
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.
6th grade is for nerds 🤓
@@Lawfayette get a life
@@AnmarRaml-hn8de life is also for nerds
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
What happened to all your videos?
The legend is back
BRING BACK VIDEOS
yooo hi funut
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.
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)
In love with this series 💗 part 4 is going to be amazing!
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
Do you think he's a REALLY hard-working guy?
EPIC! Thank you again- for your awesome tutorial- can't wait for ep. 4!
You're very welcome!
These tutorials are really awesome! Thanks so much! I can’t wait for episode 4 to come out 😃😃😃
Thanks, I needed help for an rpg andthis is so cool griffpatch! I feel you've outdone yourself at this point!
yay! i was waiting for this! love your videos as always. Hope your doing well
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 😁
You are most welcome - glad you enjoy the tutorials!
@@griffpatch pin that :D
@@griffpatch When can we make enemys
@@griffpatch I've been a subscriber for 1 year
@@griffpatch request:i want to make player with trail on scrolling game how to make it? If player still on x:0 y:0
So smooth.. You are awesome for teaching this. Thank you, learned so much.
Thank you for your tutorials, I really enjoyed them!
Your videos are the best, they really helped me learn scratch!😀
I have juste followed the episode 2 This serie is going to be my favourite one ! 😸 This will help me sooo much ! 😻
Thanks great to hear :)
I agree
juste
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 :)
This is the best episode so far! And I believe it will get even better!
Thank you so much griffpatch, this is absolutely wonderful!!!
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.
or go fullscreen
You can make a sprite called blank and place it in the first place. Thant would be even better
That explains why my unfinished platformer lags when I click into the Player sprite
Griffpatch your videos are awesome! You can create anything in such a easy and basic coding
Program. Cant wait for the level editor episode!
Oh griffpatch! thanks so much for these awesome tutorials! you always find the best way to do them! awesome work!!
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.
Aren't we all? I mean, its GRIFFPATCH we're talking about here!
Griffpatch you will be the first person ever to create an AI that will conquer the world in Scratch
ai in scratch?
@@cheesepop7175 It only works like Siri where you need a bunch of keywords so it isn't AI
Griffpatch, your content is AMAZING and I can't wait till the next episode comes out. Keep up the good work and stay strong.
Woo hoo! I love seeing a new notification and its a griffpatch video! Keep doing what you are doing! :)
Yay, thank you!
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!!
Sounds like an amazing plan, can't wait to see how it turns out!
Thx for the support!😃😃😃
how can u make it 2d
The only reason I joined scratch is because of your tutorials. They are simple and fun to follow!
I enjoy this so much! Thanks for making this. 😊
Hi, I love the videos! Keep up the good work!
This series is amazing! I really want to see the finished game!
Me too :)
@@griffpatch how abut you not use that “:” for the face but use “=” for the face
@@nothingforchannelnamenumbers Let me try =)
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
What?
Ha, you may be right... but on a map you would still label them x & y no doubt...
@@griffpatch why?
@@jje675 i think its because the screen is virtcal
It's still a 2d game, no need for a third (z) axis.
Can't wait to see the rpg level editor tutorial! Nice Griffpatch! :D
i was waiting for this :3
thanks like always
really good at scratch but still can't remember how to perfectly ditect colesions
⬇️
We'll get there!
you do it by detecting collisions
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.
I don't think so. Pretty sure that's just your screen resolution
EDIT: nevermind, it's most likely your refresh rate 😀
Does it look the same on my video or different to yours?
@@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
WOW Im so exited!! Ty for this tutorial Have a Great Day!
Thanks! I did not know how to limit the camera movement. That helped a lot!
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"!)
we will need a level editor to make the house before we get working houses
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
Scratch fencing is a constant wrestling match.
This is very helpful! Griffpatch always teaches me new things whenever I watch his videos
YES! I've been trying to learn how to make an rpg! Thanks! 👍
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. :)
That's because we have no collision detection yet
@@griffpatchthats true, didn’t think about that
Griffpatch has game theory level video editing!
True, True
I love it this game is really coming together!
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
Great to hear! - And yes, lots more to come!
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
This tutorials are SOOOO cool!!! Thank you so much Griffpatch
This is amazing! Time to continue fixing the bug 🛠!
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
i've been noticing that too
I make all my own captions
woah! i really like the intro, its really, "music-y" i guess, but this, this is awesome!
Couldn’t wait, very nice
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
WOWWWW awesome work man, i love it!😍♥♥♥♥♥♥
Thanks! Now i'm using this tutorial for making RPGs!
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
In getting the same issue
This is very helpful! Thank you Mr. griffpatch!!
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
Thx for the tutorial! 😁
IM IN LOVE WITH THE CONCEPT
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.
Name of the game: Bobbi's adventure V 1.0.0
19:43 anevedublublu 😂
I love this channel
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.
this is amazing bro!!!
My fav scratch tutorial series's new episode is here let's go!
Thank You The Tutorials Griffpatch!
I love your tutorials! So Cool.
I love this series!
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 .
You are the best griffpatch. I liked all your videos and I am subscribed too.
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!!! 😁
Awsome, as usuall 😃
this look so cool
I love it
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.
Can’t wait for the next episode!
hey griff i love ur vid they are soo fun and good thx for ur tutorials
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!
same happened to me pls yell how to resolve the issue
Hooray new episode!
@griffpatch ive been subbed for 4 years love your videos you definitely the best scratch youtuber
i bet griffpatch will influence many future popular game developers from his scratch tutorials, i have no words to describe how cool griffpatch is.
I've always wanted to do this, thank you!
Any time!
@@griffpatch thanks
I found it so fun to design the map after the video!😎
Love IT!!! Can't wait for level design... hopefully it's episode 4??
Maybe, but I think tile collisions should come first. Never know what griffpatch has in mind!
I’m waiting so long hope the next tutorial comes soon😀
Great as always!
Thanks a lot :)
Hi griffpatch, loving this series right now in my opinion it might dethrone the tile scrolling series
Awesome tutorial as always. I wonder if you can add wave function collapse algorithm to map generation.
So much fun!😆
Thanks this really helped!!!!
Waiting for this!!
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?)
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.
@@griffpatch ok. I can wait!
Amazing!!
I love your vids! awesome
I did episode 1 and 2 yesterday and 3 today can’t wait for episode 4!!🎉
Also could you add sounds to the assets?
I need help with moving when the background disappears, I cant fix it myself.
Just letting you know, you are truly the GOD of scratch. I'm literally not even joking. You are the best!
At last. Couldn’t wait :)
OH MY GOSH!!! THIS IS AMAZING!!! ...also when will you make a rocket physics tutorial?
Sounds fun :) - Tell me more
日本人です!
あなたのスクラッチの作品がとても好きです!
僕もあなたを目指して頑張ります!
これからも応援してます!
TY =D I LOVE THIS PROJECT
OMG you already share a new video thanks :D
Awesome exciting!!
Wow, so clever solution!