# RHIGetAvailableResolutions works in a Packaged Game in c++ but not when used in a BP node via plugin. The BP Plugin version works in Editor builds

**URL:** <https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 30, 2014, 9:40pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115 "2014-06-30T21:40:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [June 30, 2014, 9:40pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/1 "2014-06-30T21:40:18Z")

</div>

Dear Friends at Epic,

The situation here is a little complicated.

I made a node in my VictoryBPLibrary plugin so that people can get a list of available screen resolutions in Blueprints, as this functionality does not seem to be in blueprints.

The BP node works great in pre-shipping builds! Everyone has confirmed that.

But when the game is packaged, even with the appropriate Build CS public dependency additions of **RHI** and **RenderCore** , the node does not work!

The game packages just fine, but in both Development and Shipping packaged builds, the node does not work!

#Build CS Clarity

Just to be clear, in my very own project where I had to be able to compile the CPP version, by adding the RHI public dependency, it is this same project that I added the BP plugin version that is not working.

So it is not a Build CS issue, since I compiled both the CPP and the BP plugin and Packaged all using the same Build CS

#CPP and BP Versions Tested About 1 Second Apart, Only 1 Works

I did the following:

I composed a CPP test in a packaged game that activates on key press.

I also included my own blueprint node as part of my plugin, included with the packaged project.

When I press the key to test the BP node, it returns false. **As you can see in code below, that means that RHIGetAvailableResolutions itself is returning false!**

Then I press the key to run the CPP version, and it WORKS !!

Somehow the BP node usage of RHIGetAvailableResolutions is returning false, while in the same exact test, about 1 second later, then CPP version returns true, and spits out all my computer’s screen resolutions!

How is this possible?

#Repro

If you’d like to test my Plugin version yourself, you can download my plugin here!

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> 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...

The above link is not a direct link, it takes you to my wiki page

#CPP Test

In packaged game, this works perfectly!

```
void AJoyPCEditor::RamaTests()
{
	FScreenResolutionArray Resolutions;
	if(RHIGetAvailableResolutions(Resolutions, false))
	{
		TArray<FString> Unique;	
		
		for (const FScreenResolutionRHI& EachResolution : Resolutions)
		{
			FString Str = "";
			Str += FString::FromInt(EachResolution.Width);
			Str += " " + FString::FromInt(EachResolution.Height);
			Str += " " + FString::FromInt(EachResolution.RefreshRate);
			
			
			if(Unique.Contains(Str))
			{
				//Skip! This is duplicate!
				continue;
			}
			else
			{
				//Add to Unique List!
				Unique.AddUnique(Str);
			}
			
			//Add to Actual Data Output!
			VShow(Str);
		}
	}
	else
	{
		VShow("RHIGetAvailableResolutions returned false!!!!!!");
	}
}

```

#BP Node

In Editor Builds, this works perfectly!

**In a packaged game it returns false!!!**  
(tested by me and Midnight on different computers, for both dev and shipping packaged game)

**This means that RHIGetAvailableResolutions itself is returning false within the BP node code, for some reason!**

```
bool UVictoryBPFunctionLibrary::OptionsMenu__GetDisplayAdapterScreenResolutions(TArray<int32>& Widths, TArray<int32>& Heights, TArray<int32>& RefreshRates,bool IncludeRefreshRates)
{
	//Clear any Previous
	Widths.Empty();
	Heights.Empty();
	RefreshRates.Empty();
	
	TArray<FString> Unique;	
	
	FScreenResolutionArray Resolutions;
	if(RHIGetAvailableResolutions(Resolutions, false))
	{
		for (const FScreenResolutionRHI& EachResolution : Resolutions)
		{
			FString Str = "";
			Str += FString::FromInt(EachResolution.Width);
			Str += FString::FromInt(EachResolution.Height);
			
			//Include Refresh Rates?
			if(IncludeRefreshRates)
			{
				Str += FString::FromInt(EachResolution.RefreshRate);
			}		
			
			if(Unique.Contains(Str))
			{
				//Skip! This is duplicate!
				continue;
			}
			else
			{
				//Add to Unique List!
				Unique.AddUnique(Str);
			}
			
			//Add to Actual Data Output!
			Widths.Add( EachResolution.Width);
			Heights.Add( EachResolution.Height);
			RefreshRates.Add(	EachResolution.RefreshRate);
		}

		return true;
	}
	return false;
}

```

#The Ultimate Goal

My real goal is to give BP users the ability to get a list of all screen resolutions without having to use CPP / have a c++ programmer on their team!

Any ideas?

And why would RHIGetAvailableResolutions work

- in BP in Editor Builds
- In CPP all the time

and not work in a packaged game as a BP node?

#Thanks

Thanks!

This issue isn’t really something that affects me, I am trying to help everyone else with this one.

---

<div class="post-metadata">

**Author:** ![Midnight640](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Midnight640](https://forums.unrealengine.com/u/Midnight640)\
**Post date:** [July 1, 2014, 7:16pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/2 "2014-07-01T19:16:24Z")

</div>

Thanks for posting in such detail.

All I can say is my config in which the plugin **did not** work:

- 2x GTX570 in SLI 1 monitor active 2  
disabled

- SLI OFF 3 monitors active (not  
surround)

- SLI OFF 1 monitor active 2 unplugged

- NV SURROUND 3 monitors as one

In all the cases the plugin worked when playing in editor !

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [July 3, 2014, 7:40pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/3 "2014-07-03T19:40:53Z")

</div>

Same here. Works in editor, but not in packaged standalones.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [July 14, 2014, 4:37pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/4 "2014-07-14T16:37:16Z")

</div>

#Epic?

Any sort of response to this Epic? Working on it? Busy with 4.3? On Vacation? its been 15 days now 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [July 16, 2014, 1:56pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/5 "2014-07-16T13:56:47Z")

</div>

Hi ,

I have sent this information to the development team for further investigation. I hope to hear back from someone there soon regarding this issue.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [July 16, 2014, 11:57pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/6 "2014-07-16T23:57:50Z")

</div>

Thanks so much !

#❤

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [August 8, 2014, 9:35pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/7 "2014-08-08T21:35:43Z")

</div>

#Epic?

I got 's initial response but I’ve heard nothing since, any update on this?

Why RHI get resolutions is not working when called from BP in a packaged game?

You can use my Victory BP Library to test this!

[(39) 's Extra Blueprint Nodes for You as a Plugin, No C++ Required! - Blueprint - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?3851-(39)--s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required)!

Let me know!

---

<div class="post-metadata">

**Author:** ![Midnight640](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Midnight640](https://forums.unrealengine.com/u/Midnight640)\
**Post date:** [August 10, 2014, 5:03am UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/8 "2014-08-10T05:03:05Z")

</div>

or just integrate it. Even in your livestream [- YouTube](https://www.youtube.com/watch?v=FaBJYFhP5yo&list=UUBobmJyzsJ6Ll7UbfhI4iwQ) people think this could be useful.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [August 16, 2014, 3:36pm UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/9 "2014-08-16T15:36:38Z")

</div>

#Resolved

I have tested and in 4.4 this issue has been resolved!

I can now call RHI Get Screen Resolutions in a BP node in a plugin, in 4.4!

It works great!

Thank you Epic!

#❤

#Download

Here is the version of my plugin that I tested in a packaged game where it worked great:

August 16th, 15:38AM 2014

---

<div class="post-metadata">

**Author:** ![Midnight640](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Midnight640](https://forums.unrealengine.com/u/Midnight640)\
**Post date:** [August 17, 2014, 6:40am UTC](https://forums.unrealengine.com/t/rhigetavailableresolutions-works-in-a-packaged-game-in-c-but-not-when-used-in-a-bp-node-via-plugin-the-bp-plugin-version-works-in-editor-builds/287115/10 "2014-08-17T06:40:55Z")

</div>

YEEY 😃 😃 😃
