Phase Work
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
65 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
Phase Work
by friarsol » 22 Oct 2010, 04:06
Well I have most of the phase reworking done I think. I've added a few phases that didn't exist before, and gotten rid of a few that weren't actual phases.
I think it would be good if we had some type of UI that users could mark which Phases they want to stop on (sort of like how we have the menu item for End of Turn, but available as UI buttons and for any phase). It could also highlight what the current phase was. A natural place for it could be in between the two battlefield zones.
A few good things that came up with this work:
Now that I was in here and mucking around, I think I have some ideas on how to get the AI using SAs during combat, or at the end of the humans turn. At the very least, I know where it needs to happen.
Another thing is that I've updated the combat system so it no longer uses the stack. Damage is assigned immediately as we enter the Combat Step, and SAs can be used afterwards. So no more Mogg Fanatic tricks once this code gets submitted.
I have a feeling this won't be submitted until next week, since I'm sure there are bugs to iron out.
I think it would be good if we had some type of UI that users could mark which Phases they want to stop on (sort of like how we have the menu item for End of Turn, but available as UI buttons and for any phase). It could also highlight what the current phase was. A natural place for it could be in between the two battlefield zones.
A few good things that came up with this work:
Now that I was in here and mucking around, I think I have some ideas on how to get the AI using SAs during combat, or at the end of the humans turn. At the very least, I know where it needs to happen.
Another thing is that I've updated the combat system so it no longer uses the stack. Damage is assigned immediately as we enter the Combat Step, and SAs can be used afterwards. So no more Mogg Fanatic tricks once this code gets submitted.
I have a feeling this won't be submitted until next week, since I'm sure there are bugs to iron out.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by Sloth » 22 Oct 2010, 05:32
Sounds great, Sol. We will finally catch up with the M10 rules changes.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Phase Work
by Rob Cashwalker » 22 Oct 2010, 14:14
YAAAYYY!!
AI Instants during combat are definitely possible, based on my own observations of that section of code. We would just add canPlayAI_Att() and canPlayAI_Blk() methods to the SA class.
AI Instants during combat are definitely possible, based on my own observations of that section of code. We would just add canPlayAI_Att() and canPlayAI_Blk() methods to the SA class.
The Force will be with you, Always.
-

Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
-

DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Phase Work
by juzamjedi » 22 Oct 2010, 16:16
In all honesty this is probably the biggest upgrade to my gaming experience I've heard about in a while. It's disappointing that the AI doesn't use pump spells, removal, etc. mid-combat right now or at end of my turn. It would be fantastic to see the AI go for end-of-turn-Fact-or-Fiction-you-lose or blow out my Grave Titan with a Giant Growth 
Re: Phase Work
by friarsol » 28 Oct 2010, 14:06
Can I ask that people stay away from adding code directly into the Phases until I'm done with this work? I have no problem resolving issues elsewhere, but I have some major changes in the Phase structure and if you add code in the Inputs or in Phase, I could easily miss transferring it to the new place and have the card be rendered useless because of this. Thanks.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by Chris H. » 28 Oct 2010, 21:54
`friarsol wrote:Can I ask that people stay away from adding code directly into the Phases until I'm done with this work? I have no problem resolving issues elsewhere, but I have some major changes in the Phase structure and if you add code in the Inputs or in Phase, I could easily miss transferring it to the new place and have the card be rendered useless because of this. Thanks.
I have spent some time recently converting string work into StringBuilder. There are quite a few setStackDescriptions that need to be converted. This can create a burden on the other people.
These classes still need StringBuilder conversions. I guess that GameActionUtil could be put off until you finish your work. Do you see any classes below that look like it would not hold you back on your work?
CardFactory
CardFactoryUtil
EndOfTurn
GameActionUtil
NameChanger
PlayerZone_ComesIntoPlay
QuestUtil
Spell
Spell_Evoke
Spell_Permanent
SpellAbility
-

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: Phase Work
by friarsol » 28 Oct 2010, 22:06
Actually, there's not much in GameActionUtil that shouldn't merge easily, so feel free to finish that off.
It's mostly just Phase.java, and the multiple Input classes that the majority of my changes are happening in. The rest of the classes I have changes in are mostly collateral damage of making function names more descriptive, and shouldn't have any issues merging.
It's mostly just Phase.java, and the multiple Input classes that the majority of my changes are happening in. The rest of the classes I have changes in are mostly collateral damage of making function names more descriptive, and shouldn't have any issues merging.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by Chris H. » 28 Oct 2010, 22:19
`friarsol wrote:Actually, there's not much in GameActionUtil that shouldn't merge easily, so feel free to finish that off.
It's mostly just Phase.java, and the multiple Input classes that the majority of my changes are happening in. The rest of the classes I have changes in are mostly collateral damage of making function names more descriptive, and shouldn't have any issues merging.
Ah, good. I do not think that we have strings to convert in the Phase/Input classes.
-

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: Phase Work
by friarsol » 28 Oct 2010, 22:51
Probably not. And either way, I plan on deleting half of them bwahahahaha.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by friarsol » 31 Oct 2010, 22:14
Ok. I'm planning on submitting this code on Monday unless we are going to release a new beta shortly after, then I'll wait till after it's released. There probably will be some kinks to work out, but I haven't noticed any major issues with all my testing.
Occasionally after the AI passes priority during its turn the prompt thinks there is something on the stack but there isn't. This causes a small issue where the user has to press OK twice to goto the next phase (once for the phantom ability on the stack and one to pass on an empty stack). I'm trying to track this down and think it may have to do with some abilities triggering but not actually hitting the stack. I'm not certain and still trying to replicate this consistently to debug it.
These changes will have more phase stops than before, so we should get some way for the user to auto-pass priority for certain steps (upkeeps, draw phases etc). We can probably just do this in a File Menu for now (maybe have a File Menu for Auto-Passing Phases) but I'd prefer a UI Phase Bar that not only shows which we phase/turn we're in, but also makes it possible to skip/stop on certain phases.
Occasionally after the AI passes priority during its turn the prompt thinks there is something on the stack but there isn't. This causes a small issue where the user has to press OK twice to goto the next phase (once for the phantom ability on the stack and one to pass on an empty stack). I'm trying to track this down and think it may have to do with some abilities triggering but not actually hitting the stack. I'm not certain and still trying to replicate this consistently to debug it.
These changes will have more phase stops than before, so we should get some way for the user to auto-pass priority for certain steps (upkeeps, draw phases etc). We can probably just do this in a File Menu for now (maybe have a File Menu for Auto-Passing Phases) but I'd prefer a UI Phase Bar that not only shows which we phase/turn we're in, but also makes it possible to skip/stop on certain phases.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by Chris H. » 31 Oct 2010, 22:52
I guess that I could try to release a beta tonight or tommorrow morning based on rev 3152. We have over 100 new cards and some changes to the new gui.
-

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: Phase Work
by friarsol » 01 Nov 2010, 01:00
Awesome. That'll give us a full beta cycle to work out any kinks that might show up. I'm sure there are other things that will need some work, but using all the appropriate phases will allow us to fix a lot of cards that currently can be activated inappropriately (like Hammer of Bogardan)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by friarsol » 01 Nov 2010, 15:27
Ok. I just submitted the first submission of the Phase work. I've tested this a fair amount in the last few days, and haven't had anything major break. If you notice anything that's weird, just post here so i can look into it. The more details you give the easier it'll be to debug.
As I said in a previous post we still need some way to allow users to auto-pass priority in phases they don't care about, such as draw phases.
There may be a small glitch where a user is given priority, but the message claims there is something on the stack, when really there isn't. I have a strong feeling it has to do with AI Abilities that should goto the stack, but instead just resolve. But haven't been able to confirm yet. When the player passes priority, the message resets to say there isn't anything on the Stack and then the Phase can end.
Thanks
As I said in a previous post we still need some way to allow users to auto-pass priority in phases they don't care about, such as draw phases.
There may be a small glitch where a user is given priority, but the message claims there is something on the stack, when really there isn't. I have a strong feeling it has to do with AI Abilities that should goto the stack, but instead just resolve. But haven't been able to confirm yet. When the player passes priority, the message resets to say there isn't anything on the Stack and then the Phase can end.
Thanks
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Phase Work
by slapshot5 » 01 Nov 2010, 15:49
New bug:
1. I started the game with a Library of Alexandria in my hand, which I played during first turn Main1
2. During my turn 2, Main1, I activated Library of Alexandria draw card ability
3. it gets put on the stack, but never taken off the stack. I click OK a dozen times, but nothing happens and I can't continue
The stack thinks it's empty, but I have not drawn a card.
screenshot:
This is reproducible.
-slapshot5
1. I started the game with a Library of Alexandria in my hand, which I played during first turn Main1
2. During my turn 2, Main1, I activated Library of Alexandria draw card ability
3. it gets put on the stack, but never taken off the stack. I click OK a dozen times, but nothing happens and I can't continue
The stack thinks it's empty, but I have not drawn a card.
screenshot:
This is reproducible.
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
65 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 14 guests