InvalidOperationException when you create a Tilemap
by Zilla · in Torque X 2D · 10/22/2008 (4:44 am) · 14 replies
When you create a Tilemap on a machine with a poor graphics card (e.g. an Asus Eee or a lenovo laptop), it will result in a InvalidOperationException.
There are two threads in the private platformer forums that discuss this problem but no solution was found.
www.garagegames.com/mg/forums/result.thread.php?qt=76546
www.garagegames.com/mg/forums/result.thread.php?qt=73508
I hope that someone in this public area knows how to fix this error.
I already know that I could buy a new graphics card or another pc ;)
There are two threads in the private platformer forums that discuss this problem but no solution was found.
www.garagegames.com/mg/forums/result.thread.php?qt=76546
www.garagegames.com/mg/forums/result.thread.php?qt=73508
I hope that someone in this public area knows how to fix this error.
I already know that I could buy a new graphics card or another pc ;)
#2
02/15/2009 (10:24 am)
I've never worked with a netbook and after reading your links this probably isn't the issue, but have you tried using smaller tiles maps? My thought is that your tilemap images may be too large for your netbook's gfx card to handle.
#3
I don't think this is possible without upgrading to a graphics card can can support allocation of 32-bit index buffer. The InvalidOperationException is caused deeper down in the Xna framework (according to one of the posts you linked). Its specifically caused by the IndexBuffer's CreateBuffer(...) method where it checks if the graphics card can use 32-bit index buffers; if not it throws the exception.
The only solution I can see to this problem is if you created your own T2DTileLayer implementation taking into consideration your current graphics card's capabilities.
I don't have the Torque X source, so I'm not sure why the T2DTileLayer needs a 32-bit index buffer rather then a 16-bit one; however simply replacing it with the 16-bit index won't work, as it causes distortion (according to the posts you linked). Perhaps someone that is more experienced with Torque X (and actually has the source) could be of more assistance in creating a T2DTileLayer that works on some of the lesser graphics intense cards :)
EDIT: I had some time to tinker around with this today; I got it to work with 16-bit indicies (so it should get past this exception now). Do you have a Pro license by any chance?
02/15/2009 (10:25 am)
Hi Zilla,I don't think this is possible without upgrading to a graphics card can can support allocation of 32-bit index buffer. The InvalidOperationException is caused deeper down in the Xna framework (according to one of the posts you linked). Its specifically caused by the IndexBuffer's CreateBuffer(...) method where it checks if the graphics card can use 32-bit index buffers; if not it throws the exception.
The only solution I can see to this problem is if you created your own T2DTileLayer implementation taking into consideration your current graphics card's capabilities.
I don't have the Torque X source, so I'm not sure why the T2DTileLayer needs a 32-bit index buffer rather then a 16-bit one; however simply replacing it with the 16-bit index won't work, as it causes distortion (according to the posts you linked). Perhaps someone that is more experienced with Torque X (and actually has the source) could be of more assistance in creating a T2DTileLayer that works on some of the lesser graphics intense cards :)
EDIT: I had some time to tinker around with this today; I got it to work with 16-bit indicies (so it should get past this exception now). Do you have a Pro license by any chance?
#4
02/16/2009 (12:43 am)
Quote:Do you have a Pro license by any chance?Not yet. But what and where exactly could I replace the 32-bit index buffer with a 16-bit one if I owned the Pro license?
#5
I don't know if this is allowed or if you do this favour to me, but could you send me the dll with this change? :)
02/16/2009 (5:23 am)
I assume that I will have to change IndexElementSize.ThirtyTwoBits to IndexElementSize.SixteenBits in a render method of T2DTileLayer that you mentioned. But unfortunately I don't have the Pro version...I don't know if this is allowed or if you do this favour to me, but could you send me the dll with this change? :)
#6
John K.
www.envygames.com
02/16/2009 (11:36 am)
Lucas, what changes did you make to get it past the distortion problem with the 16-bit index buffer?John K.
www.envygames.com
#7
I'm not sure what code changes I'm actually allowed to show to you since you don't have the Pro license. John is more experienced then I am and might be able to sort this out better then I can, without me getting in any sort of trouble :)
@John:
Do you have an e-mail address I can send the explanation / solution of this problem to? Perhaps then if you think its alright, we can also provide Zilla with the solution (assuming this actually fixes the problem).
02/16/2009 (7:32 pm)
@Zilla:I'm not sure what code changes I'm actually allowed to show to you since you don't have the Pro license. John is more experienced then I am and might be able to sort this out better then I can, without me getting in any sort of trouble :)
@John:
Do you have an e-mail address I can send the explanation / solution of this problem to? Perhaps then if you think its alright, we can also provide Zilla with the solution (assuming this actually fixes the problem).
#8
Thank you very much in adv for your offered help and solutions.
@John
It would be great if I could develop my TXB games on my netbook and I hope that Lucas' solution can fix my error.
I do not need any source, all I want is a dll that I can use on my Eee.
Besides: I could not find the 2.0 Pro version on the products pages...
02/16/2009 (10:59 pm)
@LucasThank you very much in adv for your offered help and solutions.
@John
It would be great if I could develop my TXB games on my netbook and I hope that Lucas' solution can fix my error.
I do not need any source, all I want is a dll that I can use on my Eee.
Besides: I could not find the 2.0 Pro version on the products pages...
#9
Zilla, it sounds like Lucas has this going. We'll see what we can put together as far as a binary version goes - I'm not sure what's up with the GG site for purchasing the pro license. But the 3.0 release is right around the corner. Also, as far as mass deploying games to the Eee, you'll still need to work out an installer solution to make sure that the .NET Framework, Direct X, XNA, and your game. It's a big pill that people need to download to run your game.
John K.
www.envygames.com
02/16/2009 (11:40 pm)
Sure, my email address is: jkanalakis @ envygames.com, I'm happy to go through the changes with you. I took a look a while back, but didn't finish digging. Zilla, it sounds like Lucas has this going. We'll see what we can put together as far as a binary version goes - I'm not sure what's up with the GG site for purchasing the pro license. But the 3.0 release is right around the corner. Also, as far as mass deploying games to the Eee, you'll still need to work out an installer solution to make sure that the .NET Framework, Direct X, XNA, and your game. It's a big pill that people need to download to run your game.
John K.
www.envygames.com
#10
The (Xbox-)deployment is done on another machine.
I was working 2 weeks with the Eee when I was on holiday and I successfully compiled many examples from your book and the GG demos/tutorials.
This works fine except this tilemap error and unfortunately my current game uses several tilemaps... But it seems that there is light at the end of the tunnel :)
02/17/2009 (1:48 am)
Quote:Zilla, it sounds like Lucas has this going.I'm very excited to hear this :)
Quote:mass deploying games to the EeeThis is not my intention. I don't want to write XNA games for the Eee. All I want is to use the VS/XNA IDE to code and debug my games on the Eee while I am on the train etc.
The (Xbox-)deployment is done on another machine.
I was working 2 weeks with the Eee when I was on holiday and I successfully compiled many examples from your book and the GG demos/tutorials.
This works fine except this tilemap error and unfortunately my current game uses several tilemaps... But it seems that there is light at the end of the tunnel :)
#12
I'm very sorry that I am so anxious for this but is it possible that I will get this dll:
a) at all?
b) even before the weekend...? ;)
because I will go on vacation and I wanted to take the Eee with me...
02/19/2009 (7:56 am)
"Zilla, don't run out of patience!"I'm very sorry that I am so anxious for this but is it possible that I will get this dll:
a) at all?
b) even before the weekend...? ;)
because I will go on vacation and I wanted to take the Eee with me...
#13
John will have to answer these questions. I've e-mailed him the information he needs, but I haven't heard back from him yet :)
02/19/2009 (5:20 pm)
Hey Zilla:John will have to answer these questions. I've e-mailed him the information he needs, but I haven't heard back from him yet :)
#14
03/19/2009 (2:11 pm)
Quote:John will have to answer these questions. I've e-mailed him the information he needs, but I haven't heard back from him yet :)anybody any news?
Torque Owner Zilla
Could anyone with this error resolve this tilemap problem?