What Roblox Doesn't Tell You | Roblox Studio

  Рет қаралды 33,046

Stewiepfing

Stewiepfing

Күн бұрын

Пікірлер: 110
@stewiepfing539
@stewiepfing539 8 ай бұрын
Optimize the amount of memory your using!!
@workindad
@workindad 8 ай бұрын
That :Once is interesting. You can use that for day/night cycle when the first player enters on a new server so that everyone is sync'd or perhaps when there's a timer on how long a server has been online.
@1Teb
@1Teb 8 ай бұрын
Wrong your
@ProSureString
@ProSureString 8 ай бұрын
@@1Tebyou’re* wrong
@Kitsune_Dev
@Kitsune_Dev 8 ай бұрын
@@workindadyou can use modulus operator with a shared timestamp value
@enpiesie
@enpiesie 8 ай бұрын
​@@workindad I was really surprised when I saw :Once() existed. Usually I just use connect and then disconnect it when I'm done. this is so useful
@pingolein
@pingolein 8 ай бұрын
most of the roblox scripting content creators don't teach about optimization and more unknown functions / features, Keep up the great work!
@detsuk1
@detsuk1 7 ай бұрын
"if you really don't know about programming, become a programming youtuber"
@II-oh8eq
@II-oh8eq 9 күн бұрын
is there anyone who you know does?
@berendberend702
@berendberend702 8 ай бұрын
Great tutorial! One thing to keep in mind is that roblox automatically cleans up memory from variables that are no longer in use, so you don't have to manually do variable = nil (although this will free up the memory faster than roblox's automatic garbage collection afaik). As for the last part of the video, roblox now automatically destroys players and characters (previously an option called PlayerCharacterDestroyBehavior).
@mathesimard
@mathesimard 8 ай бұрын
I totally agree. I think this is definitely a thing they should fix as it may cause a decent amount of lag/delay on low-end or also called potato devices. I am a scripter myself and I totally agree with you.
@ExplyDev
@ExplyDev 8 ай бұрын
Disagree
@mathesimard
@mathesimard 7 ай бұрын
@@ExplyDev Why?
@nicraftstudios0
@nicraftstudios0 8 ай бұрын
Meanwhile me with hundreds of poorly optimized loops constantly running at the same time: hm I wonder why my game’s so laggy
@_demosthenes
@_demosthenes 8 ай бұрын
you don't need to manually destroy the players or characters, afaik that issue only happened with characters and it has since been fixed. just manage your event connections and avoid globals, lua is a high level interpreted language anyways so it's always going to have some performance issues or lack of fine control of memory
@Martinchi
@Martinchi 8 ай бұрын
Great video! I'm relatively new to scripting, though I've been on the platform for the better part of 13 years, and optimization in my opinion is heavily neglected (judging by the lack of tutorials or videos that speak about it). This was quite informative, keep it up.
@cargonewjeanz
@cargonewjeanz 8 ай бұрын
how and when did you learn how to script
@ImNot_Nightmare
@ImNot_Nightmare 8 ай бұрын
Great example of a memory leak is parkour reborn
@vrfrenzy8451
@vrfrenzy8451 4 ай бұрын
ty, optimisation needs to be focused on by more people
@JohanildPG
@JohanildPG 7 ай бұрын
Actually very useful, thanks!
@norepinafrina
@norepinafrina 7 ай бұрын
As a expl. script dev, doing these will strongly optimise it. Most scripts are laggy and unoptimised, funny
@epic_devz
@epic_devz 8 ай бұрын
This was really helpful, Thanks!
@Duck-King
@Duck-King 4 ай бұрын
Hello, why did you say at 3:53 that nil takes more memory than 0? I think your statement is false because nil is just nothingness while 0 is something. But if what you said is true then please clarify.
@hayden2638
@hayden2638 8 ай бұрын
It's pretty useful to know this, although for small games it won't make a huge difference, but for big projects it sure will.
@DynoDeso
@DynoDeso 7 ай бұрын
It will make a pretty big difference. If it's a small game and these connections are constantly being made and not created then the memory usage will keep piling up
@firepalmmy5933
@firepalmmy5933 8 ай бұрын
Title: what roblox doesn't tell you in video: roblox also says that clearing up tables when they are no longer needed is another way of optimizing
@stewiepfing539
@stewiepfing539 8 ай бұрын
Yeah roblox doesn’t tell you about memory optimization but they still have documentation 🤡
@firepalmmy5933
@firepalmmy5933 8 ай бұрын
@@stewiepfing539 could you make a video explaining all tabs in developer console: memory, network, etc.
@AleyzRo
@AleyzRo 8 ай бұрын
dusty trip is an example, it fr crashed my roblox when i wanted to go in a round💀 (sometimes)
@jujhar.
@jujhar. 7 ай бұрын
I love running thousands of unnecessary loops at once 😊😊😊
@KashTheKingYT
@KashTheKingYT 8 ай бұрын
nice, you should make a video about luau compiling and how roblox optimizes your script on compile time
@jujhar.
@jujhar. 7 ай бұрын
Kash 🤑🤑🤑
@didymos03
@didymos03 8 ай бұрын
Didn't know about this. I just started making my own game. Thanks for the tut.
@thedrogba246
@thedrogba246 8 ай бұрын
just use maid, trove or janitor and you are good, disconnecting stuff is time consuming those modules do that for you, never heard of destroying the character on leave, but that's just a visual thing, their character will stay there for 2-3 seconds but the character will be removed anyways
@chibisayori20
@chibisayori20 8 ай бұрын
I think people confuse removing the character in studio within the client window Because studio is both the server and the client, some issues can occur that might not occur on a live game.
@zenstarz2406
@zenstarz2406 7 ай бұрын
far too much unnecessary bloat from some of those modules you are recommending when you could really just make a table containing all things that are planned to be cleaned up and iterate through them later on
@chibisayori20
@chibisayori20 7 ай бұрын
@@zenstarz2406 or make a module script, call it Globals or smth and cram all your utility functions and constants inside it.
@ufoulroo2035
@ufoulroo2035 8 ай бұрын
3:00 the assistant is so annoying when trying to code 😂
@AlreadyCode
@AlreadyCode 8 ай бұрын
fr. you can get rid of it though
@NurJoel
@NurJoel 8 ай бұрын
yeah it sometimes stresses me because ik when those three loading points finished there'll be a code. And then it distracts me from what I wanted to code
@jujhar.
@jujhar. 7 ай бұрын
Yeah, I know what I wanna write it just starts going *. . .*
@NurJoel
@NurJoel 7 ай бұрын
@@jujhar. Isn't there a way you ca turn it off?
@restartartyt
@restartartyt 2 ай бұрын
@NurJoel Go to FILE > Studio Settings > Script Editor then find the Code Assist topic then disable auto-trigger Code Assist (self-explanatory) Now you can still trigger it using Alt + \ or Option + \
@bebra3392
@bebra3392 7 ай бұрын
Ofc roblox's max amount of memory is "6.9" GB
@frbestguy
@frbestguy 2 ай бұрын
Thats still alot considering theres ALOT of games on roblox, no?
@bebra3392
@bebra3392 2 ай бұрын
@@frbestguy I mean the funi number
@cool_roblox_guy
@cool_roblox_guy 3 ай бұрын
roblox doesnt always crash when using more than 7gb of ram, hell parkour reborn when v1.3 released managed to use 12gb on my system before i had to force close it so my pc wouldnt crash
@MOHA_1484.
@MOHA_1484. 8 ай бұрын
Bro I was like I will learn scripting I alreaddy saw some vedios but now I'm scary I mean my dream is to make games now I cant and I dont have money
@Lazu_o
@Lazu_o 8 ай бұрын
destroying players and characters upon their removal is weird. aren't they automatically destroyed when removed?
@ProSureString
@ProSureString 8 ай бұрын
Sometimes if values still exist and are somehow tied to the player, it will remove them
@Te.le.
@Te.le. 8 ай бұрын
Nope, the motor6d instances are just deleted.
@xzenkaidragon9664
@xzenkaidragon9664 7 ай бұрын
Thanks man this was helpful but one thing I'm still confused about is why do we have to run destroy on player and character when playerremoving or characterremoving events run? Do they not just destroy on their own and in that case all connections tied to them also get cleaned up?
@technykgs
@technykgs 8 ай бұрын
Could you put the docs in the description or in a pinned comment? I'd like to read it through
@dominilk01
@dominilk01 8 ай бұрын
OHH no! my pressuse octet lost by setting a variable to nil
@noon1263
@noon1263 8 ай бұрын
4:30i thought you said setting it to nil uses up some memory, but you just set it back to nil here, is there a difference?
@stewiepfing539
@stewiepfing539 8 ай бұрын
I meant to say when the variable is equal to nothing eats up memory like: local variable. Sorry I messed up the way I should of done it
@noon1263
@noon1263 8 ай бұрын
@@stewiepfing539 Ok, "local test" eats up memory but "local test = nil" does not, is that right? Also at 8:16 you mentioned that Roblox among others recommends deleting the players character, but Roblox already does this? When a player leaves a game, it gets destroyed automatically, right?
@noon1263
@noon1263 8 ай бұрын
@@stewiepfing539 Also could you send me the dev forum/creator page that says about optimising your game, I would like to read it in depth more.
@stewiepfing539
@stewiepfing539 8 ай бұрын
@@noon1263 as far I as I know yes, destroying the player and character was just on the documentation so I covered it
@noon1263
@noon1263 8 ай бұрын
@@stewiepfing539 ah ok, could you send me a link to the documentation?
@baconheadhair6938
@baconheadhair6938 7 ай бұрын
how to reactivate a connection after disconnecting
@LooperEpic
@LooperEpic Ай бұрын
just define it again like anything else. “Disconnecting” basically just makes it nil
@zacomad
@zacomad 7 ай бұрын
Bro save my life with :Once and other tech just thanks bro 🙂👌
@veliantriic
@veliantriic 7 ай бұрын
9:18 what if theres a datastore? will it save?
@AggelosAnimations-y3h
@AggelosAnimations-y3h 5 ай бұрын
i have the same question lol
@notpythonics
@notpythonics 4 ай бұрын
this is a stupid question you can async before destroying the player, and I believe players are destroyed on leaving. the player:Destroy() there is redundant and pointless.
@veliantriic
@veliantriic 4 ай бұрын
@@notpythonics it's a question no need to get so mad 😭🙏🏾
@NoSences
@NoSences 7 ай бұрын
Roblox limit of 6.9 Nice
@FEG_Studio
@FEG_Studio 8 ай бұрын
Awesome !
@a爪尺
@a爪尺 7 ай бұрын
we are really getting in times of C where programmers need to carefuly manipulate memory?
@stewiepfing539
@stewiepfing539 7 ай бұрын
Always been a thing
@golden-gamingmore5931
@golden-gamingmore5931 8 ай бұрын
me when memory leak 🧨💥
@RuskyDev
@RuskyDev 8 ай бұрын
Nice tutorial! Do you have a Discord server? If not, can I create one for you?
@windy6191
@windy6191 7 ай бұрын
nil and 0 take up the same amount of memory
@stewiepfing539
@stewiepfing539 7 ай бұрын
No they dont, in Lua, numbers are typically stored as double-precision floating-point numbers, which means they take more memory (8 bytes / 64 bits) than just nothing
@windy6191
@windy6191 7 ай бұрын
@@stewiepfing539 all luau primitives (and even Vector3s) are stored in a 16 byte union
@windy6191
@windy6191 7 ай бұрын
@@stewiepfing539 how about pointing out whats wrong with what i said? you can look at the source code yourself look it up. Nil and number are the same size. Variables for tables and strings are the same size too (the variable stores a pointer to the content inside internally)
@windy6191
@windy6191 7 ай бұрын
why did all my and your replies get deleted?
@windy6191
@windy6191 7 ай бұрын
did you delete my replies?
@crooda3681
@crooda3681 8 ай бұрын
Learned this the hard way in c++
@Nwmcosczycosidk123
@Nwmcosczycosidk123 7 ай бұрын
1:15 is this real?
@ionelaalexandru2652
@ionelaalexandru2652 8 ай бұрын
Is there a way to simulate water with floating physics (for a boat game) so that the game works well on mobile too?
@Zakeksi4ek
@Zakeksi4ek 8 ай бұрын
use a better game engine for that
@halohasawaken6793
@halohasawaken6793 8 ай бұрын
If you want to accomplish something like that in Roblox (of all things), you might as well make your own physics system. At the moment, Im creating a physics system for grenades since using remote events + applying velocity on server will make the process slow. And I aint using FastCast!
@LooperEpic
@LooperEpic 8 ай бұрын
Couldn’t you do raycasts? Same concept as a vehicle with raycast suspension but over water (and probably submerged a bit)
@Sown.
@Sown. 8 ай бұрын
@@halohasawaken6793 have fun with getting that to perform at least somewhat fast. Native codegen will not work for that I believe so uhh yeah I think you should think of using another game engine
@OcnarfPro
@OcnarfPro 8 ай бұрын
​@@halohasawaken6793use OcnarfCast
@the3th3-f2s
@the3th3-f2s 5 күн бұрын
6.9gb haha funny number i thought it wasnt exactly 6.9 and something else
@puppetbirds
@puppetbirds 8 ай бұрын
HOW DO PROGRAMMERS NOT KNOW MEMORY MANAGEMENT? these people will never be able to write a SINGLE zig program without a memory leak
@_demosthenes
@_demosthenes 8 ай бұрын
they dont need to, lua has a garbage collector, it just doesnt clean up some connections depending on scope and where theyre referenced. luas a scripting language precisely because you dont have to worry about memory management. imagine trying to use lua to configure a program and have to worry about memory allocation. also not sure what zig has to do with this
@baconheadhair6938
@baconheadhair6938 7 ай бұрын
how do programmers not know everything about programming the second the start programming
@alexikabakilwa2663
@alexikabakilwa2663 7 ай бұрын
Did i play 3vade with you
@ding.1367
@ding.1367 8 ай бұрын
6.9GB specifically, bro what. nice video though
@Te.le.
@Te.le. 8 ай бұрын
its 7 gb - the 0.1gb thats reserved for other services that roblox runs that arent binded to the player task. 7 gb is a lot for roblox.
@嚇壞
@嚇壞 8 ай бұрын
grrah
@Kitsune_Dev
@Kitsune_Dev 8 ай бұрын
oh 💩
The Wild World of Discontinued Roblox Features
29:45
Pixel Pug
Рет қаралды 118 М.
Upgrade Your Roblox Events With These Methods! | Roblox Studio
9:03
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
How to PREVENT Memory Leaks in Your Roblox Scripts!
9:57
SummerEquinox
Рет қаралды 5 М.
Why You Shouldn't Set Every Roblox Property to 999999
22:26
ByteBlox
Рет қаралды 113 М.
Datastore: A Scripter's Worst Nightmare Explained
9:55
Ludius
Рет қаралды 25 М.
Roblox Devs, stop misusing :WaitForChild()!
17:13
Crusherfire
Рет қаралды 78 М.
METATABLES | What are they and how can we use them?
18:40
Crusherfire
Рет қаралды 29 М.
How Unoptimized Can a Roblox Game Get?
16:49
ByteBlox
Рет қаралды 322 М.
The MUST Follow Roadmap For ALL Solo Developers
14:41
DevWorm
Рет қаралды 32 М.
Roblox's Best-Kept CFrame Secrets | Roblox Studio
11:16
Stewiepfing
Рет қаралды 6 М.
The EASIEST Way To Optimize Your Code! | Roblox Studio
10:54
Stewiepfing
Рет қаралды 25 М.
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН