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

    Originally posted by Rama View Post
    I am unable to repro your issue on 4.11.1 but I'd love to figure out why you are having the experience that you are.
    Rama

    It's definitely the custom build because the vanilla build works just fine. When I created a project folder in the vanilla build with a template project, the Victory plugin registers as installed. However, when I'm running the custom build it fails.

    I've actually downloaded the latest in the Unreal Engine repository and did a clean build of that and then tried using your plugin in a Template project and it fails. So it appears your library might only work with vanilla builds of UE.

    Comment


      Originally posted by majieric View Post
      It's definitely the custom build because the vanilla build works just fine. When I created a project folder in the vanilla build with a template project, the Victory plugin registers as installed. However, when I'm running the custom build it fails.

      I've actually downloaded the latest in the Unreal Engine repository and did a clean build of that and then tried using your plugin in a Template project and it fails. So it appears your library might only work with vanilla builds of UE.
      If you are using a custom engine build, you can just stick my plugin some project that uses the custom build, compile it, and then stick it back in Engine/Plugins

      If you get any errors compiling for project using custom build let me know

      You can't expect me to provide compiled binaries for your custom engine build, and custom UE4 will definitely feel that the plugin needs rebuilding as it wont recognize the launcher version as being its own cause its not

      But if you're compiling custom engine builds you should be able to recompile my plugin just fine!

      Rama
      Last edited by Rama; 04-20-2016, 09:06 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


        hi Rama! I just noticed the substance plugin is on the marketplace, meaning that my launcher notify me when an update to the plugin happens. Made me wonder why you did not submit this fantastic plugin on the marketplace I have no idea if it would make it harder for you or not to update it this way so please don't blame me if i'm proposing something ridiculous :P

        Comment


          I have also tried to use the scene capture save blueprints but they don't really work. I have tried to attach different scene capture objects and save into different formats and folders but nothing works. The output is false no mattr what i do. Any tips?
          Thanks!
          Check out my 2D Platforming Kit!
          Check out my Low Poly Fruits and Vegetables
          Check out my Random Item Generator
          Check out my P
          ixel Platformer Tileset
          Check out my Mesh to Terrain Converter

          Comment


            Rama,

            Are you keeping the github updated because it appears that its not...??? Not sure if I am missing something. I built a custom base build with your source (so I don't have to add to each project) but I had to download from the zip file. Just be easier to grab off of git. Thanks for all your work!

            teak
            "A little bit of nonsense now and then is cherished by the wisest men..."
            -- Willy Wonka

            Smooth Zoom Camera Plugin for 4.22 here.

            Comment


              Originally posted by majieric View Post
              It's definitely the custom build because the vanilla build works just fine. When I created a project folder in the vanilla build with a template project, the Victory plugin registers as installed. However, when I'm running the custom build it fails.

              I've actually downloaded the latest in the Unreal Engine repository and did a clean build of that and then tried using your plugin in a Template project and it fails. So it appears your library might only work with vanilla builds of UE.
              Hi... I use a custom build and it works great with Rama's code... I'm just building a base build with his added code and it works peachy.

              teak
              "A little bit of nonsense now and then is cherished by the wisest men..."
              -- Willy Wonka

              Smooth Zoom Camera Plugin for 4.22 here.

              Comment


                Load Level Instance, Load Multiple Transformed Instances of Same Level, not in Levels List! ♥ Rama

                Click image for larger version

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

                Click image for larger version

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

                Dear Community,

                New: Please note I've now made a pull request for this Node to the Engine! If you'd like to see this in-engine make sure to comment!
                https://forums.unrealengine.com/show...l=1#post518835

                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!

                ~~~

                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;
                 }
                Last edited by Rama; 04-24-2016, 05:28 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


                  oh man, this is cool, thanks, this is much appreciated !!

                  Comment


                    Any update on VictoryEdEngine for UE 4.11? I've read about the issues, and we need it pretty badly for its vertex snap feature

                    Anyway, Rama, you've done an amazing work so far!

                    Comment


                      Hi Rame, SavePixelArray node is saving colors wrong. I was easily able to reproduce this by using your node in the BeginPlay event of a level. Here are some color conversions that the node writes:

                      Given color in [0-1] range -> Saved color in 8bit PNG file

                      0.0 -> 0
                      0.25 -> 137
                      0.5 -> 188
                      0.75 -> 255
                      1.0 -> 255

                      Engine version is 4.11 and I used latest version that you shared via mediafire.
                      Last edited by SalihBalkan; 05-01-2016, 12:00 AM.

                      Comment


                        Victory Ed Engine on 4.11

                        Originally posted by Jacopo Papaccio View Post
                        Any update on VictoryEdEngine for UE 4.11? I've read about the issues, and we need it pretty badly for its vertex snap feature

                        Anyway, Rama, you've done an amazing work so far!
                        Welcome to the forums Jacopo!

                        ~~~

                        Dear Community,

                        I've gotten multiple requests to update the VictoryEdEngine plugin, so here it is!

                        I"ve now updated my Vertex Snap Editor to 4.11!

                        The delay was because the Instance Static Mesh (ISM) portion of the editor was unable to operate after changes made to Instanced Static Mesh Component in 4.11.

                        I've decided to simply disable the ISM feature for now.

                        You can now use the vertex snapping functionality of my Victory Ed Engine plugin in 4.11!

                        https://wiki.unrealengine.com/File:VictoryEdEngine.zip

                        Enjoy!



                        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 SalihBalkan View Post
                          Hi Rame, SavePixelArray node is saving colors wrong. I was easily able to reproduce this by using your node in the BeginPlay event of a level. Here are some color conversions that the node writes:

                          Given color in [0-1] range -> Saved color in 8bit PNG file

                          0.0 -> 0
                          0.25 -> 137
                          0.5 -> 188
                          0.75 -> 255
                          1.0 -> 255

                          Engine version is 4.11 and I used latest version that you shared via mediafire.
                          I am mostly just using UE4 API functions for this, so I am not sure what the cause of the issue is.

                          Here is the relevant portion of the source code for this node:

                          Code:
                          bool UVictoryBPFunctionLibrary::Victory_SavePixels(const FString& FullFilePath,int32 Width, int32 Height, const TArray<FLinearColor>& ImagePixels, FString& ErrorString)
                          {
                          	//Create FColor version
                          	TArray<FColor> ColorArray;
                          	for(const FLinearColor& Each : ImagePixels)
                          	{
                          		ColorArray.Add(Each.ToFColor(true));
                          	} 
                          	 
                          	if(ColorArray.Num() != Width * Height) 
                          	{
                          		ErrorString = "Error ~ height x width is not equal to the total pixel array length!";
                          		return false;
                          	}
                          	  
                          	TArray<uint8> CompressedPNG;
                          	FImageUtils::CompressImageArray( 
                          		Width, 
                          		Height, 
                          		ColorArray, 
                          		CompressedPNG
                          	);
                          	    
                          	return FFileHelper::SaveArrayToFile(CompressedPNG, *FinalFilename);
                          There's not much room here for me to make mistakes of my own, its really just API calls.

                          But clearly something is amiss, I tested saving as a bmp and got the same unusual results as with compressed png:

                          I did a test with 0.25 and got 137 as well, instead of what you'd expect, 63.75 (255 * 0.25).

                          I tested 0.715 and got 220 instead of 182.325

                          The culprit appears to be the ToFColor function:

                          Code:
                          //Create FColor version
                          TArray<FColor> ColorArray;
                          for(const FLinearColor& Each : ImagePixels)
                          {
                          	ColorArray.Add(Each.ToFColor(true)); 
                          	UE_LOG(LogTemp,Error,TEXT("float is %f, byte added as %d"), Each.R, ColorArray.Last().R); 
                          }
                          yields this:

                          Code:
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.250000, byte added as 137
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 1.000000, byte added as 255
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.715000, byte added as 220
                          LogTemp:Error: float is 0.000000, byte added as 0
                          So the conversion you are not enjoying is being done by FLinearColor::ToFColor

                          ToFColor has this sRGB option:

                          Code:
                          /** Quantizes the linear color and returns the result as a FColor with optional sRGB conversion and quality as goal. */
                          FColor FLinearColor::ToFColor(const bool bSRGB) const
                          {
                          The sRGB conversion algorithm can be found in Color.cpp if you want to see it for yourself!

                          When I set that to false then the values you'd expect are returned:

                          Code:
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.250000, byte added as 63
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 1.000000, byte added as 255
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.000000, byte added as 0
                          LogTemp:Error: float is 0.715000, byte added as 183
                          LogTemp:Error: float is 0.000000, byte added as 0

                          You can read about sRGB here:
                          https://en.wikipedia.org/wiki/SRGB


                          I've now made this sRGB conversion optional, and off by default

                          The update will be in my next plugin release



                          Rama

                          Click image for larger version

Name:	SavePixelsExt.jpg
Views:	1
Size:	130.1 KB
ID:	1105728
                          Last edited by Rama; 05-01-2016, 02:12 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


                            VictoryEd 4.11 worked smoothly, thanks again for your work

                            Comment


                              Hi Rama,
                              I have read on GitHub that your level instance loading solution might cause problems in cooked/packaged projects (maybe I misunderstood that comment), but you wrote it was tested.
                              So is there an actual conflict? And if yes, is there a chance to have a workaround for it in future?
                              I started to built on it an important part of my game system (a pseudo random world due to the lack of runtime landscape creation/deformation possibilities), so this feature would be essential for me...
                              thanks.
                              "Age of Total Heroes" - RTS Pathfinding and Movement System for UE4
                              RTS Camera C++ Tutorial

                              Comment


                                NICE JOB RAMA! Thanks a lot to share it!!

                                I just would like to know if there is any BP to execute an external file, it would save my life.

                                i really don't know how to use this "FPlatformProcess::CreateProc(TEXT("C:\\Users\\Cero\\Desktop\\Test.exe"), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);"

                                Comment

                                Working...
                                X