Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

uploading a deck of cards

Itchy Gamba
Registered User
Join date: 16 Dec 2006
Posts: 48
03-18-2007 02:31
i am quite new to this but what i want to do is pretty simple.

I want to upload a set of 52 cards for a game i have created.
I already have the images of the cards.
All i need to know is what format and size i should upload them as?
I will probaly want them to be about 1 meter high and half a meter wide once they are rezed in world. (not sure if you need to knoe that or not)
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
03-18-2007 04:21
- TGA is always the best format to use for SL. In this case, without any need for an alpha channel, use a 24-bit TGA rather than 32-bit (if your graphics program even gives you the option for 32-bit). So if you'll be editing for size and resaving them anyway, use TGA. If that's not an option, BMP is pretty much fine too. Do try and avoid JPG though, since it uses lossy compression which creates artifacts, and the SL converter compresses *again* which only makes them worse.

- Always resize your images to powers of 2 (64, 128, 256, 512) on both dimensions before uploading; if you don't SL does it for you anyway, but not with the same finesse you'll likely find in a graphics program, so you'll get better results if you do it before uploading.

- Since you're looking at cards roughly twice as tall as they are wide, size them that way to begin with (e.g., 256 x 128 or 128 x 64). Then if you find the cards look best not exactly at 2:1 dimensions, at least you'll still be very close and stretching will be kept to a minimum.

- With such a large number or textures potentially in use at one time, I'd personally be motivated to keep them small as long as they still look good to you. Try a single image first at, say, 128 x 64 and see how that looks. Maybe try a 256 x 128 too and see if there's a lot of difference. Personally I think larger than that should be unnecessary (depends to an extent on how closely people will be zooming in on the things).

- See what looks good and do the rest the same way :)
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
03-18-2007 07:20
I would strongly recommend against using 52 individual textures. There's no telling how long it will take them all to load, and it's a ton of unnecessary overhead. Put all the cards on a single 1024x1024 sheet, and then use the repeats/offsets settings to put one card on each prim.

This subject has come up many times before. Here's a thread with instructions for how to do what I'm talking about. Pay particular attention to post #6. /109/0d/94574/1.html
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
03-18-2007 07:26
Welcome to SL!
Sounds like you're well on your way to having a great time!
Anti's advice is right on the mark.
From your posting, its hard to tell what your level of comfort is, so I encourage you to plunge right in by keeping it simple. As your knowlege/skills progress, here are some thoughts that will make your game run faster. (but think of them as Version 2, for now :)

What's the application really need?
Textures are saved as powers of 2. So yours could be 128x256 each.
There's a 1024x1024 upper limit to the size of a texture in SL.
Each of your card textures can be very slow to load and get slower as they get larger.

So...one 'trick' to speeding up the load, reducing lag, and saving your Lindens, is to put multiple images on one Texture. (there are LOTS of threads on this in the forums and even a sticky or two, I think.)

Consider the following idea:
Paste your Card Images into a single image by putting them in 4 rows of 13 cards.
Then use, (under script control) OFFSET and Image Size or REpeats to make the desired portion of the single texture appear on the Prim as needed.

Presumably, you're running some script...to change 'suit' you'd just change the 'ROW'.

If the resolutioon isn't good enough, try 4 Textures (one per suit) but same idea.

The use of a single large texture will speed up game play and reduce lag for everyone.

**and some more thoughts...13 images across is gonna be difficult math. To make it easier, you might add some extra images on the right... (20 is easy math...but maybe too much white space. Perhaps you could use the extra space on the right for signage, or some other use.**
**Also, there may very well be IN WORLD playing cards already. I know I've seen TAROT decks... YOu could learn a LOT by starting to build your game using the existing card textures...substitute your own when you're ready.!
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
03-18-2007 08:55
Sterling, I'd encourage you to read the other thread I linked. Grouping the cards into 13's won't work because SL's rounding is so imprecise. The best format to use is 10 across and 6 down. You end up with a little wasted canvas space, but that's by far the lesser of the available evils.

Also, I'll stress again that using 52 individual textures is a really bad idea. Here's why:
  1. They won't all load at the same time. There's never any predictable rhyme or reason to the order in which textures load. It would really suck to have, say, half the cards load right away, and the other half trickle in over the next several minutes. You'll find stuff like that will happen more often than not when using large amounts of individual textures.


  2. 52 asset requests instead of one is a ton of unnecessary network traffic, and that kind of mismanagement by users is likely one of the reasons we have so many constant asset server problems. We all have to do our part to help the system run as smoothly as possible.


  3. All those textures really add up, memory-wise. Fifty-two 128x256's is a total of 4.875 MB of texture memory. I can't think of a compelling reason to invest that much into a little deck of cards. One 1024x1024 is only 3 MB of texture memory, a 40% savings. Texture size mismanagement is the single biggest source of lag in SL. Always do what you can to use as little texture memory as possible.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Sylvia Trilling
Flying Tribe
Join date: 2 Oct 2006
Posts: 1,117
03-18-2007 21:32
From: Anti Antonelli
- TGA is always the best format to use for SL...


What is the difference or advantage of tga over bmp?
Renee Roundfield
Registered User
Join date: 10 Mar 2006
Posts: 278
03-19-2007 07:24
This also strikes me as something that is probably being done repeatedly. Might be worth a post in Products Wanted.
Woopsy Dazy
Registered User
Join date: 12 Nov 2006
Posts: 173
03-19-2007 07:51
Agree on all previous posts. Use one large image instead of single ones. I've done a lot of testing in this matter myself.

Individual textures maybe get a better detail but they keep reloading when used in a poker-machine for example. The one big 1024x1024 will always display correctly after it has been cached with the client. So a bit slower from start but a much better overall impression overall.

Another thing. Cards are more 3x4 size than 1x2. I've found that using suared originals looked better than 1x2 size. Eg, saying 128x128 looks better than 128x64 or 256x128. Just resize in game to card-size.

I used 4 decks 4x4 images on a 10x10 image. So 2 white columns at the right and 2 at the bottom. I do not recomend using 20x4 because you loose too much quality.

Btw, I have two full decks for sale on slexchange if interested. Individual cards and full deck textures in various sizes, even 4 color-textures (one deck each) if I remember correctly. Sorry for advertizing.

Feel free to IM me if you need hints and tips in this matter.