Muchisimas gracias por la informacion, mi problema no solo era hacer cosas en segundo plano si no leer datos (de XML) y pasarselos al hilo principal una vez terminada la ejecucion para básicamente hacer una pantalla de carga con todas las de la ley. Gracias a tu video y a 2 o 3 cosas más he podido implementarlo. Saludos!
Thank for the video. I don't know if it was intentional to increase the number of calculations, but to test prime or not, you can just store previous primes and test them only, no need to test all integer until x/2 ;)
Is it possible to check whether the task is finished in the main thread? Since I need to retrive the calculated data from the task and call another function
you can use delegates for that forums.unrealengine.com/community/community-content-tools-and-tutorials/13915-tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints
Okay, so this tutorial is pretty good but, for the purposes of optimization in my own game, I want to know the method for building the worker thread to work to work on long running or perpetual tasks. And since this tutorial specifically states to not do that with this one, I was wondering how to program a worker thread that could do just that. Thank you and have a good day.
Sorry to be so off topic but does anybody know of a trick to log back into an instagram account..? I stupidly forgot the account password. I appreciate any tricks you can offer me
@Bobby Brantley Thanks for your reply. I got to the site on google and Im trying it out now. I see it takes a while so I will reply here later with my results.
How can I make callbacks for the caller thread? I managed to do it with AsyncTask(ENamedThreads::GameThread, [OnReportProgress = OnReportProgress ]() { OnReportProgress.ExecuteIfBound(....) }) this works. but sometimes I want to cancel the running work and run a new work with new parameters. when I cancel the thread, things go wrong and i get access violation errors.
Thank you! im fairly new to c++ but how would i go about outputing the parameters through the blueprint function? say pass the prime values found into an array in BP...
Hey there, nice tutorial! Any idea why TStatID throws identifier undefined? I updated the includes for IWYU standard for UE 4.22 with #include "Runtime/Core/Public/Stats/Stats.h", but I am not having any luck there.
Thanks and this was really helpful !!! I would love a tutorial on the niagara system also I crashed into a problem where I need a 2d array for textures in material. Are there any ways to add it ourselves ?
I will hopefully be making more tutorials soon, and can cover Niagara then. I don't think you can make 2D arrays. You might be able to have an array of a struct which itself contains an array, or have a normal array then you "step" over as though it was 2D.
@@gamedevsocietybu6179 there is a mention of it in the documentation but I have no idea how to use it so I think I need to put everything in one image and access from it :(
I haven't tried it, but can you call the CreateSaveGame and SaveGameToSlot functions in UGameplayStatics (I think) from the background thread DoWork function?
Not sure which int32 you mean by "output", do you mean the int32 that gets passed to the constructor? That is just there so we can pass a number to our class telling it how many prime numbers to find, otherwise it could just run forever. If you mean why is it "int32" rather than just "int" that is because the engine likes you to specify what type of int you mean, normal "int" do not show up in Blueprint but "int32" do.
Man I spent like 7 hours straight trying to figure this out on my own. Should have just sat through this video when I first opened it.
You really saved my life with this video! I'll be grateful to you forever! ;-)
Thanks :)
Thank you for the tutorial! Really informative and easy to understand
Muchisimas gracias por la informacion, mi problema no solo era hacer cosas en segundo plano si no leer datos (de XML) y pasarselos al hilo principal una vez terminada la ejecucion para básicamente hacer una pantalla de carga con todas las de la ley. Gracias a tu video y a 2 o 3 cosas más he podido implementarlo. Saludos!
Thank for the video. I don't know if it was intentional to increase the number of calculations, but to test prime or not, you can just store previous primes and test them only, no need to test all integer until x/2 ;)
Good video. Thanks for putting this together.
Yes, a great tutorial. Thanks for creating it!
Good stuff! thanks for the knowledge! I definitely need this for my Ai Pathfinding Spline system.
good i was learning how to implement but your example is the best i found thanks for it
Thanks :)
This was very interesting. Thank you for sharing your knowledge friend :)
Very helpful! Thank you very much
Is it possible to check whether the task is finished in the main thread? Since I need to retrive the calculated data from the task and call another function
what if a want to fire a event on the blueprint when the background task finish?
you can use delegates for that forums.unrealengine.com/community/community-content-tools-and-tutorials/13915-tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints
Okay, so this tutorial is pretty good but, for the purposes of optimization in my own game, I want to know the method for building the worker thread to work to work on long running or perpetual tasks. And since this tutorial specifically states to not do that with this one, I was wondering how to program a worker thread that could do just that.
Thank you and have a good day.
Sorry to be so off topic but does anybody know of a trick to log back into an instagram account..?
I stupidly forgot the account password. I appreciate any tricks you can offer me
@Clay Sutton instablaster :)
@Bobby Brantley Thanks for your reply. I got to the site on google and Im trying it out now.
I see it takes a while so I will reply here later with my results.
@Bobby Brantley It did the trick and I finally got access to my account again. Im so happy!
Thanks so much you really help me out :D
@Clay Sutton happy to help :D
Thank you very helpfull tutorial!
Can I let the task return a value?
Superb tutorial!
Could you go provide us with the classes that you made and if there is some good documentation for beginners for threading?
If I can find the UE4 project then I'll zip it up and link it for you. I think it will be on my work PC though so I cannot check right now.
How can I make callbacks for the caller thread?
I managed to do it with
AsyncTask(ENamedThreads::GameThread, [OnReportProgress = OnReportProgress ]() { OnReportProgress.ExecuteIfBound(....) })
this works. but sometimes I want to cancel the running work and run a new work with new parameters. when I cancel the thread, things go wrong and i get access violation errors.
what a fucking legend you are
Thank you! im fairly new to c++ but how would i go about outputing the parameters through the blueprint function? say pass the prime values found into an array in BP...
delegates with params?
Hey there, nice tutorial! Any idea why TStatID throws identifier undefined? I updated the includes for IWYU standard for UE 4.22 with #include "Runtime/Core/Public/Stats/Stats.h", but I am not having any luck there.
Just in case you haven't figured it out yet, it's because it's not "D" but "d"
@@weekendum7880 Mother of god! Thanks you so much!
Thanks and this was really helpful !!! I would love a tutorial on the niagara system also I crashed into a problem where I need a 2d array for textures in material. Are there any ways to add it ourselves ?
I will hopefully be making more tutorials soon, and can cover Niagara then.
I don't think you can make 2D arrays. You might be able to have an array of a struct which itself contains an array, or have a normal array then you "step" over as though it was 2D.
@@gamedevsocietybu6179 there is a mention of it in the documentation but I have no idea how to use it so I think I need to put everything in one image and access from it :(
What do I need to do to use FNonAbondableTask? using it throws a compile error "undefined class"
Sorry for late reply, it is "FNonAbandonableTesk", not "FNonAbondable".
Can you show how to do SaveGame Asynchronously, I mean saving the game in background and gameplay will continues at the same time
I haven't tried it, but can you call the CreateSaveGame and SaveGameToSlot functions in UGameplayStatics (I think) from the background thread DoWork function?
why do primesearchtask have to have int32 as an output?
Not sure which int32 you mean by "output", do you mean the int32 that gets passed to the constructor?
That is just there so we can pass a number to our class telling it how many prime numbers to find, otherwise it could just run forever. If you mean why is it "int32" rather than just "int" that is because the engine likes you to specify what type of int you mean, normal "int" do not show up in Blueprint but "int32" do.
you are not using UE4 naming convention...