It is currently 12 Sep 2025, 20:13
   
Text Size

Restricted use mana

Post MTG Forge Related Programming Questions Here

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

Re: Restricted use mana

Postby ArsenalNut » 22 May 2012, 12:51

FabioFLX wrote:
So, you too noticed that the arrays in the ManaPool was redundant, and that the most of the problems about the mana restrictions came from the use of two different storages for the same information.
A simple "for" cycle for cards that have an Amount$ of produced mana greater that 1 should make the trick.

I had restrictions working without problems some days ago, but Saturday was my birthday and I had no time to work on the code since last friday. Should I discard my work or should it be usefull to post it anyway in some branch?
I wouldn't mind seeing how you approached the problem. Can you check it into a new branch?
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Restricted use mana

Postby FabioFLX » 22 May 2012, 15:20

ArsenalNut wrote:
FabioFLX wrote:
So, you too noticed that the arrays in the ManaPool was redundant, and that the most of the problems about the mana restrictions came from the use of two different storages for the same information.
A simple "for" cycle for cards that have an Amount$ of produced mana greater that 1 should make the trick.

I had restrictions working without problems some days ago, but Saturday was my birthday and I had no time to work on the code since last friday. Should I discard my work or should it be usefull to post it anyway in some branch?
I wouldn't mind seeing how you approached the problem. Can you check it into a new branch?
:? What's...? I told I'm rewriting all of my code from scratch to made it readable and upgradable by others. This is taking time even because I have to dedicate time to my regular job as well.
By the way, you know I have a working version with ugly-to-read code I can immediately upload.

Here it is: http://www.radiorock.org/flx/altro/file_linkati_altrove/forge.tar.bz2 . Releasing a patch from that kind of code is almost a pain!
The file contains just the src/mana/java/forge directory.
To use a restriction you can try adding "RestrictForType$ Artifact" to the mana ability parameters of a card.
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: Restricted use mana

Postby Sloth » 22 May 2012, 16:35

Maybe i misunderstood what has happened, but i'm a little disappointed about the communication concerning this feature. Please correct me if i'm wrong.

@ArsenalNut: You should have made clear that you wanted to code this yourself. That would have saved FabioFLX some now unused work.

@FabioFLX: I hope you still want to contribute to this project. Better start with something small, non-debatable to get used to the SVN. See if someone feels responsible for/works on that part of the code. We have lots of uncovered/understaffed areas.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Restricted use mana

Postby ArsenalNut » 22 May 2012, 17:10

Sloth wrote:Maybe i misunderstood what has happened, but i'm a little disappointed about the communication concerning this feature. Please correct me if i'm wrong.

@ArsenalNut: You should have made clear that you wanted to code this yourself. That would have saved FabioFLX some now unused work.

@FabioFLX: I hope you still want to contribute to this project. Better start with something small, non-debatable to get used to the SVN. See if someone feels responsible for/works on that part of the code. We have lots of uncovered/understaffed areas.
You're right. I should have said I wanted to work it when FabioFLX first posted. I had been planning to rework the mana pool and add restrictions for some time.

@FabioFLX - Sorry, I should have communicated better and saved you some work.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Restricted use mana

Postby FabioFLX » 22 May 2012, 18:19

Ohhh... Maybe it's I don't speak English as my main language, too.
No prob anyway, I'm here to contribute to Forge whatever the project may need :)

Well, so, which undercovered and/or understaffed areas need one to work in the most?
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: Restricted use mana

Postby Sloth » 22 May 2012, 19:46

FabioFLX wrote:Ohhh... Maybe it's I don't speak English as my main language, too.
No prob anyway, I'm here to contribute to Forge whatever the project may need :)

Well, so, which undercovered and/or understaffed areas need one to work in the most?
A function that is long overdue for an update is getSpellCostChange. This function gets a spell/ability that should be played and returns its modified mana cost (by cards like Helm of Awakening).
Example of current script:
Code: Select all
K:CostChange:All:Less:1:Spell:All:All:NoSpecial:Spells cost 1 less to cast.
The plan is to convert this to be a static ability and use the modern scripting system.
First Draft:
Code: Select all
S:Mode$ CostChange | Affected$ Card | Type$ Spell | Reduction$ 1
If you agree to take a shot, I can set up a new class called StaticAbilityCostChange.java and hook it up. Both systems will work parallel. You can then convert the cards from the old system to the new system at your own pace.

Some new cards that can be made possible: Not of This World, Spellwild Ouphe, Elderwood Scion, Dream Chisel, Locket of Yesterdays, Semblance Anvil, Exiled Doomsayer, Kaervek's Torch.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Restricted use mana

Postby ArsenalNut » 23 May 2012, 05:41

I think restricted use mana is ready for more widespread play testing. I have the following cards implemented

Altar of the Lost
Ancient Ziggurat
Cavern of Souls
Eldrazi Temple
Food Chain
Geosurge
Grand Architect
Metamorphosis
Mishra's Workshop
Myr Reservoir
Pillar of the Paruns
Primal Beyond
Rosheen Meanderer
Smokebraider
Soldevi Machinist
Somberwald Sage
Untaidake, the Cloud Keeper
Vedalken Engineer

It might be possible to do Ice Cauldron also. I could not do Adarkar Unicorn and Snowfall because I couldn't find an easy way to tell if the cost was a cumulative upkeep. I could not do Piracy either.

The pumping spells that were paid with certain mana needs more work before Boseiju, Who Shelters All and Hall of the Bandit Lord can be implemented.

Known issues
Restricted mana cannot be used to pay Multikicker and Suspend costs due to the way these are implemented in Forge. I tested Kicker, Evoke, Retrace, and Madness and restricted mana could be used for these alternative/additional costs. Mana restricted to casting creatures could not be used to pay Unearth either.

Here's a couple of changes to the behavior of mana sources and the mana pool that I noted. When paying a cost by selecting the mana source directly, the mana pool will use as much of the mana produced as it can to pay the cost. For instance if you click a Black Lotus to pay for a {2} {G} spell, three green mana will be produced and all three will be used. When clicking the mana pool to pay, the mana color selected will always be subtracted one at time. Also there is no feedback when you try to pay a cost that does meet the mana restriction, the selection is just ignored.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Restricted use mana

Postby FabioFLX » 23 May 2012, 07:51

Sloth wrote:
FabioFLX wrote:Ohhh... Maybe it's I don't speak English as my main language, too.
No prob anyway, I'm here to contribute to Forge whatever the project may need :)

Well, so, which undercovered and/or understaffed areas need one to work in the most?
A function that is long overdue for an update is getSpellCostChange. This function gets a spell/ability that should be played and returns its modified mana cost (by cards like Helm of Awakening).
Example of current script:
Code: Select all
K:CostChange:All:Less:1:Spell:All:All:NoSpecial:Spells cost 1 less to cast.
The plan is to convert this to be a static ability and use the modern scripting system.
First Draft:
Code: Select all
S:Mode$ CostChange | Affected$ Card | Type$ Spell | Reduction$ 1
If you agree to take a shot, I can set up a new class called StaticAbilityCostChange.java and hook it up. Both systems will work parallel. You can then convert the cards from the old system to the new system at your own pace.

Some new cards that can be made possible: Not of This World, Spellwild Ouphe, Elderwood Scion, Dream Chisel, Locket of Yesterdays, Semblance Anvil, Exiled Doomsayer, Kaervek's Torch.
Ok, this is interesting.
Should we open a new thread on the dev's corner to take this one clean, then?
So, when you're ready, set up that class please and I'll begin developing on it.
Cheers
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: Restricted use mana

Postby ArsenalNut » 23 May 2012, 15:05

I merged the mana_restriction branch into the Trunk earlier today. The one thing I didn't test completely was the AI using mana from its mana pool. This doesn't happen very often in a the majority of games so it's hard to test. There was a quest that put a couple cards into play that added mana every turn and kept the mana pool from clearing. Can someone remind me what the two cards used in the quest are?
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Restricted use mana

Postby friarsol » 23 May 2012, 15:40

ArsenalNut wrote:I merged the mana_restriction branch into the Trunk earlier today. The one thing I didn't test completely was the AI using mana from its mana pool. This doesn't happen very often in a the majority of games so it's hard to test. There was a quest that put a couple cards into play that added mana every turn and kept the mana pool from clearing. Can someone remind me what the two cards used in the quest are?
Upwelling and Eladamri's Vineyard
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Restricted use mana

Postby timmermac » 24 May 2012, 14:41

friarsol wrote:
ArsenalNut wrote:I merged the mana_restriction branch into the Trunk earlier today. The one thing I didn't test completely was the AI using mana from its mana pool. This doesn't happen very often in a the majority of games so it's hard to test. There was a quest that put a couple cards into play that added mana every turn and kept the mana pool from clearing. Can someone remind me what the two cards used in the quest are?
Upwelling and Eladamri's Vineyard
Also, doesn't Omnath, Locus of Mana keep green mana in the pool permanently?
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: Restricted use mana

Postby friarsol » 24 May 2012, 15:32

timmermac wrote:Also, doesn't Omnath, Locus of Mana keep green mana in the pool permanently?
Yea but Arsenal was talking about two specific cards that a certain quest uses.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Restricted use mana

Postby ArsenalNut » 24 May 2012, 16:06

friarsol wrote:
timmermac wrote:Also, doesn't Omnath, Locus of Mana keep green mana in the pool permanently?
Yea but Arsenal was talking about two specific cards that a certain quest uses.
I was able to find a Game state file someone had posted when I was fixing bugs for the Any mana feature. The AI used the accumulated mana from Upwelling and Eladamri's Vineyard to cast several creatures so the mana pool changes appear to be working fine.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Restricted use mana

Postby Sloth » 03 Jul 2012, 20:55

I post it here even though i'm not sure it is related:

It seems the human player can no longer pay colorless hybrid mana (2/W) with off-color or colorless mana. I couldn't find any code that could possibly handle this. Does anyone know more about it?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Restricted use mana

Postby ArsenalNut » 03 Jul 2012, 22:18

Sloth wrote:I post it here even though i'm not sure it is related:

It seems the human player can no longer pay colorless hybrid mana (2/W) with off-color or colorless mana. I couldn't find any code that could possibly handle this. Does anyone know more about it?
I think Max's ManaCost changes are the likely culprit. The changes were made at the same time I was working the restricted mana stuff. I haven't looked at his code changes in detail but I would start looking at the ManaCostShard class. I see a bunch of stuff in there with "OR_2_Colorless" in the name.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 17 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 17 guests

Login Form