How to make FPS Counter in Scratch!

  Рет қаралды 38,563

McVincient

McVincient

Күн бұрын

👉In this video, I'll show you how to make an FPS (frames per second) counter in Scratch! Give your feedback in the comments!
⏱Timestamps⏱
0:00 Intro
0:04 Explanation
0:18 Tutorial
2:06 Outro
😍BE A MEMBER TODAY! : - bit.ly/3yvkmXe
👉SUBSCRIBE👈 : - bit.ly/2YXiNS2
Our Studio 🎪 On Scratch (Join For Projects) : - scratch.mit.edu/studios/27307...
👾Discord : - / discord
🦜Twitter Profile : - / mcvincient
😻Scratch Profile : - scratch.mit.edu/users/FANJOUA/
🌍Website : - mcvincientscratch.weebly.com/
🎮Second Channel : - / mcvincient2
😎Scratch Project Review : - • Project Review S2
🕑Shorts : - • Shorts
🔫Top Down Shooter Series : - • Scratch 2D Shooter Game
🖥Scratch OS Series : - • Playlist
🍪Clicker Series : - • Playlist
👨‍Scratch Basics Series : - • Playlist
#indiedev #scratch

Пікірлер: 118
@McVincient
@McVincient Жыл бұрын
If you guys think I've made this tutorial before, YES I have. 3 YEARS AGO. This is a remake (just like the TicTacToe video) and I'll be remaking more *very* old tutorials! (I'm doing this because the old videos are un-bearably bad)
@KONGGAMING12
@KONGGAMING12 Жыл бұрын
mine doesn't work is it because i have scratch addons?
@KatanafiedMC
@KatanafiedMC Жыл бұрын
my opinion: i like your effort to educate the scratch world! it's helpful for everyone! but there's a tutorial for fps count in scratch wiki and that only uses 1 forever loop so it's more stable
@PatheticallyPoorProductions
@PatheticallyPoorProductions 11 ай бұрын
@@KONGGAMING12 I did it a few years ago, (with scratch addons), and it worked???
@JacksonAcademy1
@JacksonAcademy1 Жыл бұрын
0:24: Let's add this dancing "thing". Champ99: 🗿
@McVincient
@McVincient Жыл бұрын
😭😭😂😂
@laalpattharkedevata
@laalpattharkedevata Жыл бұрын
Thanks mr Vincent! I made mine with clones Like this: when green flag clicked: create clone of myself forever { switch costume to (letter 1 of FPS) } when I start as a clone: change x by 15 forever { switch costume to (letter 2 of FPS) } This will make the counter more realistic
@theyinyang6000
@theyinyang6000 Жыл бұрын
The max scratch FPS is 29.97.
@theyinyang6000
@theyinyang6000 Жыл бұрын
THANK YOU SO MUCH FOR THE HEART!
@Exilibr
@Exilibr Жыл бұрын
how do you get 97 hundredths of a frame
@theyinyang6000
@theyinyang6000 Жыл бұрын
Just googled the max framerate of Scratch.
@hyperlaserrebrn
@hyperlaserrebrn Жыл бұрын
@@Exilibr not every frame is sliced equally in to a second
@hyperlaserrebrn
@hyperlaserrebrn Жыл бұрын
some go over, some go under
@-_lIl_-
@-_lIl_- Жыл бұрын
This is actually a genius way to do it, I have done this before using an fps max limit and things and it worked way less well then the way that you have done it
@TobbyTukaywan
@TobbyTukaywan Жыл бұрын
You can get a more accurate FPS reading by putting a "wait (0) secs" in the "change [frame] by (1)" loop
@wongqtr
@wongqtr Жыл бұрын
cool because since it's more accurate, I don't need no limit (for now I guess)
@Car_lover750
@Car_lover750 2 ай бұрын
THANK YOU!!!!
@CheesyV1676
@CheesyV1676 Жыл бұрын
Awesome!
@yastube
@yastube Жыл бұрын
Nicee! This was helpful! Ty for the tutorial:D
@McVincient
@McVincient Жыл бұрын
Glad it helped!!
@edc324
@edc324 8 ай бұрын
you can do more easily if you make a loop and every frame you set a variable the value of the cronometer and then reset it, and then you can just divide the stored value by 1 / value
@user-ff5ee4dn4l
@user-ff5ee4dn4l 6 ай бұрын
super usefull!!
@tigershelf
@tigershelf Жыл бұрын
I feel like you made a video about this already, I got some deja vu...
@McVincient
@McVincient Жыл бұрын
yes I did but as I said some while ago that.. "I'll be remaking old videos" And here it is (idk why ppl didnt notice when I remade TicTacToe tutorial lol)
@jaythecoderx4623
@jaythecoderx4623 8 ай бұрын
Just a few things I wanted to point out quickly: When the number is high, that's because scratch doesn't wait after every loop like it normally does when none of the sprites are moving, effectively putting the project in turbo mode. Capping the FPS counter to 30 is a pretty bad way to deal with that. If you really need to fix that, just add a "set x position to (x position)" block somewhere in the script. Also, it might be a good idea to replace this entire thing with "set [fps] to timer; reset timer". That way your fps counter will update every single frame, and also be more accurate. I spent way too much time writing this comment :|
@McVincient
@McVincient 8 ай бұрын
Why is capping bad?
@jaythecoderx4623
@jaythecoderx4623 8 ай бұрын
@@McVincient There's a lot of situations where you might want to see how much extra performance you have above the fps cap (when turbo mode is on, which effectively uncaps the fps). The higher the number, the faster your code
@McVincient
@McVincient 8 ай бұрын
@@jaythecoderx4623 but scratch caps it automatically when you run any script at all, so for 99% people it doesn't really matter (also avoids confusion for the 8 year old scratch users)
@jaythecoderx4623
@jaythecoderx4623 8 ай бұрын
​@@McVincient If someone's adding an fps counter to their project, I'd assume they already have at least one block somewhere in their project. Capping it does work, it just removes some of the functionality you'd get from an fps counter that at least one person is going to use- but said person probably isn't going to be watching youtube tutorials to figure out how to do it so yeah lol. A realtime fps counter would be nice though Also I have absolutely no idea why I'm writing an essay in the comments of a video tutorial on scratch but uhnsioavgriuvahgrsa
@Karlo645
@Karlo645 Жыл бұрын
Nice.
@easy_play_with_computer
@easy_play_with_computer Жыл бұрын
cool👍
@TWLynx
@TWLynx Жыл бұрын
for some reason the fps is like 100000 and i checked the code and turbowarp or 60fps is not on. Edit: I forgot to put a script in the background nvm
@meehdrescher
@meehdrescher Жыл бұрын
I have a better solution that can update the fps counter for every individual frame, at least for projects that don't use the timer / stopwatch thingy: FPS = 1 / timer value then reset the timer so for example, the timer value after 1 frame is 0.033333... seconds, that equates to 30 FPS, and 0.166666... seconds would be 6 FPS and it also allows you to update the FPS value after every frame instead of every second
@McVincient
@McVincient Жыл бұрын
Nice but mine is versatile
@meehdrescher
@meehdrescher Жыл бұрын
@@McVincient in what way
@jameshulk4
@jameshulk4 Жыл бұрын
@@meehdrescher you can still use the stopwatch
@meehdrescher
@meehdrescher Жыл бұрын
@@jameshulk4 bruh who the hell uses the stopwatch
@sparxstoot
@sparxstoot Жыл бұрын
@@meehdrescher its good for ticks and other stuff that require timing
@_SparkHere
@_SparkHere Жыл бұрын
useful
@user-kufihfmurb
@user-kufihfmurb Жыл бұрын
The cps counter is simple Have the clicks and cps variables And when (put spritename here) clicked Change (clicks) by 1 For the (almost accurate click rate counter) Green flag clicked Forever(infinite repeat) Wait (1) seconds Set (cps) to (clicks) Set (clicks) to 0 +I thinked it by myself
@gamingwithraien4639
@gamingwithraien4639 Жыл бұрын
actually cps is calculate by click/time so if then { change [clicks v] by (1) } set [CPS v] to (clicks/timer)
@user-kufihfmurb
@user-kufihfmurb Жыл бұрын
@@gamingwithraien4639 if I did that,after a few seconds,it would lose its accuracy.
@NokoribiJamaica
@NokoribiJamaica Жыл бұрын
Yesss
@L1M.L4M
@L1M.L4M Жыл бұрын
Noice
@PlanetXson
@PlanetXson Жыл бұрын
I have a question im pretty sure you used to do scratch project reviews will you ever do that again?
@McVincient
@McVincient Жыл бұрын
Yes I will release another episode in March/April I'm kinda busy with my studies and so I cannot upload at all for a while
@Nebula461
@Nebula461 7 күн бұрын
I have a better idea for it reset timer and frame values ever second and set fps to frames/timer
@hseeyz
@hseeyz Жыл бұрын
If the timer resets then, you should just do: Forever set FPS to (1/timer) reset timer If it doesn’t then: Forever set FPS to 1 / (time - oldTime) set oldTime to timer if you hate decimals then use floor
@McVincient
@McVincient Жыл бұрын
Timer is usually used for other things. I purposely didn't want this to be dependent on timer.
@hseeyz
@hseeyz Жыл бұрын
@@McVincient timer actually helps in deciding fps
@ntprograms5589
@ntprograms5589 Жыл бұрын
@@McVincient you can use days since 2000 and do some arithmetic
@wyatt_random
@wyatt_random Жыл бұрын
Me like
@abzcbe
@abzcbe Жыл бұрын
Am I the only one who watches scratch tutorials without following them. Sometimes I follow them tho.
@McVincient
@McVincient Жыл бұрын
I myself didn't really follow the tutorials Just understood the concept by watching them
@LELGasper
@LELGasper 7 ай бұрын
it made my project less laggy
@user-oc7hv6wf2q
@user-oc7hv6wf2q Жыл бұрын
Idea:how to make JSAB in scratch
@Awesomebricks1
@Awesomebricks1 Жыл бұрын
How much did that scratch vs unity short make
@McVincient
@McVincient Жыл бұрын
Less than 1$
@izaanhafid
@izaanhafid Жыл бұрын
what about using turbo mode which sets the fps to 60? if the code makes it so that the maximum amount of frames it can display is 31 then turbo mode will still display the frames as 31 even though the real value is ~60
@McVincient
@McVincient Жыл бұрын
yeah so set it to 60, or just remove the limit cuz it is needed only when there is no script running
@izaanhafid
@izaanhafid Жыл бұрын
​@@McVincient understandable
@LeshaTheBeginner
@LeshaTheBeginner Жыл бұрын
What about Scratch Add-ons, that makes max fps in scratch projects from 30 to 60?
@McVincient
@McVincient Жыл бұрын
Just change the limit to 60
@jimmypoopasin
@jimmypoopasin 11 ай бұрын
@@McVincient I make the FPS counter limit 31 when editing in scratch, and when I publish the game to newgrounds or itch, I make the FPS counter limit 60 before.
@Pyro_azuki
@Pyro_azuki Жыл бұрын
mine is locked on 60 FPS oh i think i know why my extensions
@scratchislifeoriginal
@scratchislifeoriginal Жыл бұрын
But i maked the frame varible to a list and then it has no problems
@McVincient
@McVincient Жыл бұрын
why tho?
@CrispOtto
@CrispOtto 5 ай бұрын
I just discovered that Backpack exists lmao ☠️
@SargunCreations
@SargunCreations Жыл бұрын
Hi. when is the next project review coming. I submitted a project for it.
@McVincient
@McVincient Жыл бұрын
Not before April. I'm sorry, but I have my exams going on.
@SargunCreations
@SargunCreations Жыл бұрын
@@McVincient Oh, best of luck.
@McVincient
@McVincient Жыл бұрын
@@SargunCreations Thankyou!
@averagecodegame
@averagecodegame Жыл бұрын
Just do reset timer, run all of the other code, then set FPS to the rounded value of 1 / timer.
@McVincient
@McVincient Жыл бұрын
I don't want to use timer cuz it might not work for ppl who use it for some other thing in their project
@averagecodegame
@averagecodegame Жыл бұрын
@@McVincient True, it may cause small glitches with little to no code, but if they have at least around 15 blocks, it will work.
@NominalDragon
@NominalDragon Жыл бұрын
Why no one is talking about his old fps tutorial
@McVincient
@McVincient Жыл бұрын
coz its old
@LOL_1243
@LOL_1243 2 ай бұрын
Thx for helping my dumba$$ brain to understand fps
@johndesacada9893
@johndesacada9893 6 ай бұрын
thanks for opera gx for sponsoring this video
@McVincient
@McVincient 5 ай бұрын
????
@heyer777
@heyer777 Жыл бұрын
i think limiting shown number of FPS is bad, it could cause some problems
@McVincient
@McVincient Жыл бұрын
No FPS is just a variable here, so it won't cause any actual problem in the game
@heyer777
@heyer777 Жыл бұрын
@@McVincient ik,but what about dev himself?I think it could cause problems when u need to rely on FPS,and its just not cool to lie to player about FPS?
@McVincient
@McVincient Жыл бұрын
@@heyer777 The limit is not necessary anyway, but I recommended to add it because some games do not have any loops at all, which spikes up FPS to 54000 or more, and to prevent that, you need to put a limit. A dev reliant on the FPS won't face any issues with this, because scratch doesn't run over 30FPS, and the limit being 30, won't let it go over 30 anyway.
@joshuaharrison8013
@joshuaharrison8013 Жыл бұрын
I will make my game at 360 fps
@BombasticTom492
@BombasticTom492 Жыл бұрын
Forever: fps = round(1 / (timer - prevTime)) prevTime = timer
@McVincient
@McVincient Жыл бұрын
Timer cannot be used for this coz most projects have some use of it.
@BombasticTom492
@BombasticTom492 Жыл бұрын
@@McVincient i'm pretty sure that it'll still work unaffected but okay
@BombasticTom492
@BombasticTom492 Жыл бұрын
you could replicate the timer by using the elapsed variable
@smokegaming12898
@smokegaming12898 Жыл бұрын
How to make spider man game in scratch
@McVincient
@McVincient Жыл бұрын
Nice Idea!
@IkaraPopsicle
@IkaraPopsicle Жыл бұрын
ok but what if the game runs in 60fps
@McVincient
@McVincient Жыл бұрын
Set the max to 60
@mitchkiggins9661
@mitchkiggins9661 8 ай бұрын
it keeps saying the fps is 1
@McVincient
@McVincient 8 ай бұрын
Check your code
@Duolingo14215
@Duolingo14215 10 ай бұрын
It was over 3000 fps that's not what I wanted
@McVincient
@McVincient 10 ай бұрын
Run a loop script
@Asrarulhaquejamara106
@Asrarulhaquejamara106 5 ай бұрын
no workt\
@McVincient
@McVincient 5 ай бұрын
Check your code
@bluecoding2506
@bluecoding2506 11 ай бұрын
um why do i have 363285 fps
@McVincient
@McVincient 11 ай бұрын
Cuz no script is running (and also cuz you didn't put the limiter)
@bluecoding2506
@bluecoding2506 11 ай бұрын
@@McVincient It Happened At The Start Then It Became a Normal 20/30 FPS
@andreiinthedesktopworld1178
@andreiinthedesktopworld1178 Жыл бұрын
I don't like limits on FPS... I want smoooooooooooth
@McVincient
@McVincient Жыл бұрын
Bruh it's the limit on the VARIABLE FPS, not the ACTUAL FPS And we're putting it for more accurate readings
@NominalDragon
@NominalDragon Жыл бұрын
I am going to make a 3D game without using Pen Or Clones
@elijah44gd79
@elijah44gd79 Жыл бұрын
@Dynamix624 its probally possible using a lot of sprites
@NominalDragon
@NominalDragon Жыл бұрын
@@elijah44gd79 I will use clones sorry
@NominalDragon
@NominalDragon Жыл бұрын
@Dynamix624 I will use clones sorry
@McVincient
@McVincient Жыл бұрын
Nice!!
@McVincient
@McVincient Жыл бұрын
bruh
TOP 10 SCRATCH HACKS !
6:13
SL Smart Mind
Рет қаралды 437 М.
How to FIX ALL SCRATCH BUGS! (and more!)
4:51
McVincient
Рет қаралды 101 М.
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 5 МЛН
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 14 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 10 МЛН
How to make MOUSE DODGING Game in Scratch!
8:09
McVincient
Рет қаралды 34 М.
Top 5 MIND-BLOWING Scratch Algorithms!
6:04
McVincient
Рет қаралды 38 М.
Scratch 3D Engines in under 3 minutes
2:33
Jackson Clayton
Рет қаралды 75 М.
Scratch INTERNET Detector 🌐🌐🌐 Tutorial
2:14
The STEAMist
Рет қаралды 126 М.
Top 5 MIND-BLOWING Scratch Games! 🤯
4:11
McVincient
Рет қаралды 7 М.
How I Made a 3D Platformer in 2D Game Engine
21:23
ggenije
Рет қаралды 448 М.
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
How I Make Videos for Programmers (on Fireship.io)
9:03
Jeff Delaney
Рет қаралды 432 М.
The World's MOST OVERPOWERED Scratch Mod!
7:16
ProjectLabs
Рет қаралды 79 М.
Top 10 Most MIND-BLOWING Scratch Projects
8:11
ZonxScratch
Рет қаралды 166 М.