Card Deck in 3D

Blitz3D Forums/Blitz3D Programming/Card Deck in 3D

Rook Zimbabwe(Posted 2005) [#1]
I have been working on a card game in B3D. I have had a lot of great help working out the mechanics of the programming but now I come to a key issue... the caerds themselves.

My first thought is to use a PNG or JPG file and call it an animated texture then I could just flop the frame corresponding to the card into the correct location.

At this point I want to say that quality is an issue. I want a decent looking deck here... So what I am hoping is that some of you older pros at this can offer your brazen opinion as to weather there is any better way to do this. I suppose speed is an issue too... has ANYONE thought of a better way to deal with the deck?

RZ


WolRon(Posted 2005) [#2]
A-10 are mostly white. So you don't even need a (complete) image for them at all. All you need are 4 small images for each suit (hearts, clubs, diamonds, spades) and 11 images for A,1,2, ... ,8,9,10. Then just write a small routine that 'builds' each card every time a card needs to be drawn.

J, Q, and K might as well be full images.


Rook Zimbabwe(Posted 2005) [#3]
Well that would certainly allow me to improve the quality of the deck... BUT (and correct me if I am wrong) doesn't JPG (and PNG) just "ignore" large areas of color. I am talking about how the file format works here. That said all the white space would essenially be "ignored" except as a bitplane number. that would be recreated as the format was read. This is not a very good explanation of what I mean but I think it hits the salient point.

If I was writing a Golf Style solitare game (which is what I am thinking about) then the entire deck would have to be drawn. It all shows. Slowdown? maybe...

RZ


WolRon(Posted 2005) [#4]
Do some tests and find out...


BlackD(Posted 2005) [#5]
Draw the entire deck. It'll use about 30 megs of RAM at decent quality. If you're targetting old/slow computers (which I guess you're not) then this may be too much - so experiment with texture size. Also, use PNG not JPG. It makes no difference what file type it is when you load it - it'll use the same amount of RAM as it is decoded into DX textures as an image in B3D. The difference is, JPG loading is crap in B3D, PNG is very good.

+BlackD


WolRon(Posted 2005) [#6]
The idea I gave you would save disk space (like .png) AND RAM both. But do what you want...


Rook Zimbabwe(Posted 2005) [#7]
I want to try both menthods and see which works best... While I code on an Athlon 64 3200+ my wifes computer is more mainstream at P3 2.1... 2.3 something like that. (I ignore it as much as possible except when I need to see if a game will work on it.)

OK probably gonna spend a week doing this as I have 60 shirts to embroider before manaņa... and then a case of baseball caps... Oy! Just when I get a good idea!

RZ