This is super interesting, but I'd be nervous about figuring out what functions can be multithreaded and what ones can't. Are there any guidelines for this, or any additional usage guidelines that we would need to be aware of?
@@Mr.Sunshine2023 I think your channel would be super interesting if you made some videos showing use-cases where it is safe to do blueprint multithreading. In general, isn't it true that as long as you are not messing with values on the game thread, it should be fine? So for instance, enemy AI calculations could be great, right?
In fact, they are mainly designed for your personal calculations, not for the engine, if you have something that has a lot of loops, something like that. But one of the positive things, I think, is enabling Ticks on another thread. To me, this can be considered relatively safe, although there are downsides to this safety. If you enable it, the tick can be triggered on other threads, which will reduce the load on the game thread, but you can't put too much complex logic in there, because the game thread executes all other ticks and then waits for the ticks to finish in other threads, so if you don't interact with other objects in the world on the tick, but only with the object on which the tick is triggered, then it should be safe. Correct me if I'm wrong.
I think I will develop it as needed and based on feedback. I may add other functionality for multithreading. So far, I have neither ideas nor time for this.
@@Mr.Sunshine2023 One design scheme I see a lot is for using multithreading in conjunction with the game thread for specific jobs, e.g., game thread constructs a job and distributes to the other threads but waits for the calculations to be done, then recollects all the information. So like big loops of calculations that get added together can be parallelized, but the game thread is still waiting for the calculations to be returned. (Edit: In hindsight, I guess you talk about this exactly in your video huh?) I think this is a great topic and I haven't seen a ton of stuff on it for UE specifically, so this could be a good niche if you ever wanted to get into the education space here
Depending on your needs, the easiest option to use "Run task on background thread" or "Threaded logic" they do same job, but one of them you can call only in event graph because its latent node. In this case you will calculate everything in another thread and write to array, and after it ends it's call another logic in game thread where you can apply vectors to your game logic.
I just decided to learn a little bit about multi-threading, and since I learned a little bit, I thought I'd help people, since the plugins that are available now are quite simple. With the help of feedback, I will expand the capabilities of the plugin (unfortunately, I still can't publish it on the marketplace).
@@Mr.Sunshine2023 Maybe, i'm at the end of the project anyways, I managed to get good performance by nativizing bps. I'm not a dev tbh, just a TechArt guy mostly doing dev because we don't have one lmao, so my code might also be the issue. But I did some research and oh my god with threads it would have been so much better on some stuff! (Handling captures on separate threads, exporting images, etc... because I just try to do the heavy stuff either on begin play or behind a black screen when exiting a train for example) Don't try and go through the hassle, it's a fan tribute project to an extinct ride, I would not have enough time and willingness to use for that specific project at this state of developpment. I highly appreciate it though, and will check your work for future stuff
build version? if yes, then just create folder Plugins (in project folder) and extract into this folder, otherwise same, but it will be needed to compile c++ (not hard, but still)
This is super interesting, but I'd be nervous about figuring out what functions can be multithreaded and what ones can't.
Are there any guidelines for this, or any additional usage guidelines that we would need to be aware of?
no, there is no such thing, in general, multithreading in blueprints has a lot of problems, and I understand why epics did not take it up
@@Mr.Sunshine2023 I think your channel would be super interesting if you made some videos showing use-cases where it is safe to do blueprint multithreading.
In general, isn't it true that as long as you are not messing with values on the game thread, it should be fine?
So for instance, enemy AI calculations could be great, right?
In fact, they are mainly designed for your personal calculations, not for the engine, if you have something that has a lot of loops, something like that. But one of the positive things, I think, is enabling Ticks on another thread. To me, this can be considered relatively safe, although there are downsides to this safety. If you enable it, the tick can be triggered on other threads, which will reduce the load on the game thread, but you can't put too much complex logic in there, because the game thread executes all other ticks and then waits for the ticks to finish in other threads, so if you don't interact with other objects in the world on the tick, but only with the object on which the tick is triggered, then it should be safe. Correct me if I'm wrong.
I think I will develop it as needed and based on feedback. I may add other functionality for multithreading. So far, I have neither ideas nor time for this.
@@Mr.Sunshine2023 One design scheme I see a lot is for using multithreading in conjunction with the game thread for specific jobs, e.g., game thread constructs a job and distributes to the other threads but waits for the calculations to be done, then recollects all the information.
So like big loops of calculations that get added together can be parallelized, but the game thread is still waiting for the calculations to be returned. (Edit: In hindsight, I guess you talk about this exactly in your video huh?)
I think this is a great topic and I haven't seen a ton of stuff on it for UE specifically, so this could be a good niche if you ever wanted to get into the education space here
hey ! I need to calculate a lot of vectors, how should I go about it?
Depending on your needs, the easiest option to use "Run task on background thread" or "Threaded logic" they do same job, but one of them you can call only in event graph because its latent node. In this case you will calculate everything in another thread and write to array, and after it ends it's call another logic in game thread where you can apply vectors to your game logic.
Doing what epic won't
Thanks!
I just decided to learn a little bit about multi-threading, and since I learned a little bit, I thought I'd help people, since the plugins that are available now are quite simple. With the help of feedback, I will expand the capabilities of the plugin (unfortunately, I still can't publish it on the marketplace).
@@Mr.Sunshine2023 I understand, I would have loved this on 4.26 for our Rock N Roller coaster project.
Enjoy the work you are doing, it's good!
@@RaphpowerSGSUModding I don't installed 4.26, but have 4.27, if needed can try build for it. Maybe it will work for you.
@@Mr.Sunshine2023 Maybe, i'm at the end of the project anyways, I managed to get good performance by nativizing bps.
I'm not a dev tbh, just a TechArt guy mostly doing dev because we don't have one lmao, so my code might also be the issue.
But I did some research and oh my god with threads it would have been so much better on some stuff!
(Handling captures on separate threads, exporting images, etc... because I just try to do the heavy stuff either on begin play or behind a black screen when exiting a train for example)
Don't try and go through the hassle, it's a fan tribute project to an extinct ride, I would not have enough time and willingness to use for that specific project at this state of developpment. I highly appreciate it though, and will check your work for future stuff
If you have any ideas, you can give us a suggestion to add
how to compile for newer unreal engine version?
@@capt3951 you have some errors? If I'm right, I compile for 5.4
hey , i downloaded it ,, but how do i add it to my project ???
build version? if yes, then just create folder Plugins (in project folder) and extract into this folder, otherwise same, but it will be needed to compile c++ (not hard, but still)
ruclips.net/video/BR3Dbi_QGfk/видео.html its for engine