Multi Thread, Parallel Scripts, MicroProfiler - Roblox Scripting Tutorial

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 75

  • @CSHorseBobJoe
    @CSHorseBobJoe Před rokem +48

    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

    • @purplebeaste7718
      @purplebeaste7718 Před měsícem +3

      Probably because it covers more advanced subjects, meaning that only advanced scripters would want to watch this. New scripters are abundant but won't care to watch this.

  • @KebeMaro
    @KebeMaro Před 2 lety +26

    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!

  • @CodeProto
    @CodeProto Před 3 měsíci

    That last part explains a TON, I've been having weird bugs and this explains it.

  • @exhydraboy2429
    @exhydraboy2429 Před 4 měsíci +1

    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  Před 3 měsíci

      My newer videos have a new mic that's a lot better

  • @goreacraft
    @goreacraft Před 2 lety +16

    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

  • @calamitydoggo6973
    @calamitydoggo6973 Před 2 lety +3

    great tutorial, learned a lot about the micro profiler

  • @hlflifeenjoyer6176
    @hlflifeenjoyer6176 Před 5 měsíci

    Amazing video really helped me with multi threading and usage of actors

  • @user-cx4od2bz5r
    @user-cx4od2bz5r Před 7 měsíci

    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.

  • @wrello
    @wrello Před rokem +5

    Thanks!

    • @5uphi
      @5uphi  Před rokem +2

      Your very welcome and thank you for the support :)

  • @hoanghanguyen1410
    @hoanghanguyen1410 Před 2 lety

    Amazing, I don't understand MicroProfiler Debug much until your video. I already donated to you :D Thanks mate

    • @5uphi
      @5uphi  Před 2 lety

      I'm happy my video helped you learn something and thanks for the donation

  • @andrei_cn8246
    @andrei_cn8246 Před 2 lety +11

    video idea : caves in noise generation

  • @ryx10
    @ryx10 Před 2 lety +1

    I have no idea what this video is trying to teach but i liked the explanation, nice vid!

    • @5uphi
      @5uphi  Před 2 lety

      This video is the first steps to understanding parallel scripting :P ill have more demonstrations in future videos

  • @root6132
    @root6132 Před 2 lety +9

    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  Před 2 lety +6

      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 Před 2 lety +1

      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 Před 2 lety

      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 Před 2 lety

      @@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.

  • @judlex7300
    @judlex7300 Před rokem +1

    Love your keyboard sounds 🥰🥰

    • @5uphi
      @5uphi  Před rokem +1

      Me too I have Outemu brown switches on the Magicforce keyboard and I'm very happy with them

  • @guy3565
    @guy3565 Před rokem

    You are doing Gods work my friend.

  • @lyptical7868
    @lyptical7868 Před rokem

    Incredible video

  • @-T0Ast200-
    @-T0Ast200- Před 2 lety +1

    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

  • @gabrioche6757
    @gabrioche6757 Před rokem

    Thanks, very interesting

  • @robocu4
    @robocu4 Před 2 lety +3

    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  Před 2 lety +9

      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

  • @kif-zallrhat1870
    @kif-zallrhat1870 Před rokem +1

    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

  • @Scryptings
    @Scryptings Před rokem +2

    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  Před rokem

      Make the start function private and simply call the function before you return the module no need for a variable to keep track

  • @Noon1263
    @Noon1263 Před 2 lety +1

    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.

  • @getmanovich377
    @getmanovich377 Před rokem

    Parallel Luau looks unpredictable

  • @hajka7887
    @hajka7887 Před 2 lety

    Thanks, I'd be really grateful if you did an introduction to coroutines

    • @5uphi
      @5uphi  Před 2 lety +1

      I personally never use coroutines but maybe if I got some extra time I can make a video about it

  • @the_pr0fessorRBXL
    @the_pr0fessorRBXL Před 2 lety

    🙌

  • @monoqqr
    @monoqqr Před 2 lety +1

    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  Před 2 lety +1

      I hope to incorporate multiple threads in many of my future videos when it's feasible

  • @praneshbalaji8047
    @praneshbalaji8047 Před 2 lety

    Thank you!!!!!!1

    • @5uphi
      @5uphi  Před 2 lety

      Your very welcome

  • @user-cx4od2bz5r
    @user-cx4od2bz5r Před 7 měsíci

    14:00 Something strange happens for me, for both scripts the connections inside gets executed, but they all fall under localscript1.

  • @costo.
    @costo. Před 9 dny

    7:10 "Lua" option doesn't appear anymore :(

  • @kokobroxd
    @kokobroxd Před 4 měsíci

    ctrl+p opens quick search

  • @goreacraft
    @goreacraft Před 2 lety +1

    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  Před 2 lety +1

      Make sure to read the thread safety part of this article create.roblox.com/docs/scripting/scripts/parallel-scripting

  • @cyberex5509
    @cyberex5509 Před 8 měsíci

    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

  • @reardoor
    @reardoor Před rokem

    You briefly mentioned that CPU determines worker threads. Is there a max number?

    • @5uphi
      @5uphi  Před rokem

      Don't think so

  • @toothinm9paste
    @toothinm9paste Před rokem

    could this scripting method be useful for wave function generation, such as wave function terrain generation, and map generation?

    • @5uphi
      @5uphi  Před rokem

      It's useful if you want to do a heavy task multiple times

  • @mybisboetharium737
    @mybisboetharium737 Před rokem

    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  Před rokem

      You can make one actor then clone that actor

    • @mybisboetharium737
      @mybisboetharium737 Před rokem

      @@5uphi Then keep firing the bindable events on each actor? and when all 64 are occupied, start firing on occupied ones?

    • @mybisboetharium737
      @mybisboetharium737 Před rokem

      @@5uphi ?

    • @5uphi
      @5uphi  Před rokem

      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

  • @zuner1446
    @zuner1446 Před 5 měsíci

    guys Is there I one who doesn't see script working?

  •  Před 2 lety +1

    Should I use it instead of single thread on every scripts?

    • @5uphi
      @5uphi  Před 2 lety +1

      Most likely no

  • @Boi-ii2lm
    @Boi-ii2lm Před rokem

    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  Před rokem

      you can use a bindableevent to send data

  • @akzholtosamaeva117
    @akzholtosamaeva117 Před 2 lety

    😍😍😍😍😍😍😘😘😘

  • @lovableprogrammer2800

    whats the point of syncronizing scripts? I feel like there's a performance benefit here but I need it explained

    • @5uphi
      @5uphi  Před rokem

      Not all properties can be set while desynchronized so you must synchronize to for instance set a parts name

    • @lovableprogrammer2800
      @lovableprogrammer2800 Před rokem

      @@5uphi can you give me an example

    • @5uphi
      @5uphi  Před rokem

      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 Před rokem

      @@5uphi what the... why do i feel like i've been scripting games all wrong ;-;

  • @yeah7689
    @yeah7689 Před 2 lety

    Can you make a grenade?

  • @soda35160
    @soda35160 Před rokem

    U sound like turtle derp

    • @5uphi
      @5uphi  Před rokem +1

      iv never heard turtle derp before

    • @soda35160
      @soda35160 Před rokem

      @@5uphi he is an old minecraft youtuber i used to watch. He privated all of his videos a couple months ago