It is currently 27 Apr 2024, 00:47
   
Text Size

2000 cards limit

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Re: 2000 cards limit

Postby 0rion79 » 10 Dec 2011, 13:06

Sounds too complicated, imho... also I love the traditional deck editor!
User avatar
0rion79
 
Posts: 1520
Joined: 24 Feb 2009, 18:33
Location: Italy
Has thanked: 94 times
Been thanked: 61 times

Re: 2000 cards limit

Postby Gargaroz » 10 Dec 2011, 14:32

Mok, I couldn't get rid of the get_id_by_name unless we got a final CSV with STATIC ids (so, if I need to put in play forcibly a card, I'll know for sure that it will be in slot X).
So, the master plan is :
1) Gettin a global CSV like the one Orion mentioned

2) As soon as this is done, I'll remove all the dynamic ID calls and replace them with refreshed fixed IDs (of course I'll add some notes to make the code readable).

Really, we don't need any more than this and a more powerful tool to edit the cards_ptr : the actual one is on par, but editing a slot after one for such a large amount of cards is almost ludicrous.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: 2000 cards limit

Postby Mok » 10 Dec 2011, 14:46

Gargaroz wrote:Mok, I couldn't get rid of the get_id_by_name unless we got a final CSV with STATIC ids (so, if I need to put in play forcibly a card, I'll know for sure that it will be in slot X).
So, the master plan is :
1) Gettin a global CSV like the one Orion mentioned

2) As soon as this is done, I'll remove all the dynamic ID calls and replace them with refreshed fixed IDs (of course I'll add some notes to make the code readable).

Really, we don't need any more than this and a more powerful tool to edit the cards_ptr : the actual one is on par, but editing a slot after one for such a large amount of cards is almost ludicrous.
Hm, why? As long as Full Name in csv is the same, the card ids can be generated and the sources don't need any changes unless you remove something from csv or change it's name... but oh well, never mind :)
Mok
Programmer
 
Posts: 163
Joined: 23 Nov 2011, 14:28
Has thanked: 1 time
Been thanked: 61 times

Re: 2000 cards limit

Postby Snacko » 10 Dec 2011, 14:48

use defines or an enum so it's self explanatory what card it is instead of a magic number popping up as there's way too many of those already

@mok
it would be useful to autogenerate this defines or an enum from csv when the converter runs
personnaly I prefer all caps for constants so something along CID_MAYOROFAVABRUCK or CID_MAYOR_OF_AVABRUCK would be best and self defining
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: 2000 cards limit

Postby Gargaroz » 10 Dec 2011, 14:54

Ok, I got it, and re-thinking probably is the best solution.
For the sake of making readable code, I'll prefer something like CID_MAYOR_OF_AVABRUCK.
Mok, would you care of the csv2dat modify ?
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: 2000 cards limit

Postby Mok » 10 Dec 2011, 15:12

Gargaroz wrote:Ok, I got it, and re-thinking probably is the best solution.
For the sake of making readable code, I'll prefer something like CID_MAYOR_OF_AVABRUCK.
Mok, would you care of the csv2dat modify ?
Sure, it does not need to be final solution, if it doesn't work, we can revert to something else.

I considered cid_Mayor_of_Avabruck due to ease of converting from get_id_by_name("Mayor of Avarbruck") but you are right that all uppercase will make it less prone to simple name fixing in cvs. And I believe enums are usually uppercase in C? I'll strip accented characters from the names though. And special cards with no names ("Empty" or "None") might require some special cases.

There's one drawback - full card names in csv must be unique. That means for example no 2 tokens named "Soldier" where one is 1/1 and the other 2/2. In such case either you create a generic Soldier token and put his power/thoughness via code or we need some solution to that. Maybe checking if CID already exists and adding some number after... but it's a bit fragile.
Mok
Programmer
 
Posts: 163
Joined: 23 Nov 2011, 14:28
Has thanked: 1 time
Been thanked: 61 times

Re: 2000 cards limit

Postby Snacko » 10 Dec 2011, 15:27

Well if 2 cards have the same name append their p/t like CID_SOLDIER_1_1 and CID_SOLDIER_2_2 , there are no other cards with the same name beside tokens and empty special cards, which need special treatment anyway.
Enums are pretty much always uppercase in C, also depending on compiler implementation it might choke on accented characters so removing them is a plus
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: 2000 cards limit

Postby Gargaroz » 10 Dec 2011, 15:33

No problem for tokens, we'll use unique names, I already implemented a way to made them "morph" according to some infos given.
And we could combine this with the suggestion of Snacko.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: 2000 cards limit

Postby 0rion79 » 10 Dec 2011, 15:53

Having different tokens with different arts & text adds flavor to the game, even if sometimes it is useless and Gargaroz's way has proven to be very effective.
User avatar
0rion79
 
Posts: 1520
Joined: 24 Feb 2009, 18:33
Location: Italy
Has thanked: 94 times
Been thanked: 61 times

Re: 2000 cards limit

Postby Sonic » 10 Dec 2011, 17:28

0rion79 wrote:Got an idea about CSV/dat. Since Mok claims that the database can be extended to 30,000+ slots, and since I've seen that on Gatherer there are listed more or less 12.000 cards, maybe it would be more convenient to prepare a CSV with ALL cards ever printed listed by set order and then by alphabetical order, with all fields = 0. Then we code only the ones that we need time by time, whithout loosing time with lame cards, and have a clean and precise database that would be useful for sealed decks and blocks. What do you think?
Actually, I've been working on a csv file which contains all the csv card data for cards added and removed since the ISO release - sorted alphabetically, using the most recent data entries.

The idea being, like you say, to set up a default csv, but just with just the card names in the Full Name field. With my little file you could then inject all the current data using Mok's MakeNewCsv.exe.

I've been testing the idea and it works fine using a test default csv file.

An example of a default entry looks like this:

73;Air Elemental;0;0;0h;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
;0;0;0;0;0;0;0;0;0;0;0;0;0h;0;0;0;0;0;0;0;0;0;0;
0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
Obviously parameters like 'Expansion' would need to altered after injecting the base data - but if the cards are going to be arranged by sets this could be achieved fairly simply in a spreadsheet.
Preferably not Excel - as it mangles long text entries when importing the csv files for some reason.
Working On: Life, the Universe, and Everything.
User avatar
Sonic
Apprentice
 
Posts: 827
Joined: 27 Feb 2010, 00:37
Has thanked: 3 times
Been thanked: 161 times

Re: 2000 cards limit

Postby 0rion79 » 10 Dec 2011, 17:42

There are several options: my 2-cents advice is to focus on breaking the 2.000 cards limit at first and then to make improvements focusing on easy to use solutions, available for non-coders like me.
If you prevent the use of known tools as Microsoft Office, you will loose support from a lot of non-expert members of this forum, which will be discouraged from learning the use of new, essential tools.
User avatar
0rion79
 
Posts: 1520
Joined: 24 Feb 2009, 18:33
Location: Italy
Has thanked: 94 times
Been thanked: 61 times

Re: 2000 cards limit

Postby Gargaroz » 10 Dec 2011, 17:51

Nah, Orion, Sonic is just saying he prefers to use a better tutor, but in the end the CSV is only a text file, you could use any program you want to edit it.
And I support the idea of creating a "master CSV" with all the existing cards, even with only the names.
But this belong to a dedicated thread, I'll create it.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: 2000 cards limit

Postby 0rion79 » 10 Dec 2011, 17:57

I understand, but Excel has some very comfortable options to quickly browse among cards. Editing a CSV with, let's say, Notepad would be a pain in the ...! And I'm not considering compatibility issues... anyway, I'll make you guys make the work. I'm not expert here.
User avatar
0rion79
 
Posts: 1520
Joined: 24 Feb 2009, 18:33
Location: Italy
Has thanked: 94 times
Been thanked: 61 times

Re: 2000 cards limit

Postby Gargaroz » 10 Dec 2011, 18:04

Orion, you'll have your part of work, don't be shy ;)
Anyway, any discussion aboutb the new CSV now should be posted here : viewtopic.php?f=56&t=5911
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: 2000 cards limit

Postby Sonic » 10 Dec 2011, 23:52

0rion79 wrote:I understand, but Excel has some very comfortable options to quickly browse among cards. Editing a CSV with, let's say, Notepad would be a pain in the ...! And I'm not considering compatibility issues... anyway, I'll make you guys make the work. I'm not expert here.
I use Excel 2003 myself - but for the manalink.csv I now use Open Office Calc, which is free for personal use.

Like I said; for some reason, Excel has a problem with the long text fields in the manalink.csv format - the Planewalkers Rules Text is the most obvious. I spent ages looking through the Microsoft knowledge base trying to find out why - but to no avail.
In the end I downloaded Open Office to give that a try. Calc handles the csv files flawlessly - and it gives you the option to custom select the field and text delimiters when you export the file. All you do then is load it into the Skymagic editor and save the file in the manalink format.

Calc isn't as fast as Excel, admittedly - but at least you don't have to check every time you save a file to see if it's mangled your text entries. :wink:
Working On: Life, the Universe, and Everything.
User avatar
Sonic
Apprentice
 
Posts: 827
Joined: 27 Feb 2010, 00:37
Has thanked: 3 times
Been thanked: 161 times

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 26 guests


Who is online

In total there are 26 users online :: 0 registered, 0 hidden and 26 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 26 guests

Login Form