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

    Vast Performance Improvement to Is Game In Fore Ground of OS

    Dear Community,

    If you didnt know, I offer you a node that allows you to always know if your game is the foreground window in your end user's OS!

    You can track this bool on a timer to know when the user has tabbed out of the game, and then when they tab back in!

    You can use this knowledge to display messages, pause single player games, or throttle usage of resources if your game is no longer in the foreground!

    Just another way to write polite and resource-efficient software, for you, from me!

    Click image for larger version

Name:	IsForeGroundInOS.jpg
Views:	2
Size:	200.2 KB
ID:	1103658

    ~~~

    Performance Improvement

    I am very happy to announce I've vastly improved my internal implementation of this ndoe!

    My code went from this:

    old version
    Code:
    //Iterate Over Actors
    	UWorld* TheWorld = NULL;
    	for ( TObjectIterator<AActor> Itr; Itr; ++Itr )
    	{
    		TheWorld = Itr->GetWorld();
    		if (TheWorld) break;
    		//~~~~~~~~~~~~~~~~~~~~~~~
    	}
    	//Get Player
    	ULocalPlayer* VictoryPlayer = 
                TheWorld->GetFirstLocalPlayerFromController(); 
    
    	if (!VictoryPlayer) return false;
    	//~~~~~~~~~~~~~~~~~~~~
    	
    	//get view port ptr
    	UGameViewportClient * VictoryViewportClient = 
    		Cast < UGameViewportClient > (VictoryPlayer->ViewportClient);
    		
    	if (!VictoryViewportClient) return false;
    	//~~~~~~~~~~~~~~~~~~~~
    	 
    	FViewport * VictoryViewport = VictoryViewportClient->Viewport;
    	
    	if (!VictoryViewport) return false;
    	//~~~~~~~~~~~~~~~~~~~~
    	
        return VictoryViewport->IsForegroundWindow();
    to this!

    new version!
    Code:
    bool UVictoryBPFunctionLibrary::ClientWindow__GameWindowIsForeGroundInOS()
    {  
      return FPlatformProcess::IsThisApplicationForeground();
    }
    The latter is very efficient to call frequently and is operating system independent just like the first version.

    Enjoy!

    New Download (29mb, Media Fire)
    https://www.mediafire.com/?ieovbd5l9d7yub2

    Please note my downloads also include these packaged binaries:

    1. Win64 Development
    2. Win32 Shipping
    3. HTML5 Development

    Please see my instructions for Packaging UE4 Plugins With Your Game.

    Donations can be sent to me via:
    http://lightningfitness.org/donate/



    Rama
    Last edited by Rama; 04-02-2016, 02:15 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


      Sorry for this silly questions, but where is the Download Link for 4.10?
      The download links at http://www.mediafire.com/download/ie...toryPlugin.zip is the 4.11 I'm pretty sure since my UE recognize it as made for future version.

      Comment


        I have an existing project in 4.10.4 that uses the wonderful Victory plugin. I want to upgrade my project to 4.11 and make a standalone dedicated server for which I understand I still need a source built engine. I have compiled the GitHub version of Unreal 4.11 using VS 2015 and it works for new projects, but I can't switch my existing project to 4.11 with the plugin enabled. I looked around for detailed instructions on adding the plugin source to the engine but couldn't find anything that helps me. I get errors when I try to compile the project in VS. When I compile the engine after copying the most recent victoryplugin.zip contents into my /engine/plugins directory, it seems like it almost works but I still get 3 errors. I am probably doing something wrong but I need to know if it is even possible to do this with VS 2015 or do I need VS 2013 for some reason? And what is the proper way to add or compile the plugin source to the engine for someone not very familiar with VS? I think I can continue the process of making a dedicated server once I can get a source built engine to work with the plugin. Any help would be greatly appreciated!

        Comment


          Hi guys, I'm using the sound volume stuff and it works great in editor but I've come to package my game and it doesn't change the volume. Has anyone seen this before and know of a fix? I've tested it in 4.9 and 4.10 if that helps

          Comment


            When I want to build my game for win64 with the Plugin it gives me:
            UnrealBuildTool: UE4-VictoryBPLibrary.lib(VictoryBPLibrary.generated.cpp.obj) : error LNK2005: "public: virtual bool __cdecl UObjectBaseUtility::CanBeInCluster(void)const " (?CanBeInCluster@UObjectBaseUtility@@UEBA_NXZ) is already in UE4-CoreUObject.lib(M
            MainFrameActions: Packaging (Windows (64-bit)): odule.CoreUObject.4_of_4.cpp.obj) defined.


            I am using Win7 and UE4.11 with the mediafire link from the wiki. What do I wrong?

            Comment


              Does anyone have any tips on bringing the VictoryEdEngine to 4.11, or do we need to wait for Rama to update it?

              Comment


                Originally posted by jeffym85 View Post
                Does anyone have any tips on bringing the VictoryEdEngine to 4.11, or do we need to wait for Rama to update it?
                Rama posted above of a 4.11 update in a week or so as of the 2nd

                Is this also able to instance blueprints? Say for EX. the Fence pack from the marketplace?!

                Comment


                  Originally posted by TenzoNakami View Post
                  Sorry for this silly questions, but where is the Download Link for 4.10?
                  The download links at http://www.mediafire.com/download/ie...toryPlugin.zip is the 4.11 I'm pretty sure since my UE recognize it as made for future version.
                  Hi there!

                  The latest update for 4.10 is Feb 6th, 2016

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


                  Originally posted by MTRNord View Post
                  When I want to build my game for win64 with the Plugin it gives me:
                  [I]UnrealBuildTool: UE4-VictoryBPLibrary.lib(VictoryBPLibrary.generated.cpp.obj) : error LNK2005: "public: virtual bool __cdecl UObjectBaseUtility::CanBeInCluster(void)const " (?CanBeInCluster@UObjectBaseUtility@@UEBA_NXZ) is already in UE4-CoreUObject.lib(M
                  MainFrameActions: Packaging (Windows (64-bit)): odule.CoreUObject.4_of_4.cpp.obj) defined.[/

                  I am using Win7 and UE4.11 with the mediafire link from the wiki. What do I wrong?
                  Welcome to the forums MTRNord!

                  I just packaged for 4.11 without any issues, you placed the VictoryPlugin folder inside of Engine/Plugins/Runtime?

                  Originally posted by Death_With_An_H View Post
                  I have an existing project in 4.10.4 that uses the wonderful Victory plugin. I want to upgrade my project to 4.11 and make a standalone dedicated server for which I understand I still need a source built engine. I have compiled the GitHub version of Unreal 4.11 using VS 2015 and it works for new projects, but I can't switch my existing project to 4.11 with the plugin enabled. I looked around for detailed instructions on adding the plugin source to the engine but couldn't find anything that helps me. I get errors when I try to compile the project in VS. When I compile the engine after copying the most recent victoryplugin.zip contents into my /engine/plugins directory, it seems like it almost works but I still get 3 errors. I am probably doing something wrong but I need to know if it is even possible to do this with VS 2015 or do I need VS 2013 for some reason? And what is the proper way to add or compile the plugin source to the engine for someone not very familiar with VS? I think I can continue the process of making a dedicated server once I can get a source built engine to work with the plugin. Any help would be greatly appreciated!
                  Welcome to the forums!

                  When you try to switch engine versions, the plugin wont compile because there are changes from 4.10 to 4.11, which is bit of a loopy situation when you are trying to switch so that you can compile.

                  Exactly what message are you getting while trying to switch engine versions? Is it just saying that VictoryPlugin could not be compiled?

                  Solution1: Have you tried putting the 4.11 plugin code in the plugin folder before trying to switch engine versions?

                  Solution2: If that doesnt work you can disable the plugin by temporarily renaming your Plugins folder to Plugins_, then after your project .sln is generated you can switch the plugin code to 4.11 and recompile your project, switching Plugins_ back to just Plugins

                  I've upgraded multiple projects to 4.11 that use VictoryPlugin so I am sure you will find a way!



                  Rama
                  Last edited by Rama; 04-07-2016, 02:39 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 sgtfluffybutt View Post
                    Hi guys, I'm using the sound volume stuff and it works great in editor but I've come to package my game and it doesn't change the volume. Has anyone seen this before and know of a fix? I've tested it in 4.9 and 4.10 if that helps
                    Hi there!

                    I use my own sound nodes in a packaged game, win32 shipping, and also a mac build, and I've not had an issue.

                    I am in no way proclaiming there could not be an issue here, I am just reporting my own successes as a reference

                    I am using one of the engine default sound classes, Music.

                    Are you using a custom class?

                    Can you try using an engine default sound class and let me know how that goes?

                    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


                      The Issue with ISM Editor ~ Details

                      Originally posted by Rallii View Post
                      Rama posted above of a 4.11 update in a week or so as of the 2nd

                      Is this also able to instance blueprints? Say for EX. the Fence pack from the marketplace?!
                      An update on this:

                      As of 4.11 the system for InstancedStaticMeshComponent is compeletely incompatible with my current implementation, as soon as the ISM actor is created, it looks fine, but if you move it once, all the instances disappear.

                      The only way I could make it work now is to generate a new Blueprint for each ISM that you make, and store it in your project Content folder somewhere.

                      This would alleviate the issue of copy/pasting, but it would mean having a whole bunch of blueprints for each possible ISM combination.

                      If you all think that is okay I can proceed with that, but needless to say generating a bunch of blueprints as you click around the editor and storing them in your content folder will require a lot more coding than the previous implementation required.



                      Rama

                      PS: only alternative would be to write my own version of InstancedStaticMeshComponent which does not have the copy/pasting issue.

                      The issue with this is copying Epic's code into a new set of files, removing the offending few lines of code, and then posting that on the internet in an insecure/public way, which is rather illegal given Epic's EULA.

                      All the code in my plugins is my own, or the code of contributors, so I have not had to worry about offering a public link.

                      So in my mind the only option is generating blueprint assets on the fly whenever you press i to make an ISM actor, unless someone can think of something else!
                      Last edited by Rama; 04-07-2016, 02:22 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


                        3 New Nodes For You ~ Text to Float, Text to Int, Text Is Numeric, With Culture Support!

                        Dear Community,

                        While I was trying to convert numbers inputted into Editable Text Blocks in UMG, I ran into the following:

                        1. user enters 10000
                        2. I convert Text input to string, and then to float, and get 10000
                        3. user enters 10,000, I do the above but I get 10 in code instead.

                        10?!!!

                        I was highly confused

                        Well turns out that when FString gets 10,000 which is converted that way by FText, then comma truncates the FString conversion to float and I end up with 10.

                        This would be compounded by culture setting where user is inclined to enter 10.000,00


                        So!

                        I hereby present you with nodes that convert from FText to Float and Int, with Culture support!

                        See pics!

                        ~~~

                        Culture Support

                        As you can see in my pics I support both 10,000.99 and 10.000,99.

                        If anyone has other versions like 10'000.99 that they need support for, let me know!

                        The option to switch is hidden by default for convenience, just like for print string and FText to number conversions.

                        Enjoy!

                        Click image for larger version

Name:	TextToNum.jpg
Views:	2
Size:	209.0 KB
ID:	1103996

                        Click image for larger version

Name:	TextToNum2.jpg
Views:	2
Size:	184.8 KB
ID:	1103997

                        Click image for larger version

Name:	TextToNum3.jpg
Views:	2
Size:	152.7 KB
ID:	1103998

                        ~~~

                        C++ Code

                        Here is the C++ code for these nodes!

                        Please note the FText's are always passed by const reference for efficiency reasons.

                        Also note that my internal FString formatting code uses ReplaceInline which avoids creating a copy of the string just to replace the symbols, and is thus much more efficient code.

                        Code:
                        UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary")
                        static bool Text_IsNumeric(const FText& Text)
                        {
                        	return Text.IsNumeric();
                        }
                          
                        UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary", meta=(AdvancedDisplay = "1"))
                        static float Text_ToFloat(const FText& Text, bool UseDotForThousands=false)
                        {  
                        	//because commas lead to string number being truncated, FText 10,000 becomes 10 for FString
                        	FString StrFloat = Text.ToString();
                        	TextNumFormat(StrFloat,UseDotForThousands);
                        	return FCString::Atof(*StrFloat); 
                        }  
                        
                        UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary", meta=(AdvancedDisplay = "1"))
                        static int32 Text_ToInt(const FText& Text, bool UseDotForThousands=false)
                        {   
                        	//because commas lead to string number being truncated, FText 10,000 becomes 10 for FString
                        	FString StrInt = Text.ToString();
                        	TextNumFormat(StrInt,UseDotForThousands);
                        	return FCString::Atoi(*StrInt);
                        }
                          
                        static void TextNumFormat(FString& StrNum, bool UseDotForThousands)
                        {
                        	//10.000.000,997
                        	if(UseDotForThousands)
                        	{
                        		StrNum.ReplaceInline(TEXT("."),TEXT(""));	//no dots as they truncate
                        		StrNum.ReplaceInline(TEXT(","),TEXT("."));	//commas become decimal
                        	}
                        	
                        	//10,000,000.997
                        	else
                        	{
                        		StrNum.ReplaceInline(TEXT(","),TEXT(""));  //decimal can stay, commas would truncate so remove
                        	}
                        }
                        New Download (29mb, Media Fire)
                        https://www.mediafire.com/?ieovbd5l9d7yub2

                        Please note my downloads also include these packaged binaries:

                        1. Win64 Development
                        2. Win32 Shipping
                        3. HTML5 Development

                        Please see my instructions for Packaging UE4 Plugins With Your Game.

                        Donations can be sent to me via:
                        http://lightningfitness.org/donate/



                        Rama
                        Last edited by Rama; 04-07-2016, 04:16 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


                          Android build error

                          Hi Rama,

                          first off, thanks for providing such a great plugin for free!

                          My issue: I am trying to do an Android build but that keeps failing with your plugin activated with the following error:

                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: [3/12] clang++.exe Module.VictoryBPLibrary.cpp [armv7-es2]
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: In file included from <built-in>:345:
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: <command line>(76,9) : error: 'WITH_APEX' macro redefined [-Werror,-Wmacro-redefined]
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: #define WITH_APEX 1
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: ^
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: <command line>(73,9) : note: previous definition is here
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: #define WITH_APEX 0
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: ^
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: In file included from <built-in>:345:
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: <command line>(76,9) : error: 'WITH_APEX' macro redefined [-Werror,-Wmacro-redefined]
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: #define WITH_APEX 1
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: ^
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: <command line>(73,9) : note: previous definition is here
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: #define WITH_APEX 0
                          ...
                          MainFrameActions: Packaging (Android (ASTC)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: D:\MyProject\Plugins\VictoryPlugin\Binaries\Android\UE4-VictoryBPLibrary-armv7-es2.a


                          Note: With your plugin disabled the build works.

                          ~ imbakeks
                          Game Site | Forum Thread | Twitter | Facebook

                          Comment


                            Oh I see I put it in the Plugin folder but not in Runtime. I will try that

                            Comment


                              After adding it to the right folder it crashes with the same error. When I add the config line it doesn't even start the editor. Are there any possible ways to fix this?

                              Comment


                                I'm unable to get the victory plugin to build with the 4.11 release version. The VS 2015 build fails immediately with a failed to initialize the engine error.

                                Comment

                                Working...
                                X