Page 10 of 11

Re: Draft Development in ML 3.0

PostPosted: 17 Nov 2013, 01:21
by foolosopher
Hi guys,
Finally found some more time and progressed a bit more. It seems that radio buttons are more appropriate to use, since we need to choose one set for each booster. Anyway here's a look, but has anybody found how to compile the "draftgui.c" along with the rest of the manalink code?

I need it to pass the selected values to draft.c

Re: Draft Development in ML 3.0

PostPosted: 01 Dec 2013, 23:47
by foolosopher
Hi guys,
Below you can find the latest version. It also handles the external
"int sets[3];" variable where the selected sets are stored and has most of the available expansion sets, however there's another issue. The GUI needs to be initialised from the main loop of manalink, anybody know where that is, looked but couldn't find it. There probably is a workaround but it contains threads.
The stricter rules in our makefile are being resolved little by little, but are there any news on how to add it in a separate file in the makefile?

Re: Draft Development in ML 3.0

PostPosted: 29 May 2014, 23:53
by gmzombie
Has this been addressed?

Re: Draft Development in ML 3.0

PostPosted: 15 Jun 2014, 15:23
by Gargaroz
Well, It's ages since I don't look at the draft code, and we'll surely have to check it to implement all the atrocious exceptions included in Conspiracy (pretty fun to draft in paper magic, but a nightmare to code for draft).
But we'll have to wait for Korath, which is currently swamped in real life issues, so the next patch will probably contain all from Cospiracy except for the "impossible to code" stuff and the draft-related stuff.

Re: Draft Development in ML 3.0

PostPosted: 15 Jun 2014, 19:41
by gmzombie
that is fine. We all understand real life issues. Yea drafting conspiracy is fun in paper magic. Im curious if we could look into doing something with sealed as well. i know currently sonic has changed it so we could at least sealed the latest block + core 2014 and modern masters which is cool but im wondering really if we could maybe see if it could be recoded to accept all the sets. we talked a little bit about it in the dev thread sealed deck fix. i dont know if you guys have found that code when your fixing things and whatnot. And its not like its a top priority or anything just something if you have some time to look when you have time to look. no biggie :)

Re: Draft Development in ML 3.0

PostPosted: 15 Jun 2014, 20:42
by Sonic
Nope - I've changed nothing. Those files in 'Sealed - possible fix' are simply test files.

The current set of reference manalink files remain untouched - apart from my usual Legacy Card text corrections.

Re: Draft Development in ML 3.0

PostPosted: 15 Jun 2014, 23:26
by foolosopher
Hello guys,
Sorry for delaying this but apart from real life taking my time, I thought there was no real interest about this. Here's the "fixed" version of the gui, which keeps only one radio button active from each column. Code can probably use a few optimizations, but should work fine as it is.
Haven't checked what's going on right now, but Korath had made some changes, consolidation and cleanup to the draft code a couple updates ago, when I last checked.
Anyway, the most difficult thing may be initializing the gui from main and then calling it at draft, or wherever we want to use it, if we are to use this.
Loading selection data is fairly easy, now straight from the code, but loading from menus.txt should also be doable.

Re: Draft Development in ML 3.0

PostPosted: 17 Jun 2014, 00:36
by gmzombie
Sonic wrote:Nope - I've changed nothing. Those files in 'Sealed - possible fix' are simply test files.

The current set of reference manalink files remain untouched - apart from my usual Legacy Card text corrections.
Er yea I know they are just test files..but I like to give props whenever I can. You did make the sealed work better sonic even if it is with additional files :)

Re: Draft Development in ML 3.0

PostPosted: 14 Sep 2014, 23:34
by foolosopher
I was looking at the forums and came up to the topic "Cube Drafting" from HarlequinCasts,
viewtopic.php?f=56&t=14948&p=156905#p156905
where I realized that we may already have a way of supporting custom sets and as a result cube drafting, through the sets & rarity mechanism that we are using.
Say that one adds a set in Manalink.csv. More specifically, one would need to add (let's assume at the end) a new set in Manalink.csv, and sets the rarity of the cards he wants to use, so as to appear that they belong (also) into the new set. Be careful that one would need to comply with the rules of having a set in draft
to enforce rarity=(11+ Commons, 3+ Uncommons, 1+ Rares at least per set) or for singleton if one drafts the same set for all 3 packs, make sure the set is at least 360 cards (or 240 for 2 packs, 120 for 1 pack).

Next add the new set in Expansions.h, menus.txt and finally into draft.c
In the menus.txt the new set Name needs to be added at the section "@EXPANSIONNAMES" last and also update the number of available sets by one.

Adding to draft.c would be a bit more tricky, because the new set (Name, Number) needs to be added in a few places.
But hey!!! Gargaroz or Korath have updated the code and automated this by reading the menus.txt =D> (just found out myself :mrgreen: ) so no touching draft.c !!! [-X
Next one needs to update the .dat (for sure Rarity, not sure about the others) files through the Magic_Updater ???
And should work. Haven't tested but probably worth a try...

Re: Draft Development in ML 3.0

PostPosted: 12 Nov 2014, 14:57
by Aswan jaguar
Foolosopher can you look into this bug that concerns draft.Although it is more than a years old,the bug still exists.
viewtopic.php?f=86&t=11959

Re: Draft Development in ML 3.0

PostPosted: 30 Nov 2014, 22:49
by foolosopher
Hi guys,
I tried with
Manalink 9/9:Conspiracy for the recoding of M15, and
Manalink update 14 November 2014: Khans of Tarkir
and couldn't replicate this error. Draft was working fine for me...
Anyway, let me know if there are any other bugs for draft. I took a quick look at the bug forums but didn't find anything for draft.
Up to now, I was not looking at the bug forums as I thought that draft errors are reported in this thread.

Re: Draft Development in ML 3.0

PostPosted: 26 Feb 2015, 14:46
by Aswan jaguar
I tried again and the bug is still there: if you select all 3 packs to be Alara Reborn when you select the last card of the last=3nd package it crashes.Only humans deck gets created.
Can you please check again?

Re: Draft Development in ML 3.0

PostPosted: 16 May 2015, 21:28
by foolosopher
Hi guys, found some time to look at the bug for Alara, problem is that when trying to create the opponents deck, code will try to keep only two colors for each deck and can't add lands properly so game breaks. I would suppose that this bug would affect all sets that have only multicolored cards, but haven't tried or seen it yet.
Anyway, I tried to compile the latest patch Fate Reforged, but it seems that card_id.h is missing from src folder, so could someone post it here please.
Also is there any chance that we try to integrate the gui for set selection in draft, that I made. I need someone to add gtk library to make (unfortunately the makefile that we have is too complicated for me ](*,) ) and if it would be possible to inject
gtk_init(&argc, &argv);
somewhere at the start of the magic.exe, would be a great help!

Re: Draft Development in ML 3.0

PostPosted: 17 May 2015, 03:27
by Korath
card_id.h is built in the magic_updater directory by csv2dat.exe from Manalink.csv. My current one is attached.

There currently aren't any calls into C at magic.exe startup; the closest we come runs at the start of each duel. Magic.exe uses the windows startup interface anyway, so we don't have a real argc/argv pair; the command line is passed as one big string.

Re: Draft Development in ML 3.0

PostPosted: 17 May 2015, 10:21
by foolosopher
Thanks Korath, that did the trick, still I am getting the below warning, which I had to remove -Werror, to overcome it:
-----
functions/functions.c: In function 'reveal_cards_from_hand':
functions/functions.c:10603:9: error: iteration 2147483647u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
count++;
^
functions/functions.c:10597:7: note: containing loop
while( count != -1 ){
^
cc1.exe: all warnings being treated as errors
make: *** [functions/functions.o] Error 1
-------
Regarding gtk_init(&argc, &argv); It just needs to be somewhere before the gui is invoked, so if you could place it where you mention, it could also do the trick.