Page 1 of 5

Phase Work

PostPosted: 22 Oct 2010, 04:06
by friarsol
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.

Re: Phase Work

PostPosted: 22 Oct 2010, 05:32
by Sloth
Sounds great, Sol. We will finally catch up with the M10 rules changes.

Re: Phase Work

PostPosted: 22 Oct 2010, 14:14
by Rob Cashwalker
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.

Re: Phase Work

PostPosted: 22 Oct 2010, 15:47
by DennisBergkamp
Wow, very nice!!!

Re: Phase Work

PostPosted: 22 Oct 2010, 16:16
by juzamjedi
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

PostPosted: 28 Oct 2010, 14:06
by friarsol
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.

Re: Phase Work

PostPosted: 28 Oct 2010, 21:54
by Chris H.
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

Re: Phase Work

PostPosted: 28 Oct 2010, 22:06
by friarsol
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.

Re: Phase Work

PostPosted: 28 Oct 2010, 22:19
by Chris H.
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. :)

Re: Phase Work

PostPosted: 28 Oct 2010, 22:51
by friarsol
Probably not. And either way, I plan on deleting half of them bwahahahaha.

Re: Phase Work

PostPosted: 31 Oct 2010, 22:14
by friarsol
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.

Re: Phase Work

PostPosted: 31 Oct 2010, 22:52
by Chris H.
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.

Re: Phase Work

PostPosted: 01 Nov 2010, 01:00
by friarsol
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)

Re: Phase Work

PostPosted: 01 Nov 2010, 15:27
by friarsol
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

Re: Phase Work

PostPosted: 01 Nov 2010, 15:49
by slapshot5
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:

lib-of-alex.PNG


This is reproducible.

-slapshot5