It is currently 16 Apr 2024, 19:03
   
Text Size

The hardest part of Magic programming is the rules

General Discussion of the Intricacies

Moderator: CCGHQ Admins

The hardest part of Magic programming is the rules

Postby mtgrares » 10 Dec 2009, 21:16

I used to think that the hardest part was encoding the cards because there are so many possibilities. That part is still hard enough but the rules engine is the hardest. The coding is always going to be a little complicated no matter how you slice it AND you have to know enough of the rules in order to program it correctly.

I remember back when I thought Elvish Piper targeted a creature card. Of course Elvish Piper doesn't target but I thought it did since the ability functioned like it was targeted. I guess you can't target a card in your hand but who really knows.

Yesterday I had to look up Glorious Charge to see if you played it first then cast a creature, would that creature get +1/+1. The answer is no but it almost seems like it would. I guess Glorious Charge generates a one-shot effect and not a continuous one. Since I'm a perfectionist and everyone loves the comprehensive rules (joke) below is the whole section about one-shot and continuous effects.

610 One-Shot Effects

610.1 A one-shot effect does something just once and doesn't have a duration. Examples include dealing damage, destroying a permanent, putting a token onto the battlefield, and moving an object from one zone to another.

610.2 Some one-shot effects create a delayed triggered ability, which instructs a player to do something later in the game (usually at a specific time) rather than as the spell or ability that's creating the one-shot effect resolves. See rule 603.7.

611 Continuous Effects

611.1 A continuous effect modifies characteristics of objects, modifies control of objects, or affects players or the rules of the game, for a fixed or indefinite period.

611.2 A continuous effect may be generated by the resolution of a spell or ability.

611.2a A continuous effect generated by the resolution of a spell or ability lasts as long as stated by the spell or ability creating it (such as "until end of turn"). If no duration is stated, it lasts until the end of the game.

611.2b Some continuous effects generated by the resolution of a spell or ability have durations worded "for as long as . . . ." If the "for as long as" duration never starts, or it ends before the moment the effect would first be applied, the effect does nothing. It doesn't start and immediately stop again, and it doesn't last forever.

611.2c If a continuous effect generated by the resolution of a spell or ability modifies the characteristics or changes the controller of any objects, the set of objects it affects is determined when that continuous effect begins. After that point, the set won't change. (Note that this works differently than a continuous effect from a static ability.) A continuous effect generated by the resolution of a spell or ability that doesn't modify the characteristics or change the controller of any objects modifies the rules of the game, so it can affect objects that weren't affected when that continuous effect began.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: The hardest part of Magic programming is the rules

Postby Marek14 » 10 Dec 2009, 23:02

Yes, from what I've seen, the biggest hurdle to Magic programs comes from rules their creators didn't realize they would need to implement :)
Marek14
Tester
 
Posts: 2759
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 296 times

Re: The hardest part of Magic programming is the rules

Postby frwololo » 11 Dec 2009, 00:49

Definitely.
I started working on wagic with "my idea on how the rules worked in the Revised edition", at a time I didn't even know the "comprehensive rules" existed. I didn't even know the rules had changed since I stopped playing. I was surprised to see that interrupts and instants had become the same thing for example.

As I implement more cards, my lack of knowledge of the rules is becoming a huge limitation. Fortunately, my knowledge of the rules increases as I do, so...
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: The hardest part of Magic programming is the rules

Postby mtgrares » 11 Dec 2009, 18:51

frwololo wrote:As I implement more cards, my lack of knowledge of the rules is becoming a huge limitation. Fortunately, my knowledge of the rules increases as I do, so...
You said it. I'm trying to become a better "rules lawyer" myself.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: The hardest part of Magic programming is the rules

Postby Marek14 » 11 Dec 2009, 19:19

mtgrares wrote:
frwololo wrote:As I implement more cards, my lack of knowledge of the rules is becoming a huge limitation. Fortunately, my knowledge of the rules increases as I do, so...
You said it. I'm trying to become a better "rules lawyer" myself.
I'm not much for programming as such, but I know the rules and I think in algorithms :) Plus, I tend to remember the exceptions. With a bit of training, I'm sure I could at least READ the code, if not write it, and notice problems :)
Marek14
Tester
 
Posts: 2759
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 296 times

Re: The hardest part of Magic programming is the rules

Postby Incantus » 12 Dec 2009, 00:37

Marek14 wrote:Yes, from what I've seen, the biggest hurdle to Magic programs comes from rules their creators didn't realize they would need to implement :)
Marek14, you basically mean everything implemented in Incantus after I met you and TheScient :)
Incantus
DEVELOPER
 
Posts: 267
Joined: 29 May 2008, 15:53
Has thanked: 0 time
Been thanked: 3 times

Re: The hardest part of Magic programming is the rules

Postby Marek14 » 12 Dec 2009, 08:28

Incantus wrote:
Marek14 wrote:Yes, from what I've seen, the biggest hurdle to Magic programs comes from rules their creators didn't realize they would need to implement :)
Marek14, you basically mean everything implemented in Incantus after I met you and TheScient :)
Basically, yes :D
Marek14
Tester
 
Posts: 2759
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 296 times

Re: The hardest part of Magic programming is the rules

Postby frwololo » 14 Dec 2009, 02:11

I thought about this again, and I think the hardest part is to actually make the game fun to play.

You can have an engine that perfectly reproduces the rules but is not fun to play. At the end of the day, what's the difference between it and the official "Magic Online" or even MWS ? MWS handles no rule, so it virtually handles all of them already.

MTGForge offers drafting and quests for example.
Wagic has the credits system, a random deck mode, Momir Basic,...
Manalink has Momir Basic, Challenges, and relies on an engine that already included an adventure
Magic Online requires you to play with real money, buy real cards, part of the fun comes from there, I guess

We all try to offer something that the other engines don't have, and I don't believe it's related to the rules. Rules are boring to code most of the time. Not hard.
Making the game fun to play IS hard.
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: The hardest part of Magic programming is the rules

Postby Marek14 » 14 Dec 2009, 08:00

frwololo wrote:I thought about this again, and I think the hardest part is to actually make the game fun to play.

You can have an engine that perfectly reproduces the rules but is not fun to play. At the end of the day, what's the difference between it and the official "Magic Online" or even MWS ? MWS handles no rule, so it virtually handles all of them already.

MTGForge offers drafting and quests for example.
Wagic has the credits system, a random deck mode, Momir Basic,...
Manalink has Momir Basic, Challenges, and relies on an engine that already included an adventure
Magic Online requires you to play with real money, buy real cards, part of the fun comes from there, I guess

We all try to offer something that the other engines don't have, and I don't believe it's related to the rules. Rules are boring to code most of the time. Not hard.
Making the game fun to play IS hard.
What lost of these programs have over MTGO is the AI.

For me, I am a hardcore Melvin. The rules ARE the fun part for me. I don't like deckbuilding that much because it requires trading. I don't even like playing with other people that much.

I like the stories and creative parts, and I like the rules. I read card lists for FUN, even :)

At the end of the day, I'm thinking up various projects... I wonder whether a Shandar look-alike might be feasible somewhere, with every creature in Magic eventually showing up in the world with a deck of its own... etc. Participating in these forums and helping (even a bit) with the rules IS my idea of fun of Magic :D
Marek14
Tester
 
Posts: 2759
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 296 times

Re: The hardest part of Magic programming is the rules

Postby mtgrares » 14 Dec 2009, 18:59

frwololo wrote:I thought about this again, and I think the hardest part is to actually make the game fun to play. We all try to offer something that the other engines don't have, and I don't believe it's related to the rules. Rules are boring to code most of the time. Not hard. Making the game fun to play IS hard.
Yes the ultimate goal is "fun", which is a slippery concept.

Forge's unique features: randomly generated two color decks, quests, and AI all came from my (distorted) mind.

AI - I'm not online much so I wanted an opponent I could play against.

Quest - I love Shandalar and Forge's quest mode pays homage to it. You really feel like a winner when you beat the AI with weaker cards.

Random, generated decks - I love new cards and decks but I don't like to laboriously create decks, so the generate deck option was born. (I really need generate random 2 color decks that HAVE A MANA CURVE, so the decks would be more playable.)

And that doesn't count Forge's draft and sealed deck mode which I used to play everyday.

It is inspiring when other people contribute cards and even release whole new versions. Forge has turned out to be better (and more addictive) than I even hoped. I presume frwololo and incantus (the author) would probably say the same about their projects.

p.s.
In case you have never play Forge's quest mode, you start with a random cardpool and your goal is to win a certain number of matches against the AI, which ranges from 10 to 40. You also receive more cards during your quest.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: The hardest part of Magic programming is the rules

Postby frwololo » 15 Dec 2009, 00:28

mtgrares wrote:It is inspiring when other people contribute cards and even release whole new versions. Forge has turned out to be better (and more addictive) than I even hoped. I presume frwololo and incantus (the author) would probably say the same about their projects.
Definitely. The best is to have other people improve the game (that was once "your" game), so that next time you download the sources, you get amazed at all the new cool features that have been added. I love that kind of thing :)
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: The hardest part of Magic programming is the rules

Postby mtgrares » 16 Dec 2009, 19:21

Forge has so many new cards that I can't really keep track of them all. I certainly can't complain, 12/14 was the newest release that had 187 new cards including Goblin Sharpshooter, Gaddock Teeg, and Meddling Mage.

I think I'm in Magic heaven. :lol:
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times


Return to Magic Rules Engine Programming

Who is online

Users browsing this forum: No registered users and 11 guests


Who is online

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

Login Form