Announcement

Collapse
No announcement yet.

(39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Ok, I got timers calling custom events after 1 second and I put them on both sides of my heaviest function.

    The problem we are not going to get around is that I have a ForEachLoop with an 800 member array calling 2 other ForEachLoops, with arrays of a combined ~200 members, each of which compares vectors and performs math 10-20 times on the original 800. I am easily breaking 1 million iterations in this function alone. Considering this is my second smallest map, there isn't a gimmick that will keep me from hitting this iteration limit at some point.

    I had found a plugin that removes the iteration limit at one point, but never got it to work because it wasn't updated from 4.0/4.1.
    Last edited by Zeustiak; 07-21-2014, 12:41 AM.
    Map Generator 1.0
    Map Generator 2.0
    Map Generator 3.0

    Comment


      Originally posted by Zeustiak View Post
      I had found a plugin that removes the iteration limit at one point, but never got it to work because it wasn't updated from 4.0/4.1.
      Do you know the name of the property as I would find it in the C++ ?

      It's clearly not an ini file setting or you wouldn't need a plugin for it, right?

      I am searching myself now

      Rama
      100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

      UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

      Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

      Comment


        Originally posted by Zeustiak View Post
        The problem we are not going to get around is that I have a ForEachLoop with an 800 member array calling 2 other ForEachLoops, with arrays of a combined ~200 members, each of which compares vectors and performs math 10-20 times on the original 800. I am easily breaking 1 million iterations in this function alone. Considering this is my second smallest map, there isn't a gimmick that will keep me from hitting this iteration limit at some point.
        What I'd do if I had that intense of an operation would be to break it up into chunks of actions that I do per tick.

        So use for loops instead of for each, and track the indicies

        each tick, process, say 1000 loop iterations, keeping track with a BP-global variable for the current index.

        your goal amount / max for each for loop will be set at the beginning of the tick, to be current index + chunk size.

        then you enter the for loop and iterate, and then, in BP, you will have to manually increment the current index by your chunk size at the end of the tick.

        This is all easy to do if use for loop!

        And if your chunk size is a variable, you can decide over time what chunk size is best for performance!

        I'd say start with 100-1000 range somewheres.


        doesn't your game completely stall when you run all your iterations of all in loops in 1 tick?

        if you break it up can avoid stalling and have a progress bar of some kind showing current/total loop iterations!

        Rama
        Last edited by Rama; 07-21-2014, 02:56 AM.
        100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

        Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

        Comment


          Originally posted by Rama View Post
          Do you know the name of the property as I would find it in the C++ ?

          It's clearly not an ini file setting or you wouldn't need a plugin for it, right?

          I am searching myself now

          Rama
          Here is a link to the plugin I tried getting to work: https://github.com/AndrewScheidecker...perLoopLibrary

          Originally posted by Rama View Post
          What I'd do if I had that intense of an operation would be to break it up into chunks of actions that I do per tick.

          So use for loops instead of for each, and track the indicies

          each tick, process, say 1000 loop iterations, keeping track with a BP-global variable for the current index.

          your goal amount / max for each for loop will be set at the beginning of the tick, to be current index + chunk size.

          then you enter the for loop and iterate, and then, in BP, you will have to manually increment the current index by your chunk size at the end of the tick.

          This is all easy to do if use for loop!

          And if your chunk size is a variable, you can decide over time what chunk size is best for performance!

          I'd say start with 100-1000 range somewheres.


          doesn't your game completely stall when you run all your iterations of all in loops in 1 tick?

          if you break it up can avoid stalling and have a progress bar of some kind showing current/total loop iterations!

          Rama
          That seems like an unnecessary complication just to get around a built-in engine stop light. Realize that my high-end map sizes require 20,000+ tiles. If I were to use my current generation method on a map that size, it would be ~800 million iterations. There are efficiencies to be had on maps that size, but splitting my generator up into hundreds of ForLoops is not one of them.

          In any case, this is a map generator that only runs one time at the beginning of the game. It is not uncommon for these things to take several minutes to complete.
          Map Generator 1.0
          Map Generator 2.0
          Map Generator 3.0

          Comment


            Originally posted by Zeustiak View Post
            but splitting my generator up into hundreds of ForLoops is not one of them.
            I think you misunderstand my method

            You don't write hundreds of for loops!

            You have 1 for loop, that processes a chunk of data every tick

            and you determine the chunk size

            the result is that you can thus have a progress bar as a UI element that gets updated every tick by your chunk size, showing you the progression of the building of your level

            as your levels get larger this will be an important feature, as you dont want your game to hang for several minutes.


            Originally posted by Zeustiak View Post
            In any case, this is a map generator that only runs one time at the beginning of the game. It is not uncommon for these things to take several minutes to complete.
            You might understand what's happening but other users wont, so having a progress bar is really useful!

            I am going to look into the for loop limit itself ofc

            but I am just letting you know you really should consider using a chunk size and not doing the whole thing in a single tick, to avoid hangs.


            I could actually make a plugin that breaks up this work flow for you, where I am organizing the per-tick actions and chunk size

            I could make it a UObject or an Actor that spawns into world (cause I have to store data between ticks), and you could make your current class a subclass of this class.

            What is the class of your current workhorse class where you are doing all this?

            Can it easily have its highest level class reparented to AActor or UObject?

            I would give you a BP Implementable Event where you can run the per-loop cycle actions, whatever they are. The event would return the current index in the loop

            Rama

            PS: I made the node you requested btw

            https://forums.unrealengine.com/show...l=1#post101415
            Last edited by Rama; 07-21-2014, 09:24 PM.
            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

            Comment


              New Node

              Runaway Loop Resetter


              Use this node to get around the max loop iteration count, if you really really need to.

              I don't personally recommend this node unless you absolutely know what you are doing and absolutely need it.

              I personally recommend breaking up your long loops over several ticks, processing a chunk of your total loops per tick.

              You can see my whole opinion on this subject here:

              https://forums.unrealengine.com/show...l=1#post101409


              However since I feel it is my goal to make sure people have maximum Power in Blueprints, here is the node!

              Click image for larger version

Name:	RunawayloopReset.jpg
Views:	1
Size:	143.1 KB
ID:	1052771



              Rama

              PS: this new node is now part of my main download in my original post of this thread
              Last edited by Rama; 07-22-2014, 01:19 AM.
              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

              Comment


                Originally posted by Rama View Post
                I think you misunderstand my method

                You don't write hundreds of for loops!

                You have 1 for loop, that processes a chunk of data every tick

                and you determine the chunk size

                the result is that you can thus have a progress bar as a UI element that gets updated every tick by your chunk size, showing you the progression of the building of your level

                as your levels get larger this will be an important feature, as you dont want your game to hang for several minutes.




                You might understand what's happening but other users wont, so having a progress bar is really useful!

                I am going to look into the for loop limit itself ofc

                but I am just letting you know you really should consider using a chunk size and not doing the whole thing in a single tick, to avoid hangs.
                I was already planning a progress bar, though divided up by function rather than more discrete chunks(IE Sea Level, Elevation, Temperature, Precipitation, Coasts, Rivers, etc). I will keep your idea in mind if individual functions at larger map sizes require it!


                Originally posted by Rama View Post
                I could actually make a plugin that breaks up this work flow for you, where I am organizing the per-tick actions and chunk size

                I could make it a UObject or an Actor that spawns into world (cause I have to store data between ticks), and you could make your current class a subclass of this class.

                What is the class of your current workhorse class where you are doing all this?

                Can it easily have its highest level class reparented to AActor or UObject?

                I would give you a BP Implementable Event where you can run the per-loop cycle actions, whatever they are. The event would return the current index in the loop

                Rama
                That is an interesting offer. I actually do intend to get the heavier pieces of this generator moved into C++ eventually, especially for performance reasons.

                I don't necessarily want to move things into C++ just yet though. Generally because I can't maintain it myself and I am still heavily prototyping. So, I don't want to move it to C++ until I either have to, or I am 100% sure of the route I am taking with a particular system(which would basically be many months from now).

                I saw your post in the Got Skills forum though, so perhaps in the (somewhat distant)future I may hit you up for some C++ work!

                I do appreciate any help you can provide with a plugin to remove the limit though. I haven't been able to create a giant version of my map since the early days of my generator and would like to see how things are holding up performance wise on the larger generations.
                Map Generator 1.0
                Map Generator 2.0
                Map Generator 3.0

                Comment


                  Originally posted by Zeustiak View Post
                  I saw your post in the Got Skills forum though, so perhaps in the (somewhat distant)future I may hit you up for some C++ work!

                  I do appreciate any help you can provide with a plugin to remove the limit though. I haven't been able to create a giant version of my map since the early days of my generator and would like to see how things are holding up performance wise on the larger generations.
                  Whenever you'd like BP or C++ paid assistance let me know!

                  Link to my portfolio
                  https://forums.unrealengine.com/show...ll=1#post92665

                  I love coding stuff in C++ and exposing it for people to use in Blueprints, using just plugins

                  Makes things super easy for people!


                  Here is the node you requested:

                  https://forums.unrealengine.com/show...l=1#post101415

                  Rama
                  100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                  UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                  Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                  Comment


                    Thanks Rama, works like a charm! Actually, I like that you made it into a node because it reminds me how big some of my functions are when they pop me with a loop limit fault at high map sizes.

                    This baby took 1 minute 49 seconds to generate. At least 50 million iterations. 120x60 (7200 tiles, or 1/3 the size of a gigantic map)


                    When I start carving continents and other landmasses into those waters the iteration count should drop, but I have plenty of things coming that will raise it back up again.
                    Map Generator 1.0
                    Map Generator 2.0
                    Map Generator 3.0

                    Comment


                      Originally posted by Zeustiak View Post
                      Thanks Rama, works like a charm! Actually, I like that you made it into a node because it reminds me how big some of my functions are when they pop me with a loop limit fault at high map sizes.

                      This baby took 1 minute 49 seconds to generate. At least 50 million iterations. 120x60 (7200 tiles, or 1/3 the size of a gigantic map)
                      Ooooh wow!

                      Great picture!

                      And a wonderful tool you are making!

                      Looks like it is developing very rapidly!

                      Thanks for sharing Zeustiak!



                      Rama
                      100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                      UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                      Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                      Comment


                        Originally posted by Zeustiak View Post
                        Thanks Rama, works like a charm! Actually, I like that you made it into a node because it reminds me how big some of my functions are when they pop me with a loop limit fault at high map sizes.

                        This baby took 1 minute 49 seconds to generate. At least 50 million iterations. 120x60 (7200 tiles, or 1/3 the size of a gigantic map)


                        When I start carving continents and other landmasses into those waters the iteration count should drop, but I have plenty of things coming that will raise it back up again.
                        That's awesome.

                        There used to be a really neat tool (for another engine) that would generate a hex map like yours, then generate a terrain (customizable size) for each hex based on its biome type. So you'd end up with a bunch of terrains that roughly represent each hex.
                        Storyteller - An immersive VR audiobook player

                        Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

                        Comment


                          Hi Ramas,

                          I was starting to try your Victory Plugin with UE4 4.3 and if gives me this message:
                          "Project modules are missing or out of date. Would you like to recompile them?"

                          I click on yes, and it gives me this other message:
                          "Game code couldn't compule. Continue trying to start anyway?"

                          I click on yes, and it gives this one:
                          "Plugin 'VictoryPlugin' failed to load because module 'VictoryEdEngine' does not appear to be compatible with the current version of the engine. This plugin's functionality will not be available, The plugin may need to be recompiled."

                          And I download this version: 16:49, 17 July 2014
                          Last edited by Alex3d; 07-23-2014, 01:54 PM.
                          BASIC version can also be bought on Marketplace.
                          PRO version can be bought on my site only.
                          www.3dalex.com

                          Comment


                            Originally posted by Alex3d View Post
                            Hi Ramas,

                            I was starting to try your Victory Plugin with UE4 4.3 and if gives me this message:
                            "Project modules are missing or out of date. Would you like to recompile them?"

                            I click on yes, and it gives me this other message:
                            "Game code couldn't compule. Continue trying to start anyway?"

                            I click on yes, and it gives this one:
                            "Plugin 'VictoryPlugin' failed to load because module 'VictoryEdEngine' does not appear to be compatible with the current version of the engine. This plugin's functionality will not be available, The plugin may need to be recompiled."

                            And I download this version: 16:49, 17 July 2014
                            Hi Alex3D!

                            Several things to note:

                            1. My plugin is only guaranteed to work with 4.3 Release, from the UE4 Downloader, not the one from Github

                            2. My plugin will not work in a packaged game, nor will any other plugin apparently, unless you have a c++ project.

                            Others have encountered this issue and it seems Epic must fix this:
                            https://answers.unrealengine.com/que...-packaged.html

                            3. I just tested my plugin (just now), with July 22 version and it worked just fine! No pop ups of any kind

                            4. Are you making sure to put my plugin in your Project/Plugins folder, not in Engine/Plugins ?!

                            5. Zeustiak had no trouble using my 4.3 plugin and his pictures above are proof of that, so clearly there is a correct workflow that can be found, we just have to identify what you are doing differently

                            Please review 1-5 and see what is different in your setup!

                            Rama
                            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                            Comment


                              Thanks for answering.
                              It is working now! And the only thing I did was turn of my computer yesterday, I turn it on today. I tried again and it is working.
                              BASIC version can also be bought on Marketplace.
                              PRO version can be bought on my site only.
                              www.3dalex.com

                              Comment


                                Originally posted by n00854180t View Post
                                That's awesome.

                                There used to be a really neat tool (for another engine) that would generate a hex map like yours, then generate a terrain (customizable size) for each hex based on its biome type. So you'd end up with a bunch of terrains that roughly represent each hex.
                                By terrain, do you mean an equivalent to landscape in UE4? That would be pretty sweet if I could take my map and use landscape to make the terrain look more realistic, but can you even generate landscapes during runtime?
                                Map Generator 1.0
                                Map Generator 2.0
                                Map Generator 3.0

                                Comment

                                Working...
                                X