Bug with Image Map creating
by James Daniel · in Torque Game Builder · 02/22/2007 (2:38 pm) · 5 replies
I have a png file that is 1976 by 92 and has 21 images that I need to divide into 21 cells of 94 x 92. When I attempt to set cell width to 94 it changes the inputed value to 123. What is going on and what can I do to get my cells setup the way I need?
#2
02/22/2007 (4:49 pm)
Good idea but ...... No, it isn't bad math. I changed the size to 1974 x 92 and still got the same problem.
#3
I really do not feel I understand this part of the engine. But I do not think it works very well.
02/23/2007 (10:16 am)
I have had a problem working with images whose width is greater than 1024 pixels, so I have stopped doing that. Maybe you can try rearranging your cells (I know it's a pain) so the thing is narrower.I really do not feel I understand this part of the engine. But I do not think it works very well.
#4
Textures of that "shape" (dimensions specifically) are very inefficient when it comes to how they are used on the video card.
A very large portion of your video cards require power of two textures, meaning that with a number like 1976, the software must increase the actual size of the texture to the next power of two--which in this case is 2048. It becomes even worse when you are just over a power of two, especially with something like 2050 as a dimension, since the next power of 2 is 4096....and most video cards cannot handle single textures larger than 2048x2048.
In general, when making video game art (especially 2D), you should strive for planning out your textures to be near reasonable powers of two--TGB will of course pad them out for you automagically, but developer/artist optimization is almost always better in the long run.
As to your issue with the GUI, you should choose either setting the cell size manually, or the cell count (x and y) manually, but not both. It's adjusting your numbers for you most probably because you have a value in each of the two areas, and it cannot make them reconcile.
02/23/2007 (10:23 am)
Just a quick aside:Textures of that "shape" (dimensions specifically) are very inefficient when it comes to how they are used on the video card.
A very large portion of your video cards require power of two textures, meaning that with a number like 1976, the software must increase the actual size of the texture to the next power of two--which in this case is 2048. It becomes even worse when you are just over a power of two, especially with something like 2050 as a dimension, since the next power of 2 is 4096....and most video cards cannot handle single textures larger than 2048x2048.
In general, when making video game art (especially 2D), you should strive for planning out your textures to be near reasonable powers of two--TGB will of course pad them out for you automagically, but developer/artist optimization is almost always better in the long run.
As to your issue with the GUI, you should choose either setting the cell size manually, or the cell count (x and y) manually, but not both. It's adjusting your numbers for you most probably because you have a value in each of the two areas, and it cannot make them reconcile.
#5
Thanks for mentioning the cell count. When I set the cell count x to 21 and cell count y to 1 everything works just fine giving me a cell width of 94 and cell height of 91.
02/23/2007 (2:15 pm)
Interesting point I have another piece of art that is 2773 by 93 and I have no problem using it. I've checked the two files and other than the differences do to being different images everything looks fine.Thanks for mentioning the cell count. When I set the cell count x to 21 and cell count y to 1 everything works just fine giving me a cell width of 94 and cell height of 91.
Torque Owner Ben R Vesco
Could you be getting the error due to math that doesn't work out?