[SOLVED] RenderTarget2D "Parameter is Incorrect" Error ???

Hello…

I am attempting to create a RenderTarget2d object with the following maximum sizes…
height = 72 * 100
width = 72 * 40

These sizes will allow me to draw a hexagon map with a height of 100 tiles and a width of 40 tiles.

If I keep these sizes to something let’s say like 20 tiles by 20 tiles (each tile is 72x72 pixels) I have no problems instantiating a new RenderTarget2d.

However, once I go over a certain maximum I get a “Parameter is Incorrect” error, which I imagine means I am going beyond some internal memory consideration.

However, based on what I have read on the forums here, there should be no maximum on these size parameters.

Is there a way to get around this limitation since whatever I am able to draw to the RenderTarget2D object is now working quite well?

Thank you…

I thought this issue may be related to the memory maximum on my graphics board but after looking up the specifications and doing the calculations on the size of my RenderTarget2D object, I found that I am well within the 2-gigabyte limit that my board supports…

This is an issue that will not arise with creating new RenderTarget2D objects if you set your Graphics Profile object to GraphicsProfile.HiDef;

However, it appears that if you have not set this object in your application, MonoGame’s internals will default to GraphicsProfile.Reach;

Help with this resolution came from the following thread…

http://community.monogame.net/t/solved-does-the-hidef-profile-work-correctly-in-monogame-3-6/9149

The difference between these two settings is that the HiDef attribute will provide your application with the maximum capabilities of your graphics environment while limiting the device selection your application would be able to run on; in this case probably most mobile devices.

The Reach attribute will provide just the opposite capabilities by enforcing a limited set of graphic capabilities so your application can run on many different device types.

>>>

This should have been a relatively easy issue to resolve. However, the documentation within the Game Development Community is relatively poor forcing people who are learning the various frameworks to ask the same questions over and over again, which are then answered by those who have learned the idiosyncrasies of this type of development through experience.

Maybe some of us developers should get together and discuss developing a set of good documentation for the MonoGame environment that would allow newer developers to more easily resolve such issues.

Anyone interested ??? :relaxed:

Yeah, that’s true. A lot of the issues people run into are recurring. It might be good to have an FAQ page or something that people can search more easily than the forums.

About your issue. This has been on the radar for a long time. Enforcing the GraphicsProfile, throwing better errors, documenting the limitations of the profiles and expanding GraphicsProfile to allow for more control is what’s planned. Unfortunately there are many things to do for MG and little dev time :frowning:

If anyone wants to have a look at this, the best starting place is this issue:


I’m short on time, but if you’d like to help and could use some pointers, pm me on Gitter or here on the forums :slight_smile:

1 Like

Hi Jjagg…

Yes, I would like to help set up a FAQ page or maybe even a separate support site if that would make it easier to collate the information. I am a senior software engineer and have done quite a bit of web development before I retired in 2014. Now I am concentrating on WPF desktop applications and my military simulation with MonoGame.

Most of the issues I have run into are fairly easy to resolve once I get the information. It is trying to find it that often takes so many hours of research. For example, with this current issue, I spent hours first resolving where the issue came from. Was it a hardware limitation on my own machine, a missing parameter from my RenderTarget2D object creation, my own code? And then there was the conflicting information that I ran into where XNA\MonoGame documentation stated that limitation on a RenderTarget2D was 4096*4096.

When I finally ran across the noted thread in the forums, my issue was resolved but it took a lot of research that knocked the wind out of me.

I know game developers like to keep the aura of this style of development under the veneer of the Black Arts. However, for we that are actually engaging in it, we could use some better, organized research\reference documentation.

:relaxed:

I thought there was a way to reply with a new thread on here… anyway, Can you come into the General Conversation Thread with me and discuss this topic? I am still midway through my web studies and something like this can be done as I am playing with SQL and ASP.NET, I was going to create a UWP app for this but that would alienate some users… I suppose a website is the best method…

Hi Mr. Valentine…

I set up a new thread for this subject entitled, FAQ\Reference for MonoGame - Open Discussion

I am a little rusty on my SQL but I would be glad to help you out. Shouldn’t take me too long to come back up to speed…

:relaxed:

1 Like