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

    Hey Rama, you have these 2 nodes in your plugin:

    Click image for larger version

Name:	f165139ec9.png
Views:	1
Size:	21.2 KB
ID:	1088723
    Click image for larger version

Name:	e5451cc416.png
Views:	1
Size:	15.4 KB
ID:	1088724

    So I can load a Texture from a file and get a PixelArray and I can also get a specific pixel value from a PixelArray, thats awesome. But what I would like to see is to also get the PixelArray from an existing Texture2D or an existing RenderTarget2D. Would that be possible to add as a node? I searched for a way to do this through blueprint and I only found a lot of people asking for how to do it but no answer except "use c++"

    Cheers!
    Easy to use UMG Mini Map on the UE4 Marketplace.
    Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

    Comment


      Hey Rama,

      Did god send you down from the heavens to assist me in making a game that will transcend time and space to deliver the most entertainments we can currently conceive of?

      If yes, thanks!

      Comment


        Originally posted by Sahkan View Post
        I have no idea why it does what it does. This is just a cube exported from blender.

        Edit: I think there are twice v then vn because the cube is not smooth so each edge consider it's faces as seperated meshes. This is why you will see a bigger verts count inside a game engine.
        This is a rather massive project for me to work on at the moment give my current work load, I will keep it in mind though! I think its time for you to do more C++ yourself and then maybe I could help out along the way

        Keep in mind I do offer tutoring sessions in UE4 C++!



        Rama
        Last edited by Rama; 10-06-2015, 03:02 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


          Yes

          Originally posted by maelgrim View Post
          Hey Rama,

          Did god send you down from the heavens to assist me in making a game that will transcend time and space to deliver the most entertainments we can currently conceive of?

          If yes, thanks!
          Yes, and I am pretty sure you came to help many others have fun too!



          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 John Alcatraz View Post
            Hey Rama, you have these 2 nodes in your plugin:

            [ATTACH=CONFIG]59780[/ATTACH]
            [ATTACH=CONFIG]59781[/ATTACH]

            So I can load a Texture from a file and get a PixelArray and I can also get a specific pixel value from a PixelArray, thats awesome. But what I would like to see is to also get the PixelArray from an existing Texture2D or an existing RenderTarget2D. Would that be possible to add as a node? I searched for a way to do this through blueprint and I only found a lot of people asking for how to do it but no answer except "use c++"

            Cheers!
            Thine request is granted, see below!



            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


              Load Pixel or Pixels from Texture 2D to complete Rama's Texture BP Node Suite!

              Dear Community,

              I've now completed my suite of Image BP Nodes!

              You can now get a single pixel or the entire pixel array from a Texture2D!

              1. Get Pixel From T2D
              2. Get Pixels Array From T2D!

              I've tested and verified that these nodes work with all my other pixel nodes, including:

              1. Get Pixel (By Coordinates, Row,Col)
              2. Save Pixels To File
              3. Load Image From File

              Yay!

              ~~~

              Image Made Via Victory BP Library

              Here I make a 3x3 image and set several color values.

              I use my Victory BP Library to save these pixels to a file on my computer, creating my own PNG image!

              Click image for larger version

Name:	GraphForImageCreatedForLoadPixelsFromT2D.jpg
Views:	1
Size:	234.2 KB
ID:	1090813

              ~~~

              Get Pixels From T2D!

              Here I am now retrieving the pixel values of a T2D that was just loaded from disk, loaded from the file that I saved in the picture above!

              Click image for larger version

Name:	LoadPixelsFromT2D.jpg
Views:	1
Size:	328.2 KB
ID:	1090814

              It woorks, Woohoo!

              Now you can Get Pixels from Texture2D's too!



              Rama

              ~~~

              Latest plugin download on the UE4 Wiki:
              https://wiki.unrealengine.com/File:VictoryPlugin.zip

              Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki:
              https://wiki.unrealengine.com/File:V...inPackaged.zip

              Editor binaries and Packaged binaries in one file:
              Win32 Shipping and Win64 Development Supported
              https://www.mediafire.com/?g6uf9kt5ueb2upj

              Donations:
              Donate to Rama



              Rama
              Last edited by Rama; 10-06-2015, 04:27 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


                Awesome, thanks Rama

                There is just the problem that the "GetPixelFromT2D" node does not work with RenderTarget2Ds unfortunately... Could you support RT or is there anything which would prevent the node from accessing the information out of a RT?
                Easy to use UMG Mini Map on the UE4 Marketplace.
                Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                Comment


                  Originally posted by John Alcatraz View Post
                  Awesome, thanks Rama

                  There is just the problem that the "GetPixelFromT2D" node does not work with RenderTarget2Ds unfortunately... Could you support RT or is there anything which would prevent the node from accessing the information out of a RT?
                  That will require more research, in the meantime please enjoy the fact that you can now read the pixels of Texture 2D's loaded from file!



                  Rama

                  Click image for larger version

Name:	LoadPixelsFromT2D.jpg
Views:	1
Size:	328.2 KB
ID:	1090814
                  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
                    That will require more research, in the meantime please enjoy the fact that you can now read the pixels of Texture 2D's loaded from file!

                    I am absolutely enjoying it and I'm sure a lot of other people do it too since it makes the whole image BP nodes a lot more complete

                    I have an other question, I had to compile 4.9.2 myself to add a very small fix (only a few lines of code) but now when I start the project I get this:

                    Click image for larger version

Name:	9c3758003d.png
Views:	1
Size:	12.3 KB
ID:	1091034

                    What do I have to do to make it work with a custom version of 4.9.2?

                    Edit: I compiled the plugin myself and now it works
                    Last edited by John Alcatraz; 10-09-2015, 09:33 PM.
                    Easy to use UMG Mini Map on the UE4 Marketplace.
                    Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                    Comment


                      Originally posted by Rama View Post
                      This is a rather massive project for me to work on at the moment give my current work load, I will keep it in mind though! I think its time for you to do more C++ yourself and then maybe I could help out along the way

                      Keep in mind I do offer tutoring sessions in UE4 C++!



                      Rama
                      I'v just played a around with the proceduralMesh component in blueprint. The annoying thing is getting the triangles indexes array right.
                      I want to add the the ability to make walls with this component in my MapBuilder.
                      Is there any chance you add a node to your plugin that extrudes triangles like you would it 3ds max?
                      Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

                      Comment


                        Originally posted by John Alcatraz View Post
                        Edit: I compiled the plugin myself and now it works
                        Nice work John Alcatraz!



                        Rama

                        Originally posted by Sahkan View Post
                        Is there any chance you add a node to your plugin that extrudes triangles like you would it 3ds max?
                        I've not yet worked on extrusion due to time constraints, but if you choose to let me know what you come up with!



                        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


                          Dear Community,

                          The code in this node was first presented by Epic staff, Marc Audy, as code used in Fortnite.

                          I've fully implemented the code as well as making it user-friendly.

                          In particular I've presented a solution for ensuring you can spawn multiple instances of the same UE4 level, by giving you an "Instance Number" that you should increment each time you spawn an instance of a level.

                          This allows me to enable you to easily create as many uniquely translated and rotated instances of a level as you want!

                          This is ideal for Dynamic Level Generation!

                          ~~~

                          Click image for larger version

Name:	LoadLevelInst_BeforeAfter.jpg
Views:	6
Size:	340.5 KB
ID:	1088240

                          Click image for larger version

Name:	LoadLevelInst_Graph.jpg
Views:	3
Size:	291.1 KB
ID:	1088241

                          ~~~

                          Can Include Landscapes and Other Fancy Level Features!

                          In my demo I included a landscape in my level "tile."

                          ~~~

                          Level Scripting / Level Blueprint

                          You can also include level scripting that will run uniquely per level isntance!

                          ~~~

                          Victory Load Level Instance

                          Click image for larger version

Name:	LoadLevelInst_BPNode.jpg
Views:	5
Size:	269.2 KB
ID:	1088242

                          ~~~

                          Latest plugin download on the UE4 Wiki:
                          https://wiki.unrealengine.com/File:VictoryPlugin.zip

                          Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki:
                          https://wiki.unrealengine.com/File:V...inPackaged.zip

                          ~~~

                          Victory Plugin on Media Fire

                          If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!

                          Please note clicking this link will not start a download instantly, it will just take you to the Media Fire file description.

                          Editor binaries and Packaged binaries in one file:
                          Win32 Shipping and Win64 Development Supported
                          https://www.mediafire.com/?g6uf9kt5ueb2upj

                          ~~~

                          Note on Packaging Victory Plugin

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

                          Enjoy!



                          Rama
                          Last edited by Rama; 10-10-2015, 10:03 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


                            Originally posted by Rama View Post
                            [ATTACH=CONFIG]58625[/ATTACH]

                            [ATTACH=CONFIG]58626[/ATTACH]

                            Dear Community,

                            The code in this node was first presented by Epic staff, Marc Audy, as code used in Fortnite.

                            I've fully implemented the code as well as making it user-friendly.

                            In particular I've presented a solution for ensuring you can spawn multiple instances of the same UE4 level, by giving you an "Instance Number" that you should increment each time you spawn an instance of a level.

                            This allows me to enable you to easily create as many uniquely translated and rotated instances of a level as you want!

                            This is ideal for Dynamic Level Generation!

                            ~~~

                            Can Include Landscapes and Other Fancy Level Features!

                            In my demo I included a landscape in my level "tile."

                            ~~~

                            Level Scripting / Level Blueprint

                            You can also include level scripting that will run uniquely per level isntance!

                            ~~~

                            Victory Load Level Instance

                            [ATTACH=CONFIG]58627[/ATTACH]

                            ~~~

                            C++ Code For You

                            Here's my implemenation of the code Marc Audy originally presented to the Community, exactly as it is in my Victory BP Library:

                            Code:
                            bool UVictoryBPFunctionLibrary::VictoryLoadLevelInstance(
                            	UObject* WorldContextObject, 
                            	FString MapFolderOffOfContent, 
                            	FString LevelName, 
                            	int32 InstanceNumber,
                            	FVector Location, FRotator Rotation)
                            {
                                if(!WorldContextObject) return false;
                            	 
                            	UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
                            	if(!World) return false;
                            	//~~~~~~~~~~~
                             
                            	//Full Name
                            	FString FullName = "/Game/" + MapFolderOffOfContent + "/" + LevelName;
                            	  
                            	FName LevelFName = FName(*FullName);
                                FString PackageFileName = FullName;   
                            	
                                ULevelStreamingKismet* StreamingLevel = NewObject<ULevelStreamingKismet>((UObject*)GetTransientPackage(), ULevelStreamingKismet::StaticClass());
                             
                            	if(!StreamingLevel)
                            	{
                            		return false;
                            	}
                            	
                            	//Long Package Name
                            	FString LongLevelPackageName = FPackageName::FilenameToLongPackageName(PackageFileName);
                            	
                            	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            	// Here is where a unique name is chosen for the new level asset
                            	//    Ensure unique names to gain ability to have multiple instances of same level!
                            	//	   <3 Rama
                            	
                            	//Create Unique Name based on BP-supplied instance value
                            	FString UniqueLevelPackageName = LongLevelPackageName;
                            	UniqueLevelPackageName += "_VictoryInstance_" + FString::FromInt(InstanceNumber);
                                 
                                //Set!
                                StreamingLevel->SetWorldAssetByPackageName(FName(*UniqueLevelPackageName));
                            	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            	 
                                if (World->IsPlayInEditor())
                                {
                                    FWorldContext WorldContext = GEngine->GetWorldContextFromWorldChecked(World);
                                    StreamingLevel->RenameForPIE(WorldContext.PIEInstance);
                                }
                             
                                StreamingLevel->LevelColor = FColor::MakeRandomColor();
                                StreamingLevel->bShouldBeLoaded = true;
                                StreamingLevel->bShouldBeVisible = true;
                                StreamingLevel->bShouldBlockOnLoad = false;
                                StreamingLevel->bInitiallyLoaded = true;
                                StreamingLevel->bInitiallyVisible = true;
                             
                            	//Transform
                                StreamingLevel->LevelTransform = FTransform(Rotation,Location);
                             
                                StreamingLevel->PackageNameToLoad = LevelFName;
                                      
                                if (!FPackageName::DoesPackageExist(StreamingLevel->PackageNameToLoad.ToString(), NULL, &PackageFileName))
                                {        
                                    return false;
                                }
                              
                            	//~~~
                            	
                            	//Actual map package to load
                            	StreamingLevel->PackageNameToLoad = FName(*LongLevelPackageName);
                            	
                            	//~~~
                            	
                                // Add the new level to world.
                                World->StreamingLevels.Add(StreamingLevel);
                                 
                                return true;
                             }
                            ~~~

                            Latest plugin download on the UE4 Wiki:
                            https://wiki.unrealengine.com/File:VictoryPlugin.zip

                            Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki:
                            https://wiki.unrealengine.com/File:V...inPackaged.zip

                            ~~~

                            Victory Plugin on Media Fire

                            If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!

                            Please note clicking this link will not start a download instantly, it will just take you to the Media Fire file description.

                            Editor binaries and Packaged binaries in one file:
                            Win32 Shipping and Win64 Development Supported
                            https://www.mediafire.com/?g6uf9kt5ueb2upj

                            ~~~

                            Note on Packaging Victory Plugin

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

                            Enjoy!



                            Rama
                            Thanks for this Rama. I've been working on my own similar solution for the last few weeks in my spare time and while I got something working I find your method a better implementation than what I had going.

                            The only thing I notice is that the level loaded callback doesn't seem to work when using your method. Do you have any idea why this is? Right now I use that to determine when all the levels are loaded and streamed in so I can do the next step in my process.

                            Here is my original function in which the callback did fire.

                            Code:
                            
                            void ADreamProjectGameMode::SetupNonStreamingLevelLoad()
                            {  
                            	auto positionOffset = FVector();
                            	auto mapNames = GetAllMapNames();
                            	for (auto mapName : mapNames)
                            	{ 
                            		FString fullMapPath = FString::Printf(TEXT("/Game/Rooms/Maps/%s"), *mapName);
                            		UE_LOG(LogTemp, Warning, TEXT("Loading level %s"), *fullMapPath); 
                            		ULevelStreaming* pStreaming = UGameplayStatics::GetStreamingLevel(GetWorld(), *fullMapPath);
                            
                            		if (pStreaming)
                            		{
                            			UE_LOG(LogTemp, Warning, TEXT("Streaming level setup for %s with transform offset of %f "), *fullMapPath, positionOffset.Y);
                            			//pStreaming->LevelTransform = FTransform(positionOffset); 
                            			pStreaming->bShouldBeLoaded = true;
                            			pStreaming->bShouldBeVisible = true;
                            			pStreaming->OnLevelLoaded.AddDynamic(this, &ADreamProjectGameMode::OnLevelLoaded);
                            			numLevelsToLoad++;
                            			positionOffset.X += 10;
                            		}
                            		else
                            		{
                            			UE_LOG(LogTemp, Warning, TEXT("Unable toload map %s"), *fullMapPath);
                            		}
                            	} 
                            }

                            Comment


                              So a followup. I did manage to get the callback firing. I had upgraded my engine and it seemed to no longer like UFUNCTION being on a private method so I removed the markup. I didn't realize that was a prerequisite for using delegates.

                              That said I'm still suffering one issue where the transform applied to the streaming level does nothing. I can get the level to transform if I do it after the level is loaded via a function who's name escapes me right now (ULevel member function called applytransform or something to that effect) but I get a lot of warnings about transforming static objects. My hopes were that applying the transform to the streaming level before it's loaded would avoid those warnings. I'm not sure how critical they are but nevertheless I don't like to have a lot of warnings.

                              I'm considering just authoring the different rooms in my level at non-overlapping positions and doing away with the whole transformation stuff for now because this issue is taking my time away from actually working on my game and since this is more of a small learning project for me it's not absolutely critical that I author all rooms at 0,0,0 (although in a real project this would indeed be critical).

                              So between both Rama's method and my method not seeming to use the level transform my guess is that something about the way I've authored my levels is causing the streaming transform to get ignored. I'll post back if I can figure out why this is.

                              Comment


                                Originally posted by AlexM View Post
                                So between both Rama's method and my method not seeming to use the level transform my guess is that something about the way I've authored my levels is causing the streaming transform to get ignored. I'll post back if I can figure out why this is.
                                Did you add this line to my version to trigger the delegate?

                                Code:
                                pStreaming->OnLevelLoaded.AddDynamic(this, &ADreamProjectGameMode::OnLevelLoaded);
                                it would go here:

                                Code:
                                    StreamingLevel->LevelColor = FColor::MakeRandomColor();
                                    StreamingLevel->bShouldBeLoaded = true;
                                    StreamingLevel->bShouldBeVisible = true;
                                    StreamingLevel->bShouldBlockOnLoad = false;
                                    StreamingLevel->bInitiallyLoaded = true;
                                    StreamingLevel->bInitiallyVisible = true;
                                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

                                Working...
                                X