YohanR
(Yohan)
April 2, 2015, 9:13pm
771
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
the BP node method
the editor plugin method which uses i and SHIFT + i to create/restore the instanced static mesh actor
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
Kris
(Kris)
April 3, 2015, 5:48am
774
Depending on how we end up implementing custom patches/insignias, I may end up taking care of .
.
Hey !
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!
Zeustiak
(Zeustiak)
April 3, 2015, 12:10pm
776
Ok, I got the ISM node to work. I turned something like 34,000 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. kept their LODs and everything seemed to work fine visually.
We seem to have a problem with the though, which isn’t necessarily related to your node.
With those 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 at , the FPS is ~55.
I was hoping combining them 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 on end.
YohanR
(Yohan)
April 3, 2015, 12:45pm
777
We seem to have a problem with the though, which isn’t necessarily related to your node.
With those 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 at , the FPS is ~55.
I was hoping combining them 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 on end.
One solution to is to add an alpha culling in the foliage MAT, i am running some tests at the moment on .
Zeustiak
(Zeustiak)
April 4, 2015, 12:11am
778
What is the name of that node in the mat editor?
Posted about in a separate thread to avoid hijacking one:
Any advice or tips would be greatly appreciated. Cheers,
J^2
Rama
(Rama)
April 6, 2015, 5:56am
780
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 should be different once 4.8 comes along
Hey !
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!
I will investigate as soon as I can!
Ok, I got the ISM node to work. I turned something like 34,000 into 1 mesh. Draw calls dropped from 136,000 to ~1500.
With those 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 at , the FPS is ~55.
Glad to hear there was some improvement, good luck with your tree shader!
Lovely to hear from you , let me know how it goes!
Have fun today everyone!
Rama
(Rama)
April 6, 2015, 6:00am
781
**Load Texture 2D From File!
JPG, PNG, BMP, ICO, EXR, and ICNS are Supported File Formats !**
With 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!
Sweeney liked node !
Enjoy!
PS: Make sure to include the file extension when you use node!
**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
After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...
Reading time: 1 mins 🕑
Likes: 20 ❤
Rama
(Rama)
April 9, 2015, 6:07pm
782
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!
** 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! 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
After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...
Reading time: 1 mins 🕑
Likes: 20 ❤
Rama
(Rama)
April 9, 2015, 6:40pm
783
From the Q&A Desk
Hey !
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!
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
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!
, you’ve definitely been inspiring to us as we play with Unreal 4!
SaxonRah
(SaxonRah)
April 10, 2015, 8:06am
785
Dear Community,
Community member SaxonRah has gifted us with a whole new set of Randomization nodes!
Check out these pics!
&stc=1
&stc=1
**Latest Version of My Plugin Has The Additions**
https://wiki.unrealengine.com/File:VictoryPlugin.zip
C++ Code
Here is the C++ code for SaxonRah’s additions to my Victory BP Library
.h
/** Seed Rand with value passed
* @param seed - value to pass to the prng as the seed
*/
UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Random")
static void seedRand(int32 seed);
/** Seed Rand with current
*/
UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Random")
static void seedRandWithTime();
/** Seed Rand with entropy
* @param seed - value to pass to the prng as the seed
*/
UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Random")
static void seedRandWithEntropy();
/** Random Bool - Bernoulli distribution
* @param fBias - Bias of Bernoulli distribution
* @return uniformly distributed bool based on bias parameter
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static bool RandBool_Bernoulli(float fBias);
/** Random Integer - Zero to One Uniform distribution
* @return int32 - uniform distribution from 0 to 1
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static int32 RandInt_uniDis();
/** Random Integer - MIN to Uniform distribution
* @param iMin - Minimum value of uniform distribution
* @param iMax - Maximum value of uniform distribution
* @return int32 - uniform distribution from iMin to iMax parameters
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static int32 RandInt_MINMAX_uniDis(int32 iMin, int32 iMax);
/** Random Double - Zero to One Uniform distribution
* @return double - uniform distribution from 0 to 1
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static float RandFloat_uniDis();
/** Random Double - Uniform distribution based on MIN to parameters
* @param fMin - Minimum value of uniform distribution
* @param fMax - Maximum value of uniform distribution
* @return double - uniform distribution from fMin to fMax parameters
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static float RandFloat_MINMAX_uniDis(float fMin, float fMax);
/** Random Bool - Bernoulli distribution - Mersenne Twister
* @param fBias - Bias of Bernoulli distribution
* @return uniformly distributed bool based on bias parameter
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static bool RandBool_Bernoulli_MT(float fBias);
/** Random Integer - Zero to One Uniform distribution - Mersenne Twister
* @return int32 - uniform distribution from 0 to 1
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static int32 RandInt_uniDis_MT();
/** Random Integer - MIN to Uniform distribution - Mersenne Twister
* @param iMin - Minimum value of uniform distribution
* @param iMax - Maximum value of uniform distribution
* @return int32 - uniform distribution from iMin to iMax parameters
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static int32 RandInt_MINMAX_uniDis_MT(int32 iMin, int32 iMax);
/** Random Float - Zero to One Uniform distribution - Mersenne Twister
* @return float - uniform distribution from 0 to 1
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static float RandFloat_uniDis_MT();
/** Random Float - Uniform distribution based on MIN to parameters - Mersenne Twister
* @param fMin - Minimum value of uniform distribution
* @param fMax - Maximum value of uniform distribution
* @return float - uniform distribution from fMin to fMax parameters
*/
UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Random")
static float RandFloat_MINMAX_uniDis_MT(float fMin, float fMax);
.cpp
/**
* Contributed by: SaxonRah
* Better random numbers. Seeded with a random device. if the random device's entropy is 0; defaults to current for seed.
* can override with seed functions;
*/
//----------------------------------------------------------------------------------------------BeginRANDOM
std::random_device rd;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 rand_MT;
std::default_random_engine rand_DRE;
/** Construct a random device and set seed for engines dependent on entropy */
void UVictoryBPFunctionLibrary::constructRand()
{
seed = std::chrono::system_clock::now().time_since_epoch().count();
if (rd.entropy() == 0)
{
seedRand(seed);
}else{
seedRand(rd());
}
}
/** Set seed for Rand */
void UVictoryBPFunctionLibrary::seedRand(int32 _seed)
{
seed = _seed;
}
/** Set seed with for Rand */
void UVictoryBPFunctionLibrary::seedRandWithTime()
{
seed = std::chrono::system_clock::now().time_since_epoch().count();
}
/** Set seed with entropy for Rand */
void UVictoryBPFunctionLibrary::seedRandWithEntropy()
{
seedRand(rd());
}
/** Random Bool - Bernoulli distribution */
bool UVictoryBPFunctionLibrary::RandBool_Bernoulli(float fBias)
{
std::bernoulli_distribution dis(fBias);
return dis(rand_DRE);
}
/** Random Integer - Uniform distribution */
int32 UVictoryBPFunctionLibrary::RandInt_uniDis()
{
std::uniform_int_distribution<int32> dis(0, 1);
return dis(rand_DRE);
}
/** Random Integer - Uniform distribution */
int32 UVictoryBPFunctionLibrary::RandInt_MINMAX_uniDis(int32 iMin, int32 iMax)
{
std::uniform_int_distribution<int32> dis(iMin, iMax);
return dis(rand_DRE);
}
/** Random Float - Zero to One Uniform distribution */
float UVictoryBPFunctionLibrary::RandFloat_uniDis()
{
std::uniform_real_distribution<float> dis(0, 1);
return dis(rand_DRE);
}
/** Random Float - MIN to Uniform distribution */
float UVictoryBPFunctionLibrary::RandFloat_MINMAX_uniDis(float fMin, float fMax)
{
std::uniform_real_distribution<float> dis(fMin, fMax);
return dis(rand_DRE);
}
/** Random Bool - Bernoulli distribution - Mersenne Twister */
bool UVictoryBPFunctionLibrary::RandBool_Bernoulli_MT(float fBias)
{
std::bernoulli_distribution dis(fBias);
return dis(rand_MT);
}
/** Random Integer - Uniform distribution - Mersenne Twister */
int32 UVictoryBPFunctionLibrary::RandInt_uniDis_MT()
{
std::uniform_int_distribution<int32> dis(0, 1);
return dis(rand_MT);
}
/** Random Integer - Uniform distribution - Mersenne Twister */
int32 UVictoryBPFunctionLibrary::RandInt_MINMAX_uniDis_MT(int32 iMin, int32 iMax)
{
std::uniform_int_distribution<int32> dis(iMin, iMax);
return dis(rand_MT);
}
/** Random Float - Zero to One Uniform distribution - Mersenne Twister */
float UVictoryBPFunctionLibrary::RandFloat_uniDis_MT()
{
std::uniform_real_distribution<float> dis(0, 1);
return dis(rand_MT);
}
/** Random Float - MIN to Uniform distribution - Mersenne Twister */
float UVictoryBPFunctionLibrary::RandFloat_MINMAX_uniDis_MT(float fMin, float fMax)
{
std::uniform_real_distribution<float> dis(fMin, fMax);
return dis(rand_MT);
}
I know it’s not a riveting change but i notice i failed to use proper var names for the float variables. It should be better now.
Rama
(Rama)
April 10, 2015, 5:30pm
786
Hee hee!
Play and fun are the goal!
Rama
(Rama)
April 10, 2015, 5:30pm
787
** Taking BP Node Requests**
Does anyone have any BP node requests?
should be simple utility stuff that could be applicable to many projects.
Functionality you’d eventually like to see added to the engine if possible.
Let me know!
** Taking BP Node Requests**
Does anyone have any BP node requests?
should be simple utility stuff that could be applicable to many projects.
Functionality you’d eventually like to see added to the engine if possible.
Let me know!
Hi ,
Is it possible to take the Pawn Sensing function under actors and make it where it can see 360 degrees around? Right now it seems to be locked at 90 degrees. I’m sure it makes sense for a human to not have peripheral vision going to the back of there head however maybe other creatures may have eyes on the back of there head.
Also,
Screen Brightness or Gamma. Not sure if can be already.
How difficult would it be to add a node that can present 2d image data (aka textures) as an array of vector4s? I would imagine that functionality would be very useful for a lot of people. Just a thought. Cheers,
J^2
Rama
(Rama)
April 12, 2015, 3:07pm
790
For 360 awareness you can use something much simpler, just a distance check! You just want to get actors of class and do a vector length squared check with your AI unit
Let me know if works!
Ah yes, that is on my list
What do you mean by Vector4s? Are you talking about the Material Editor now? Even though it looks like blueprints that is a completely different system that I cannot so easily add nodes to If you meant something else let me know!
Do you mean Linear Color when you say Vector4?
You want an image turned into an array of Linear Colors?
Any other requests anyone?
:)