Multi Thread, Parallel Scripts, MicroProfiler - Roblox Scripting Tutorial

  Рет қаралды 31,201

Suphi Kaner

Suphi Kaner

Күн бұрын

Discord: / discord
Patreon: / suphi
Donate: www.roblox.com/games/7532473490
create.roblox.com/docs/optimi...
create.roblox.com/docs/script...
create.roblox.com/docs/refere...
create.roblox.com/docs/refere...
devforum.roblox.com/t/paralle...
devforum.roblox.com/t/paralle...
devforum.roblox.com/t/full-re...
0:00:00 - Intro
0:00:06 - Micro Profiler
0:11:35 - Parallel Scripting
0:19:00 - Outro

Пікірлер: 73
@CSHorseBobJoe
@CSHorseBobJoe 11 ай бұрын
This channel is insanely valuable, the amount of coverage on different important topics here outranks any other channel I've seen, I have no idea why it's not popular
@KebeMaro
@KebeMaro 2 жыл бұрын
Wow , I really was looking to try and understand parallel scripting a few days ago , can't believe you actually released a video on it today. I'm so glad you did , keep up the unique and amazing videos!
@calamitydoggo6973
@calamitydoggo6973 2 жыл бұрын
great tutorial, learned a lot about the micro profiler
@hlflifeenjoyer6176
@hlflifeenjoyer6176 2 ай бұрын
Amazing video really helped me with multi threading and usage of actors
@user-cx4od2bz5r
@user-cx4od2bz5r 5 ай бұрын
Great tutorial! Really loved how you used the micro profiler to demonstrate how the work gets executed. Would be cool if you cover the cross thread communication, but I can do that on my own to hahhaa.
@guy3565
@guy3565 Жыл бұрын
You are doing Gods work my friend.
@CodeProto
@CodeProto Ай бұрын
That last part explains a TON, I've been having weird bugs and this explains it.
@hoanghanguyen1410
@hoanghanguyen1410 Жыл бұрын
Amazing, I don't understand MicroProfiler Debug much until your video. I already donated to you :D Thanks mate
@5uphi
@5uphi Жыл бұрын
I'm happy my video helped you learn something and thanks for the donation
@lyptical7868
@lyptical7868 Жыл бұрын
Incredible video
@judlex7300
@judlex7300 Жыл бұрын
Love your keyboard sounds 🥰🥰
@5uphi
@5uphi Жыл бұрын
Me too I have Outemu brown switches on the Magicforce keyboard and I'm very happy with them
@goreacraft
@goreacraft 2 жыл бұрын
Amazing video, thank you. Can you please make some more tutorials about this topic with more details and examples? - for example how to implement this actors properly with module scripts as i almost never use localscripts - or a few examples on how can one troubleshoot issues and implement multithreading in existing code
@ryx10
@ryx10 2 жыл бұрын
I have no idea what this video is trying to teach but i liked the explanation, nice vid!
@5uphi
@5uphi 2 жыл бұрын
This video is the first steps to understanding parallel scripting :P ill have more demonstrations in future videos
@gabrioche6757
@gabrioche6757 Жыл бұрын
Thanks, very interesting
@-T0Ast200-
@-T0Ast200- 2 жыл бұрын
Awesome video! I had no idea this was even a thing until now, but I have a great video idea; a plane you can fly in, or maybe a car that drives to a position that you want? I don’t know but those are some cool ones that I think you should try
@andrei_cn8246
@andrei_cn8246 2 жыл бұрын
video idea : caves in noise generation
@bigamingplayer2409
@bigamingplayer2409 Жыл бұрын
4d noise map
@syndexcorporation
@syndexcorporation Жыл бұрын
Roblox noise map inverted
@wrello
@wrello Жыл бұрын
Thanks!
@5uphi
@5uphi Жыл бұрын
Your very welcome and thank you for the support :)
@root6132
@root6132 2 жыл бұрын
Would absolutely love it if you could show us some use cases for this as I really don’t see much difference between using this and using something like coroutines.
@5uphi
@5uphi 2 жыл бұрын
I hope to incorporate it into my newer scripts if you use coroutines they will not be on separate threads they will run one after the other the same way task.defer and task.spawn works this is the first time we have been able to do true multi thread in Roblox
@monoqqr
@monoqqr 2 жыл бұрын
This is used for multi-threading, which will lead to optimization, threads on serialized luau run on one and only core and when threads run on parallel it will create a new core to run in from my perspective
@DriftHyena
@DriftHyena 2 жыл бұрын
It's good for if you have a mass amount of NPCs that need updating, or in some other cases I've seen pop up recently, as a sort of hacked together CPU raytraced global illumination system. The key here is to break down operations in read only and write only chunks, and move the read only chunks to threads, synchronize them, and then perform all of your writes.
@dimitar.bogdanov
@dimitar.bogdanov Жыл бұрын
@@monoqqr It cannot run on a 'new' core, as the amount of cores is how many cores your CPU has. That's usually a pretty small amount, e.g. 4, 6, or 8. The game will try to balance your actors between your cores, so if you have 2 cores and 6 actors, presumably it'd run 3 actors on one core and the rest on the other core. This is slightly oversimplified, though.
@the_pr0fessorRBXL
@the_pr0fessorRBXL 2 жыл бұрын
🙌
@Tamla1959
@Tamla1959 2 жыл бұрын
Could you explain and teach us how to use the TextChatService, there isn't really much info about it. I know its not fully realised, but i just want to know what it fully is and how it fully works, and what i can do.
@exhydraboy2429
@exhydraboy2429 Ай бұрын
the ONLY criticism I have for this video is please....use either a mic compressor, or noise reduction using Adobe's free tool or something in your editing suite.... you could also use NVidia broadcast as a microphone input, or something similar to that to fix the background audio 🤗
@5uphi
@5uphi Ай бұрын
My newer videos have a new mic that's a lot better
@robocu4
@robocu4 Жыл бұрын
So, I understand that this has no usage benefit when you consider spreading a large calculation across multiple actors/threads seeing as the parallel threads usually can't influence one another in anyway. Would you happen to know if this would allow threads to continue executing even when a large calculation has halted server-side runtime? I'm trying to get my day loop to continue operating as expected while the server stutters to procedurally process islands, and if using an actor would enable the thread to continue running while the sequence is holding back the main thread, I'd definitely look into implementing this. As it stands I don't really understand the use cases.
@5uphi
@5uphi Жыл бұрын
There are benefits for instance you can look at my infinite terrain plugin to see how each chunk of terrain generates in a separate actor, your actor has to complete before the end of the frame or it will block the synchronized part you can use a task.wait() to make it wait till the next frame and continue its work, lets say you have a calculation 1 * 1 + 2 * 2 what you can do is make actor1 to 1 * 1 then synchronize and actor2 do 2 * 2 then synchronize then after both have synchronize do 1 + 4 to get the result 5
@getmanovich377
@getmanovich377 Жыл бұрын
Parallel Luau looks unpredictable
@hajka7887
@hajka7887 Жыл бұрын
Thanks, I'd be really grateful if you did an introduction to coroutines
@5uphi
@5uphi Жыл бұрын
I personally never use coroutines but maybe if I got some extra time I can make a video about it
@praneshbalaji8047
@praneshbalaji8047 2 жыл бұрын
Thank you!!!!!!1
@5uphi
@5uphi 2 жыл бұрын
Your very welcome
@Scryptings
@Scryptings Жыл бұрын
Hey there suphi! Great video as always, although i have a question Put it simply, i have a module that have a start function inside of it, and it will start IF the module has never been started yet, (an internal variable checks it but you get it). My problem is, i throw a warning when you try to start an already started module, and since i also have an internal auto-start (incase the module gets interacted with but it has never been started), the problem comes down to this : When i have two scripts that require a module, 1 script starts the module and the other just does normal stuff, the warning would sometimes appear and sometimes not, since script 1 starts the module and script 2 has an internal autostart, it sometimes throws an error that the module has been started! Any way to fix this? Thanks!
@5uphi
@5uphi Жыл бұрын
Make the start function private and simply call the function before you return the module no need for a variable to keep track
@kif-zallrhat1870
@kif-zallrhat1870 10 ай бұрын
Right... I understand this already but I have no idea what I could use it for. My game has two scripts and a bunch of module scripts and parallel scripting doesn't allow me to use remote events and functions on top of all... Uses I can think of are, for example, multiple NPCs or something similar
@softalmonds4842
@softalmonds4842 4 ай бұрын
bro i,m having the same problem
@mybisboetharium737
@mybisboetharium737 Жыл бұрын
so like.. say for, a chunk (voxel blocks) loading system, do i really have to make 64 actors with 64 individual scripts that do the same thing, to run the same function in parallel?.. also great informative video, i was having so much trouble understanding this parallel luau thing because the way people explain it was so alien.. except for this video, so amazing job :D
@5uphi
@5uphi Жыл бұрын
You can make one actor then clone that actor
@mybisboetharium737
@mybisboetharium737 Жыл бұрын
@@5uphi Then keep firing the bindable events on each actor? and when all 64 are occupied, start firing on occupied ones?
@mybisboetharium737
@mybisboetharium737 Жыл бұрын
@@5uphi ?
@5uphi
@5uphi Жыл бұрын
You could if you wanted to or you could clone more when there are no actors not occupied or you could wait until some of the actors are no longer occupied before doing more work
@cyberex5509
@cyberex5509 6 ай бұрын
for me i cant even find where the main thread is, for some reason the instead of it appearing as "Main" like in the video, mine is "Main/Render" and therefore when i look in this "Main/Render" thread it doesn't show up any scripts being executed. I've tried different ways to move the scripts into replicate storage, starter player,... but it doesnt seems to work. Please help
@monoqqr
@monoqqr 2 жыл бұрын
could you cover up ways to use this as well as the difference of running thread-safe code to running code that is not safe to read
@5uphi
@5uphi 2 жыл бұрын
I hope to incorporate multiple threads in many of my future videos when it's feasible
@user-cx4od2bz5r
@user-cx4od2bz5r 5 ай бұрын
14:00 Something strange happens for me, for both scripts the connections inside gets executed, but they all fall under localscript1.
@reardoor
@reardoor Жыл бұрын
You briefly mentioned that CPU determines worker threads. Is there a max number?
@5uphi
@5uphi Жыл бұрын
Don't think so
@toothinm9paste
@toothinm9paste 10 ай бұрын
could this scripting method be useful for wave function generation, such as wave function terrain generation, and map generation?
@5uphi
@5uphi 10 ай бұрын
It's useful if you want to do a heavy task multiple times
@goreacraft
@goreacraft 2 жыл бұрын
I am trying to use parallel scripting for some ocean planes (plane mesh with bones) but i get an error "Property Bone.Transform is not safe to write in parallel" .. this is a bummer
@5uphi
@5uphi 2 жыл бұрын
Make sure to read the thread safety part of this article create.roblox.com/docs/scripting/scripts/parallel-scripting
@kokobroxd
@kokobroxd Ай бұрын
ctrl+p opens quick search
@akzholtosamaeva117
@akzholtosamaeva117 2 жыл бұрын
😍😍😍😍😍😍😘😘😘
@Boi-ii2lm
@Boi-ii2lm Жыл бұрын
I dont understand the use for this really, example i have gertsner wave ocean lets say i would want to calculate all the bone data then synchronize and displace those bones, but how would i even transfer the data without yielding?
@5uphi
@5uphi Жыл бұрын
you can use a bindableevent to send data
Жыл бұрын
Should I use it instead of single thread on every scripts?
@5uphi
@5uphi Жыл бұрын
Most likely no
@zuner1446
@zuner1446 2 ай бұрын
guys Is there I one who doesn't see script working?
@yeah7689
@yeah7689 2 жыл бұрын
Can you make a grenade?
@lovableprogrammer2800
@lovableprogrammer2800 Жыл бұрын
whats the point of syncronizing scripts? I feel like there's a performance benefit here but I need it explained
@5uphi
@5uphi Жыл бұрын
Not all properties can be set while desynchronized so you must synchronize to for instance set a parts name
@lovableprogrammer2800
@lovableprogrammer2800 Жыл бұрын
@@5uphi can you give me an example
@5uphi
@5uphi Жыл бұрын
Like 98% of properties of anything can't be changed while desynchronized you need to check the documentation to find out what is safe to set while desynchronized for instance you can't set the parts name position size anchored cancollide etc.. all these properties can only be changed while synchronised
@lovableprogrammer2800
@lovableprogrammer2800 Жыл бұрын
@@5uphi what the... why do i feel like i've been scripting games all wrong ;-;
@soda35160
@soda35160 Жыл бұрын
U sound like turtle derp
@5uphi
@5uphi Жыл бұрын
iv never heard turtle derp before
@soda35160
@soda35160 Жыл бұрын
@@5uphi he is an old minecraft youtuber i used to watch. He privated all of his videos a couple months ago
Minimap - Roblox Scripting Tutorial
29:33
Suphi Kaner
Рет қаралды 28 М.
What Is The Best AI For Roblox Studio Scripting?
10:42
RoDev
Рет қаралды 402 М.
Alat Seru Penolong untuk Mimpi Indah Bayi!
00:31
Let's GLOW! Indonesian
Рет қаралды 10 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 25 МЛН
Projectile Physics - Roblox Scripting Tutorial
17:47
Suphi Kaner
Рет қаралды 87 М.
How One Memory Leak Can Kill Your Game
7:09
ByteBlox
Рет қаралды 24 М.
Roblox Module Scripts (The Right Way)
15:20
qweekertom
Рет қаралды 11 М.
Making a Game in Lua with No Experience
5:52
Goodgis
Рет қаралды 252 М.
MULTI-THREADING on ROBLOX?!
33:13
Crusherfire
Рет қаралды 9 М.
METATABLES | What are they and how can we use them?
18:40
Crusherfire
Рет қаралды 13 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 511 М.
Game Automation with YOLOv8: Python Bot Tutorial
21:40
ClarityCoders
Рет қаралды 20 М.
Alat Seru Penolong untuk Mimpi Indah Bayi!
00:31
Let's GLOW! Indonesian
Рет қаралды 10 МЛН