Problem with textures not appearing

Questions and answers about the how and why of making maps.
Post Reply
User avatar
The Purple Panzer
Field Marshal
Field Marshal
Posts: 244
Joined: Tue Sep 23, 2003 8:13 pm
Location: Stonington, CT
Contact:

Problem with textures not appearing

Post by The Purple Panzer » Fri Apr 14, 2006 5:33 pm

I posted a map on the map releases board, called Robbie's Map, which has been on one or two servers recently - but there is a problem. Four of the textures are used, one per base, to add a certain personality to that team; the textures are:

http://images.bzflag.org/purplepanzer/robbie.png
http://images.bzflag.org/purplepanzer/george.png
http://images.bzflag.org/purplepanzer/julia.png
http://images.bzflag.org/purplepanzer/pp.png

and they are indeed there (though I don't think the directory listing of http://images.bzflag.org/purplepanzer/ shows them, at least not yet).

I can test locally and see the images; yet other people visiting the server don't see them. They are listed as downloading, yet only blank boxes show up where there should be textures. (If you search the server list for Robbie you might find the map up and see what I mean, and also see the exact text in the map file.)

Not only can't I figure out what the problem is, I don't even know how to get further leverage to understand what is happening. Is it a size limit to the files? A download time limit, or some sort of timeout that the client has? Other files from that directory work just fine (albeit on other maps). As these textures really are one of the major points of the map, I'd very much like to figure it out.

anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly » Sun Apr 16, 2006 11:58 am

I noticed that in viewing the images the sizes were not poers of 2. The image size should be a power of 2, i.e., 512x512 128x128. Usually 1024x1024 is the largest that a 2D texture may be. Try resizing the images.

User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1403
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom
Contact:

Post by Spazzy McGee » Sun Apr 16, 2006 12:56 pm

i'm sure someone (trepan?) said that the client automatically scaled textures that wern't Po2.... but i could be lying ;)
"Life is what happens to you while you're busy making other plans." - John Lennon

anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly » Sun Apr 16, 2006 1:15 pm

Spazzy is correct. I looked at the 2.0.6 source. The code does force Po2 alignment. So much for that theory.

User avatar
The Purple Panzer
Field Marshal
Field Marshal
Posts: 244
Joined: Tue Sep 23, 2003 8:13 pm
Location: Stonington, CT
Contact:

PO2

Post by The Purple Panzer » Sun Apr 16, 2006 4:37 pm

Did you just mean that it *doesn't* have to be a power of 2 in size, that the code scales it appropriately?

The odd thing is that if I put the images in the bzflag/data directory, and change the texture lines to not have the "http://images.bzflag..." prefix, everything works fine (indeed this is how I develop maps, not having write access to images.bzflag.org/purplepanzer, at least not yet.) It's when I move the images (actually, have DTRemenak move them) to the web site that some don't show up. Some - not all. In this one map it is all of them, but in some others (the current Collaborator corner I'm doing is an example) some textures appear and some do not. I can't yet figure out what the common element is in the ones that don't work - it doesn't appear to be size.

This is what I mean by it being hard to know what to try next. The images do work if copied locally, but not over the web; so I don't think it's an image problem per se, but it might have something to do (grossly) with image size if there is, for instance, a timeout problem in the image download. I suppose I could try to generate a few dozen images (say all the same content, maybe one color value) at different sizes, and see which make it and which don't - that might be a useful datapoint.

User avatar
khazhyk
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.
Contact:

Post by khazhyk » Sun Apr 16, 2006 5:46 pm

i don't think you need the "http://"
Image

User avatar
Teppic
Private First Class
Private First Class
Posts: 575
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block
Contact:

Post by Teppic » Sun Apr 16, 2006 6:18 pm

Then how does it decide between http and ftp?

anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly » Sun Apr 16, 2006 7:33 pm

I believe the syntax for images on the web should include the protocol (http://) and what I meant by image size is not the total number of bytes but the pixel width and height. For instance http://images.bzflag.org/purplepanzer/robbie.png is 397px in width by 458px in height and 195079 bytes in size. Its the 397x458 thats not powers of 2. However the code will scale the images so thats not your problem. I always scale my texture images to Po2 anyway though.
I use this map code in a public server and it seems to work.

Code: Select all

material
  name GroundMaterial
  addtexture http://images.bzflag.org/zaphod/TarmacBlack.png
end
Noone has said anything yet at least.
I'm sure you realize that the URL is case sensitive. One thing to make sure is that the DownloadAccess.txt in your BZFlag directory hasn't been modified to deny images.bzflag.org. I'll look for the server online.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest