It is currently 19 Apr 2024, 17:59
   
Text Size

Contributing to Forge

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Contributing to Forge

Postby Myrd » 27 Nov 2014, 00:50

Hey all,

I'm interested in contributing to Forge. I've been a contributor to various other open source projects over the years (would like to link them, but looks like forum is blocking links to prevent spam) and recently Forge sparked my interest.

I've already coded up a patch for a bug I noticed with Forge - which is with how convoke costs are paid by the player. Prior to my patch, the code would try to pay the mana symbols as they appear - for example if you convoke with a white creature and click "white" in the dialog, but the cost for the spell is "1WW", it would actually use that white mana to pay for the "1" portion of the cost, leaving "WW" to be paid (which is problematic if you have a swamp and a plains untapped which you were planning to use in addition to the white creature).

Anyway, I'm attaching the patch here, which moves the logic for paying the cost from the UI code to the engine code (and re-uses existing code there) and also adds some unit tests for it.

I'm also planning to contribute more changes, so let me know if you'd like me to keep posting here with patches or if there's a more optimal process I can use. Thanks!
Attachments
convoke.txt
(5.98 KiB) Downloaded 248 times
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Contributing to Forge

Postby Chris H. » 27 Nov 2014, 16:43

Myrd wrote:Hey all,

I'm interested in contributing to Forge. I've been a contributor to various other open source projects over the years (would like to link them, but looks like forum is blocking links to prevent spam) and recently Forge sparked my interest.
 
Once you have posted some number of messages (5) you will find that you will no longer have that restriction. :)
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Contributing to Forge

Postby Myrd » 28 Nov 2014, 06:20

Chris H. wrote:
Myrd wrote:Hey all,

I'm interested in contributing to Forge. I've been a contributor to various other open source projects over the years (would like to link them, but looks like forum is blocking links to prevent spam) and recently Forge sparked my interest.
 
Once you have posted some number of messages (5) you will find that you will no longer have that restriction. :)
Good to know, thanks!
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Contributing to Forge

Postby friarsol » 28 Nov 2014, 15:08

Hey Myrd,

I'm not in my traditional developing environment for Thanksgiving weekend. If someone doesn't scope out your patch, I'll take a look when I get back. Typically we ask new developers to post a few patches (as you have) before giving them full commit privileges.

Are there any specific parts you are interested in developing? Some of us who have been here for a while can give some guidance about spots to chec out if you need any,
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Contributing to Forge

Postby Myrd » 28 Nov 2014, 21:30

Here's another patch. It fixes the bug where card draw animations are shown even if you're in another tab (e.g. if you made two AIs play).

In terms of what I want to work on, I figured I'd start by fixing some bugs I noticed and maybe later look at improving the AI a little bit and maybe implement an automated tournament mode between AIs - e.g. useful for testing decks (once you trust the AIs to play well).
Attachments
anim.txt
(1009 Bytes) Downloaded 233 times
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Contributing to Forge

Postby Myrd » 30 Nov 2014, 18:44

Here's another patch.

This one fixes a few cases where the underlying card of Morph card gets revealed to the human in the game log, where it shouldn't be (e.g. when being attacked by a morph and some spells/abilities targeting Morphs - e.g. equipping). Also makes it say Morph when being attacked by a Morph creature instead of an empty string.

Note: There's still a bug (unrelated to this patch) where targeting a creature (morphed or not) in play doesn't print the target name correctly in the game log. I have a fix for that too, but I'll do that in a separate patch.

Since I've not heard any replies about accepting my patches, I'll stop working on Forge for a bit until I hear back. Let me know if my patches look good to you guys and if the quality is up to your standards, I'd be happy to commit them directly if you guys give me access. Thanks!
Attachments
morph.txt
(3.87 KiB) Downloaded 246 times
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Contributing to Forge

Postby Chris H. » 30 Nov 2014, 23:12

Myrd wrote:Since I've not heard any replies about accepting my patches, I'll stop working on Forge for a bit until I hear back. Let me know if my patches look good to you guys and if the quality is up to your standards, I'd be happy to commit them directly if you guys give me access. Thanks!
 
Thank you Myrd.

It is thanksgiving weekend for may people and they are likely out of town visiting their family.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Contributing to Forge

Postby friarsol » 01 Dec 2014, 00:57

Hey Myrd,

Thanks for your patience. Aside from being away for Thanksgiving, I spent most of that time holed up being sick instead of being able to sneak away and monitor Forge to a larger extent when I have the time.

Anyway, I just reviewed them now, and they all look pretty solid, so I've added you onto the development group, so welcome aboard! I haven't committed the patches, but let us know if you have trouble committing these (and more) to the svn, or when you have any other questions.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Contributing to Forge

Postby Myrd » 01 Dec 2014, 06:03

friarsol wrote:Hey Myrd,

Thanks for your patience. Aside from being away for Thanksgiving, I spent most of that time holed up being sick instead of being able to sneak away and monitor Forge to a larger extent when I have the time.

Anyway, I just reviewed them now, and they all look pretty solid, so I've added you onto the development group, so welcome aboard! I haven't committed the patches, but let us know if you have trouble committing these (and more) to the svn, or when you have any other questions.
Thanks! Will go ahead and commit them now. :)
Myrd
 
Posts: 87
Joined: 24 Nov 2014, 05:58
Has thanked: 4 times
Been thanked: 32 times

Re: Contributing to Forge

Postby HarePaiR » 02 Dec 2014, 14:09

Since this thread is recent I thought I hope it's okay to jump in. I looked through the FAQ on ways to contribute but couldn't find a general guide...I may not be using the search function well enough!

I do not have nearly the programming experience that Myrd appears to, and haven't worked on many collaborative projects, but I know a little (~1 year of college CS, 5+ years of scientific programming), and I figure every little bit might help, maybe even if it's just card scripting?

I'm super impressed with the program (thank you all so much for your time and effort!), stumbled across it last week because I was interested in drafting Alpha and maybe tweaking it to make it a better draft environment, and was able to get up and running super fast (new set with boosters available to draft, removing ante cards, fiddling with rarities, card rankings, etc.). Anyway, as you can probably tell I am most interested in the draft AI, but would basically like to get my feet wet with little, hard-to-screw-up things and see what happens from there.

If it's a bit too much of a hassle to have more of a casual programmer on the project, I'll stick to bug reports and feature suggestions, but I would love to help out directly!
HarePaiR
 
Posts: 21
Joined: 02 Dec 2014, 11:13
Has thanked: 11 times
Been thanked: 2 times

Re: Contributing to Forge

Postby friarsol » 02 Dec 2014, 16:58

Yea I don't know how frequently we get new developers, so that's why it's not there. We do have a bunch of information on the Wiki about how to get rolling:

http://www.slightlymagic.net/wiki/Forge#Development

There's a large range of experience levels for Developers on Forge over the years. Plenty of people with little to no development experience have come in and learned how the card scripts work and focus mainly on that. It sounds like you have enough experience to be able to play around with things, and learn how different aspects are setup. As far as older set drafting, since we pull our draft data for the AI from Bestiare, a lot of older sets don't have a solid set of draft rankings. This thread might be interesting to you viewtopic.php?f=26&t=15834

The second aspect of draft AI that matters is the playability by the AI of the cards, which is a different aspect of the beast. Since cards are marked as not playable by the AI for many different reasons. As you get more familiar

Not sure if I answered your question. Definitely the easiest way to get started is to look into a bug you've noticed or a small feature you might want and look into getting it implemented, then post the patch in a thread with a short discussion about the goal of the patch and we'll take it from there.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Contributing to Forge

Postby Phlyghtt79 » 05 Apr 2015, 04:02

Been trying to play AI vs Standard Format decks. I wish I knew how to program at all, AI totally misuses Nykthos, Shrine to Nyx. I'll have to look into this. I didn't know where to post this so I had to just get it off my chest.
Phlyghtt79
 
Posts: 6
Joined: 28 Aug 2013, 18:05
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 73 guests


Who is online

In total there are 73 users online :: 0 registered, 0 hidden and 73 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 73 guests

Login Form