Game Development Community

Football field question

by Aaron Freeman · in Artist Corner · 01/07/2005 (12:02 pm) · 24 replies

Ok, I want to create a really simple football field to run around on. I want the markings to be accurate to the rules of the game. I can see three ways to do this, and am just learning all this stuff, so I need some guidance on which one to pursue:

1) It seems like I could create a bunch of terrain textures that have lines on them and use the terrain to be the football field. I wouldnt have a clue about how to do this, so if this is the proper way, please give me a link with a tutorial on how to get the lines to come out at the right distance (every five yards for example).

2) I could use MilkShape to create a DTS object and place a really big texture on it with the exact layout of the field. If I do this, is there a limit to the size of the JPG that I slap on the object?

3) I could use Quark to create a long,wide, and very thin DIF object with a texture on the top surface much like in (2). This is how I started. I created a huge image where each pixel = 1 inch. I have all the lines and stuff drawn out. If (2) is more appropriate can I use the image that I created?

Thanks in advance for your guidance.

Aaron
Page «Previous 1 2
#1
01/07/2005 (2:29 pm)
Most efficient way I'm guessing is Quark... though I may be incorrect... I think .dif's are the most efficient, and can delete the terrain then
#2
01/08/2005 (7:50 am)
OK, if the Quark method is the best, how do I go about making sure that the field JPG I made fits perfectly on the top cube face? I know how to apply it to the top face, but it wants to tile. I need to make the face be the exact size of the JPG somehow.
#3
01/08/2005 (8:08 am)
Select the brush or face. Hit 4 to go to the face pane on the bottom left. then choose the icon that says "adjust texture to fit face" (on the bottom left pane)
#4
01/08/2005 (9:38 pm)
*points at JMac* what he said

www.razedskyz.com/images/qrkhelp.JPG
btw check recent snapshots, someone posted one about taking terrain out and bringing in one big dif, said it increased FPS... this should do even more so, considering a football field isn't that complex, considering if you do the bleachers, etc
#5
01/09/2005 (7:42 am)
Ah, very cool! I will play with this right now. Thanks much!

Good idea to try it with one big DIF. I'll play with that too.
#6
01/09/2005 (7:52 am)
OK, I just tried it, and the demo.exe throws a General Protection Fault. I am guessing this is because my JPG is 2048x3072 (every pixel=1 inch). Does that sound like the reason. If so, do I just need to create lots of 256x256 textures tile them properly on the face of the cube?
#7
01/09/2005 (10:47 am)
Before doing that, try to resize your texture to 512x512 (go ahead and let it distort it), sharpen it (to remove some of the blurries that can come from resizing) and see if that looks good enough once it is stretched over your map.
#8
01/09/2005 (9:27 pm)
3072 is not a power of 2 size
#9
01/09/2005 (9:40 pm)
Ooooooooooo, you made a general protection fault.....SHAME ON YOU!! (Dont know how many times I've done that in ASM)

Here is a list of powers of 2 to make it easier for you:

1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
And so on....If you need anything larger than that then Torque will probably get mad at you again. It might get mad at anything larger than 1024x1024. Dont know for sure though. Can you plit your texture into two or more parts to get your 2048x3072?

So you would have something like the following (Lets just say "Tx" is a 512x512 texture, each part of your larger texture):

T0 T1 T2 T3
T4 T5 T6 T7
T8 T9 T10 T11
T12 T13 T14 T15
T16 T17 T18 T19
T20 T21 T22 T23

I know this might not make any sense, but I tried :)
#10
01/09/2005 (10:14 pm)
Well I used to teach embedded systems programming at the local university, so it made complete sense. :)

I didn't know that Torque required that textures are powers of two. But I chose the size of field that I did based on it being a power of two ... if you look close, the texture is: 2048 x (2048 + 1024) This worked out nicely for me and kept _almost_ a power of two (I did that for efficiency, not because I knew Torque would require it). So that makes it easy for me to turn it into two textures, one 2048x2048 (or resized per JMac's recommendation), and then another texture 2048 x 1024. That is, if its possible to put two textures on a single surface?

Anyhow, when I created the JPEG I kept the original image in native PSP (Vector format) so I could resize it like JMac recommended easily. I tried it at 512x512 and still got a GPF, so there must be something else wrong.

Does Torque require images to be power of two? Is it required to be square?
#11
01/10/2005 (7:18 am)
Power of two: yes
square: no
#12
01/10/2005 (9:55 am)
Hmm, I'll try and simulate the same problem... I remember seeing a thread recently about putting a mirror under water to create mirrored images on water, they used a 2048 x 2048 I beleive, so I'm fairly sure that sizes that large should work.

edit: powers of two

2048 x 4096 will work

but 3072 is not a power of two as the other Matt said


2^1 = 2
(1 digits)
2^2 = 4
(1 digits)
2^3 = 8
(1 digits)
2^4 = 16
(2 digits)
2^5 = 32
(2 digits)
2^6 = 64
(2 digits)
2^7 = 128
(3 digits)
2^8 = 256
(3 digits)
2^9 = 512
(3 digits)
2^10 = 1,024
(4 digits)
2^11 = 2,048
(4 digits)
2^12 = 4,096
(4 digits)
2^13 = 8,192
(4 digits)
2^14 = 16,384
(5 digits)
2^15 = 32,768
(5 digits)
2^16 = 65,536
(5 digits)
2^17 = 131,072
(6 digits)
2^18 = 262,144
(6 digits)
2^19 = 524,288
(6 digits)
2^20 = 1,048,576
(7 digits)

www.newdream.net/~sage/old/numbers/pow2.htm
for a huge listing of powers of 2

disclaimer: I am not to be held responsible for the wrath of Torque with the powers of two tested from the url
#13
01/10/2005 (10:28 am)
@Matthew Langley - That was me that did the water, and the BRUSH was 2048x2048, not the image.
@Aaron - The (2048+1024) size violates the power of 2 requirement. At one point, the largest a texture could be was 2048x2048 - I do not know if this is the case with the latest cards, but on cards from last year, textures that are larger than that won't load.

In general, a 2048x2048 texture is way too big for general use - this thing will need to be uploaded to the card and swizzled (re-aligned) on load. If it gets ejected (because other textures or vertex buffers need the space on the card), it could cause serious performance issues. Besides, just texturing something normally with a texture that big is much slower -- it has to access 8mb of data. It's best to keep your textures at 512 at the most, but preferably at 256 for highest compatability and speed.

If you resized the texture to 512, and still saw the error - it is likely that you have some other problem. Did you get any errors/warnings when you ran Map2dif on the map? I've seen plenty of bad dif files come out of that. Mostly on maps that I've converted from a different format.
#14
01/10/2005 (5:26 pm)
Besides, you don't really need a resolution of 1 inch to make a football field look good.
Say the stripes are 4 inches wide, then you can increase your resolution to 4 inches, and
your texture's linear dimension drops by a factor of four, from 2048 to - magic! - 512.

And going the other way, dividing 3072 by 6 to get 512, isn't too terribly painful, either.
PaintShop Pro's "Resize" tool does a good job of shading boundaries, to give the illusion
of tighter rez than is really there. I imagine that Adobe Photoshop/Illustrator and the
GIMP have the same capability.

The only way a player is going to notice that you're fiddling with the resolution is if he
stops and looks at the grass -- and if he does that in a football game, WHAM! Just like
Colts did to the Broncos.

(I just learned today, thanks to the EGTGE I think, that textures don't need to be
square. Both dimensions have to be "two to the n," but they don't have to be identical.
Gotta go home and try that out.)
#15
01/10/2005 (5:42 pm)
Guys, thanks for the help on this. Apparently I didnt communicate too well that I realize that 3072 isnt a power of two. My point was, that by choosing that size, I could easily chop the image into two images, where both images would be powers of two.

That's why I was asking if you can place two images on a single surface? So far noone answered that question, or how to do it. So if I need to tile them or tile two different images in specific positions, could you give me a hint as to how to do that?

@Matt, thanks for the feedback on the square/non-square, that will be very helpful as I make more textures.

@Ray, that was the exact next step I planned on taking. I want to reduce the image to the bare minimum, but thought I would check it out first as is, and cant get it to work. I made my lines 5 inches wide, but since you pointed out 4 inches makes easy division, I will definitely reconsider the units I chose. I didn't even get that far as I couldn't get the "full" map working.

I'll play with some of the ideas above right now though.
#16
01/10/2005 (6:40 pm)
Two have "two images on a single surface" just chop the brush into two pieces and make them meet flush up against each other.
#17
01/10/2005 (7:16 pm)
I had answered your question in my earlier post with the example I had given (the "T" thing). It was a little confusing so....

Maybe this will be better:

ixeelectronics.com/K96/N8HOLIO.JPG
Lets say that the picture is your existing texture. You would split this large texture into 24 smaller 512x512 textures - noted by the red lines. When you want to put the textures on your modeled field you would just place each 512^2 texture where it needs to go and make sure it aligns with the others you have already placed.

To save texture memory you could only use about half as many textures since a football field is basically the same on each end. So you could use the same texture in the upper left corner as you do in the lower right corner, the lower left in the upper right, and so on.
#18
01/10/2005 (7:22 pm)
Nateholio (LOL),

Yes, thats exactly what I need to do, and I understood what you were saying ... what I don't understand is how to make it happen. :) I didn't know how to get multiple textures on a single face. But ... I think David's point is, you don't really do that. You just make 24 brushes and get them "locked" flush with each other (somehow), and then put each tile on a single brush in a 1-to-1 fashion. That was a little too obvious I guess. LOL

Back at it!

Thanks again!
#19
01/10/2005 (7:27 pm)
Sorry I can't be of help telling you exactly how to do this.
Also, for your logo in the center, you might use a decal, but I'm not sure how since I don't model buildings and such.
#20
02/15/2005 (11:07 am)
Any luck on this?
Page «Previous 1 2