Download

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

Initial tests on Instanced Meshes using VictoryPlugin was same for me, no difference in performance. The Stats panel does see only 1 use of each SM so it is working …

Got it working, and have to agree, not seeing any jump in performance so far. Could it be because the original static meshes are loaded initially anyway, even if they get destroyed and replaced?

Thanks! I will try that out :slight_smile:

Further Instanced Static Mesh Testing

Anyone who has mac could post a mac version of the plugin by adding a single C++ file to the editor and compiling their project.

:slight_smile:

If someone does this and doesnt know where to post it they can PM me and I can post it :slight_smile:

That’s odd, can you confirm that if you use my Editor plugin method instead, which deletes the static mesh actors from the editor world, that there is indeed a performance improvement?

I’ve noticed performance improvements using the editor plugin method, and would be interested to know if you can get a contrasting experience bdtween

  1. the BP node method
  2. the editor plugin method which uses i and SHIFT + i to create/restore the instanced static mesh actor

The problem with #2 is that it does not package, which is why I created solution #1.

Multiple people have reported performance benefits from #2.

So the goal is to find a way to get #1 to cause the same performance gains.

But if anyone can get a scenario going where they see performance gains via #2 and not from #1 that would be great intel

:slight_smile:

Rama

I dont know of a way to compress the texture in memory, no, I hope Epic can help you with this goal.

Once the UTexture2D is loaded from hard disk that is the extent of my ability to easily have control over how it is managed.

If anyone knows of / chooses to research further changes that can be made to the UTexture2D after it has been loaded from file data, to reduce memory footprint, let me know!

Have fun today everyone!

:slight_smile:

Rama

29133cff34e19b6d5f6450f26dd03f0fbc0104a7.jpeg

Get a Hard-drive accurate listing of all Save Game Objects!

Dear Community,

I’ve released a new node that gives you a hard-drive accurate listing of all save game files that you’ve created!

I am referring to UE4’s Save Object system!

You can now access a full listing in a developer build or in a packaged game, to know all the save files that have been saved!

These save files are stored in GameDir/Saved/SaveGames

26bed6e9726e2f5bd0c108371726fef9d0d800a1.jpeg


**UE4 Blueprint Save System?**

If you did not know, you can use UE4's save system like this:

1. Create a new blueprint based on SaveGame
2. Add your variables to the blueprint that you want to save the values of
3. in level BP or some other blueprint, create a save game object, and set the values of that object
4. Save this object to a Save Game Slot, as shown in my pictures
5. You can load a save game object from a Slot name at any time!

6.** Now with my new Victory BP Library, you can obtain a full listing of all existing save games as stored on your computer's hard disk! **This let's you know whether a file exists before you try to load it! You can also find out how many save files exist from within BP!

Most Recent Plugin Download From UE4 Wiki

Enjoy!

:slight_smile:

Rama

Thanks for the help. I am looking into source code of how unreal import Texture assets. If I find any solution I will post it here.
And awesome work creating this great plugin.

Thanks,

Only got to download new version from 01/04/15 now … will test and let you know!

Nice addition being able to see files. Thank you.

By “add a single C++ file” do you mean any old file or something specific? I can compile anything, I just need the source.

J^2

Depending on how we end up implementing custom patches/insignias, I may end up taking care of this.

Kris.

Hey Rama!

You’re doing an amazing job here to the comunity, that’s awesome!

… I was trying your Victory Get Custom Config Var functionality but I looks like it’s not working. It loads random numbers from the config file.

I’m using the Saved\Config\Windows\Game.ini file!

Is there anything wrong?

Thank you!

Ok, I got the ISM node to work. I turned something like 34,000 trees into 1 mesh. Draw calls dropped from 136,000 to ~1500.

I don’t know why it didn’t work the other day, but it seems to do the trick today. Trees kept their LODs and everything seemed to work fine visually.

We seem to have a problem with the trees though, which isn’t necessarily related to your node.

With all those trees instanced in the world using either normal instance, or hierarchical, the FPS is about 4-6. When I use the Victory ISM node the FPS jumps to 15. If I just don’t spawn the trees at all, the FPS is ~55.

I was hoping combining them all into a single ISM would be the answer, but it doesn’t seem to be the case, at least not completely. Will have to investigate possible issues with the trees on this end.

One solution to this is to add an alpha culling in the foliage MAT, i am running some tests at the moment on this.

What is the name of that node in the mat editor?

Posted about this in a separate thread to avoid hijacking this one:

Any advice or tips would be greatly appreciated. Cheers,

J^2

You’re welcome Isaac!

You can add an empty new AActor class with a name of your choosing and that should do the trick, again this should all be different once 4.8 comes along :slight_smile:

I will investigate this as soon as I can! :slight_smile:

Glad to hear there was some improvement, good luck with your tree shader!

Lovely to hear from you Kris, let me know how it goes!

Have fun today everyone!

Rama

**Load Texture 2D From File!

JPG, PNG, BMP, ICO, EXR, and ICNS are Supported File Formats !**

With this node you can load a Texture 2D from a file during runtime!

I output for you the width and height of the loaded image!

Now you can easily create Texture 2D’s from image files in Blueprints, during runtime!

Special Note!

Tim Sweeney liked this node!

Enjoy!

Rama

PS: Make sure to include the file extension when you use this node!

5e04c4d83d602f944fb2cfd946e90787f3b20f70.jpeg


**C++ Code For You**

Here is the core C++ function involved, entire source is in the download! I wrote my own Enum for the file formats.



```


UTexture2D* UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile(const FString& FullFilePath,EJoyImageFormats ImageFormat, bool& IsValid,int32& Width, int32& Height)
{
	IsValid = false;
	UTexture2D* LoadedT2D = NULL;
	
	IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
	
	IImageWrapperPtr ImageWrapper = ImageWrapperModule.CreateImageWrapper(GetJoyImageFormat(ImageFormat));
 
	//Load From File
	TArray<uint8> RawFileData;
	if (!FFileHelper::LoadFileToArray(RawFileData, * FullFilePath)) 
	{
		return NULL;
	}
	
	  
	//Create T2D!
	if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
	{ 
		const TArray<uint8>* UncompressedBGRA = NULL;
		if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
		{
			LoadedT2D = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
			
			//Valid?
			if (!LoadedT2D) 
			{
				return NULL;
			}
			
			//Out!
			Width = ImageWrapper->GetWidth();
			Height = ImageWrapper->GetHeight();
			 
			//Copy!
			void* TextureData = LoadedT2D->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
			FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());
			LoadedT2D->PlatformData->Mips[0].BulkData.Unlock();

			//Update!
			LoadedT2D->UpdateResource();
		}
	}
	 
	// Success!
	IsValid = true;
	return LoadedT2D;
}


```



Download Link (6.5mb)

UE4 Wiki, Plugin Download Page

:slight_smile:

Rama

0f36d3a4f869f97b5c23aa7135946654a25f7c74.jpeg

Victory Absolute Paths!
Live as of March 3rd 2015 build

Get the File Path to your project .exe, your project root directory, and more!

These paths are dynamically updated even if you move the entire project to a new location on your computer!

All these nodes are fully compatible with packaged builds and return absolute paths!

These nodes also work in Development/Editor builds!


**More Power For You in BP**

Now you can easily create your own folders/files, relative to the project root directory or your project's .exe!

Please note that in editor builds, the .exe returns your UE4Editor.exe location, but in packaged games it returns your game's .exe

![ca6e47c3de4ce0fc029accc855a97ab3b66c7f0f.jpeg|1260x774](upload://sSMIRl140vUkZisnTkYGaDdAz4X.jpeg)

Recommendation:

I recommend using the Project Game directory for most of your relative path needs! This works the same in Editor and packaged builds!

You can also get your Saved and Logs folders for your project in both packaged and editor builds!

UE4 Wiki, Plugin Download Page

:heart:

Rama

From the Rama Q&A Desk

Hi there!

I just ran some tests with my Config nodes, and I did not have any issues reloading data properly from config file.

Are you sure that you spelled the section name and var name the same way in both places?

It can help to save the section name and var names as string variables so that you just plug them in, guaranteeing that they are the same :slight_smile:

Please try that and if you still have issues let me or one of my assistants (points to the flying unicorns outside the window) know!

Have fun today!

:slight_smile:

Rama