| 02-21-2004, 08:59 AM | #1 |
I want to make a map, probably based of Magic the gathering but actually play like the real game, but I want players to be able to use the map in solo to build decks, and then generate a password to save them so they can play their own decks online. Is there anyway to do this easily, many letters of a code would I need to store say the info on the 60 different cards, in the deck? Any Suggestions? |
| 02-21-2004, 10:01 AM | #2 |
Weel, in theory, you would essentialy need 60 characters for a 60 card deck, but that only works if you have 36 (letters+numbers) different cards. Since you probably have more, you'll need two characters per card, that allows for a maximum of 1296 different cards. Much better. But that gives you 120 characters of password for a 60 card deck! Well, that IS highly unoptimised code, like the .BMP format. Surely we can optimise. Of course, I won't be touching any complex alghoritms, but maybe, just maybe we can get somewhere with a simpler one. For example, if you have more cards of the same type, then you could go instead of A6A6A6A6 (for four same cards) 4A6, that gives you 3 characters instead of 8, not to mention the gain you get form the basic lands. You, of course, cannot have more than 36 cards of the same type in your deck, but I suppose that is not much of a problem :) Furthermore, you can optimise the following line: 4AG4LS4C342K48M, as there are four cards of each of these five types in the deck. You could optimise this line into 4(cards types that appear in fours)5(number of these card types)AGLSC32K8M. 15 characters to 12 characters... guess we are reaching the limitations of the system... Sooo, how would a deck look? let's see: 12 plains 10 mountains 1 non-basic land 4 gobblins of one type 3 gobblins of another type 4 white soilders 2 white clerics 2 white clerics of another type 3 red beasts 4 white knights 4 red soilders 1 dragon 4 burns of one type 3 burns of another type 2 enchant creatures 1 enchantment B1XX01XX45XXXXXXXXXX33XXXXXX23XXXXXX13XXXXXX (B is the number 12, 0 is the number 10, XX are the codenames of cards) 44 characters long for something, I guess, is an average deck. Not so bad, considering we started from 120, but still quite a lot. Further ways to optimise: Maybe, if you could make a system, like the five colors+other (colorless and gold), that gives you 6, and up to 6 card types (creature, enchantment, instant, sorcery, land, is there anything else?), together that gives you 36 combinations that can be written in one character (like red sorcery, white creature etc). Once you have such a system, you could probably describe each card with onyl one character, meaning, you wouldn't have more than 36 red sorceries or more than 36 different white creatures. How would our deck look like then? Y(code character for red creatures)0(number of characters before the next code character, 0 stands for 10)4X3X3X4X1X(notice that I left out the previous system now as there are not that many card types that would share the number of those cards in the deck; X's stand for creature types)Z(code character for white creatures)8(again the number of characters used to describe the white creatures)4X2X2X4XQ(code for red sorceries)24XP(code for red instants)23XR(code for red enchantments)22XS(code for white enchantmenst)21XT(code for colorless lands)3BX0X1X. Y04X3X3X4X1XZ84X2X2X4XQ24XP23XR22XS21XT3BX0X1X 46 characters long... we-eelll... gues this is as short as it gets. Mono color creature decks would make for a shorter second system (1 character per card), while complex multicolor decks come out shorter with the first classification (2 characters per card), but are still rather long, there is no way around that. An average two color deck will go, I estimete, up to a max of 60 characters in lenght. Quite a lot... And any attempt to get it shorter would invole some complex algorithms. You can't get the difference like between .JPG and .BMP here, because you need the shorter version to still be exact. I guess an average of 45 characters is still an improovement from the original 120, but the question remains, wouldn't it be easier (and faster) to make your deck each time anew (once you knew the deck by heart) than typing in the code for the deck... |
| 02-21-2004, 04:59 PM | #3 |
Of course I would need something to scramble the code to make it hard to break too. Do you think 50+ Characters are too long of a code? Yea I think entering a code would be alot quicker than having to set up a deck everytime you play the game. |
