Page 1 of 1

Preferred ways to contribute code/card scripts

PostPosted: 04 Jun 2012, 21:20
by pcastellazzi
melvin wrote:You're right, none of these can be scripted. Most can be implemented with a bit of Java code, except for Sage Owl (no support for looking at cards).
I been working on coding some cards my self. What's the best way to make the code reach you? Should i use google code facilities, send you the files, post them here?

Re: Preferred ways to contribute code/card scripts

PostPosted: 06 Jun 2012, 11:50
by melvin
Thank for asking this question! I've split it into a separate topic of discussion so we can keep the previous thread on card wish lists.

In order of preference, most preferred method first.

1. create a server side clone of the project from https://code.google.com/p/magarena/source/clones, then commit your changes, push to your clone, and let us know about it either on the mailing list magarena@googlegroup.com or here.

2. create a local clone of the project, commit your additions to it, and email your changeset as an attachment to magarena@googlegroups.com or post it here. You can export your changeset using "hg export", see "import/export" at http://mercurial.selenic.com/wiki/CommunicatingChanges for details.

3. If your change only involves adding new files, just post the files to the mailing list or here.

Thanks! Looking forward to your contributions. Every bit helps.

Re: Preferred ways to contribute code/card scripts

PostPosted: 06 Jun 2012, 18:00
by pcastellazzi
The thread about requestiong new cards speaks of a policy, is it the one in the thread updated?

If it is why cant we add cards that use the library? i.e. Demonic Tutor. I dont see much difference with something like Eternal Witness (except of course the selection pool is different).

Can the same algorithm used with both cards? It looks like i am missing something here, can you please give me some more details of why it should be avoided?

Re: Preferred ways to contribute code/card scripts

PostPosted: 07 Jun 2012, 12:27
by melvin
pcastellazzi wrote:The thread about requestiong new cards speaks of a policy, is it the one in the thread updated?
If you mean the first post in that thread, then no, it is outdated. I just updated it, thanks for the reminder.

pcastellazzi wrote:If it is why cant we add cards that use the library? i.e. Demonic Tutor. I dont see much difference with something like Eternal Witness (except of course the selection pool is different).

Can the same algorithm used with both cards? It looks like i am missing something here, can you please give me some more details of why it should be avoided?
Your right that tutoring is similar to graveyard recursion. Right now we don't support it but we can certainly modify our current select from graveyard mechanism to provide it. I was thinking about supporting limited forms of tutoring, such as tutoring lands, as a start.

The reason why it was avoided is probably due to the large number of potential choices that AI would have to deal with. The graveyard is typically much smaller than the library at the start of the game. If the AI starts doing badly at the start it may be hard to recover.

I'm not sure if this has been tested in practice and found to be bad for the AI or just based on the above reasoning. Therefore I would welcome any patches to implement cards that can tutor so we can see what is the actual effect on the AI.

Re: Preferred ways to contribute code/card scripts

PostPosted: 09 Jun 2012, 13:09
by ubeefx
I'm not sure if this has been tested in practice and found to be bad for the AI or just based on the above reasoning.
Tutoring was not tested. It should be possible for AI, certainly if there is some kind of logic that picks good tutoring candidates instead of evaluating all of the cards.
It would also require additional UI support.

Re: Preferred ways to contribute code/card scripts

PostPosted: 03 Aug 2012, 14:36
by b4mb4m
guys I'm creating the java code for the card appears Sangrite actually already written this up but where do I save it? the two. txt the letters are already created the image of the card is already in her briefcase. but lack the requeris_card_code I do not know where I saved! hugs!

Re: Preferred ways to contribute code/card scripts

PostPosted: 22 Aug 2012, 09:43
by melvin
b4mb4m wrote:guys I'm creating the java code for the card appears Sangrite actually already written this up but where do I save it? the two. txt the letters are already created the image of the card is already in her briefcase. but lack the requeris_card_code I do not know where I saved! hugs!
Is the card you are creating Sangrite Surge? It requires card code, have you written the Java code for it?

If you have written the Sangrit_Surge.txt card script, you can post it to this thead, viewtopic.php?f=82&t=5894

Re: Preferred ways to contribute code/card scripts

PostPosted: 23 Sep 2012, 01:53
by kdesmond
I tried to submit some files/changes through Google Code, but I'm not sure that it worked. I created a clone, added my changes, and clicked on "commit" - the question is whether it submitted the changes to just the cloned repository or the main one? I didn't see anywhere where I could "push" the changes either. My google account name is mileva.

Re: Preferred ways to contribute code/card scripts

PostPosted: 23 Sep 2012, 06:18
by melvin
Looks good, I can see your changes from https://code.google.com/r/mileva-magarena/source/list

I just merged your changes with the main repo and simplified the card code slightly. I've been working on reducing the use of Object array to pass information from the creation of the event to the resolution of the event. Do try to avoid using "new Object[]{..}" if possible. Try to get the necessary information about the event using methods like event.getPlayer and event.getSource.

If you have created some decks with the new cards, do add them to release/Magarena/decks as well.

Do join our dev mailing list, http://groups.google.com/group/magarena, you can also drop us a note on the list when you have more changes to add.

Re: Preferred ways to contribute code/card scripts

PostPosted: 27 Jul 2014, 04:28
by PalladiaMors
No longer relevant.

Re: Preferred ways to contribute code/card scripts

PostPosted: 27 Jul 2014, 05:14
by melvin
PalladiaMors wrote:Guys I'm gonna need a bit more help here since I have no programming background and no clue whatsoever about what "commit your changes" and "push to your clone" mean.
Use http://www.firemind.ch/

1) Sign in @ http://www.firemind.ch/users/sign_in
2) Click on "Submit a card script"
3) Fill in the submission form

Re: Preferred ways to contribute code/card scripts

PostPosted: 27 Jul 2014, 14:32
by ShawnieBoy
melvin wrote:
PalladiaMors wrote:Guys I'm gonna need a bit more help here since I have no programming background and no clue whatsoever about what "commit your changes" and "push to your clone" mean.
Use http://www.firemind.ch/

1) Sign in @ http://www.firemind.ch/users/sign_in
2) Click on "Submit a card script"
3) Fill in the submission form
However Firemind hasn't been updated from Magarena since April (1.48). It doesn't support cards from Theros onwards (I think).

Re: Preferred ways to contribute code/card scripts

PostPosted: 05 Aug 2014, 16:34
by mike
Just updated firemind.ch with Magarena version 1.52 and all cards up until M15