It is currently 08 Sep 2025, 08:28
   
Text Size

Revision 19514

Post MTG Forge Related Programming Questions Here

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

Revision 19514

Postby friarsol » 11 Feb 2013, 00:45

Max, you seem to change intended functionality every time you rewrite something. Please be more aware of what the functionality is when you decide it's necessary to rewrite things (and some of your recent rewrites seem overzealous in my eyes).

We had a discussion that VAssignDamage should not auto assign all the damage by default when the popup dialog. In fact, this functionality did exist in that form for a short amount of time before it was changed back. This was to prevent User mistakes of skipping through the dialog in the cases of damage prevention and any similar cases that may need to be considered. It's easy enough to click the Auto button for anyone who needs to (just as easy as clicking the OK button on an auto-assigned dialog), but by changing this functionality, it's less clear what's going on here.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Revision 19514

Postby Max mtg » 11 Feb 2013, 01:59

I cannot just pass by, when there are calls like Singletons.getModel.getGame.getCombat.doSomething() from UI classes that make me cry, or when expected-to-be-simple routines like canAssignToIndex() take 40 lines of code and one still cannot understand how it works, why is there an active index, updated then UI is refreshed.
Another exaple is that Power Sink which had a dedicated method and checked its own parameter each time an ability resolved. Why should a single spell have a special routine? No way! Get into script files now! - By the way, did you see my second version of Power sink implementation? I miss your reply in 'Card development questions' thread.
That is about the need for rewrite - hope I've proven that theese are really needed.

Look, I want multiplayer here, for constructed duels at least. In that case Gui is client, AI is client too. They must be kept aside from direct game state changes. So I am trying to isolate them, as skillfully as I can.


I've never seen that discussion, so there might be some reasons behind it... at least to have different buttons of 'OK' and 'Auto'. Meet r19517.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Revision 19514

Postby friarsol » 12 Feb 2013, 01:40

I just played with the VAssignDamage panel some more, here are a few more thoguhts.

I'm able to remove damage from the first blocker below Lethal Damage, which should never be the case. The base damage assignment should always be Max Damage to the first blocker, and 0 to all the rest.

The damage assignment order isn't as strictly followed as before. Obviously, you can't assign to blockers if lethal hasn't been assigned to ones earlier in the assignment order. But previously, the extra restrictions would only let you assign damage to one creature at a time in strict assignment order. You couldn't be in the middle of assigning damage to the third creature, then jump back and assign more damage to the first.

Personally, I'd rather be more strict and only allow assigning to one creature at a time in their assignment order and disallowing assignment once you've moved on. But if there's more preference for the current functionality as opposed to the previous way, then I'm fine with the group decision.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Revision 19514

Postby timmermac » 12 Feb 2013, 01:46

friarsol wrote:I just played with the VAssignDamage panel some more, here are a few more thoguhts.

I'm able to remove damage from the first blocker below Lethal Damage, which should never be the case. The base damage assignment should always be Max Damage to the first blocker, and 0 to all the rest.

The damage assignment order isn't as strictly followed as before. Obviously, you can't assign to blockers if lethal hasn't been assigned to ones earlier in the assignment order. But previously, the extra restrictions would only let you assign damage to one creature at a time in strict assignment order. You couldn't be in the middle of assigning damage to the third creature, then jump back and assign more damage to the first.

Personally, I'd rather be more strict and only allow assigning to one creature at a time in their assignment order and disallowing assignment once you've moved on. But if there's more preference for the current functionality as opposed to the previous way, then I'm fine with the group decision.
My question would be: How do the official rules say damage assignment is supposed to be done? That's how the program should be doing it.
"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: Revision 19514

Postby friarsol » 12 Feb 2013, 01:52

timmermac wrote:My question would be: How do the official rules say damage assignment is supposed to be done? That's how the program should be doing it.
Not particularly:

Code: Select all
510.1c ... If two or more creatures are blocking it, it assigns its combat damage to those creatures according to the damage assignment order announced for it. This may allow the blocked creature to divide its combat damage. However, it can't assign combat damage to a creature that's blocking it unless, when combat damage assignments are complete, each creature that precedes that blocking creature in its order is assigned lethal damage. When checking for assigned lethal damage, take into account damage already marked on the creature and damage from other creatures that's being assigned during the same combat damage step, but not any abilities or effects that might change the amount of damage that's actually dealt. An amount of damage that's greater than a creature's lethal damage may be assigned to it.
Duels of the Planeswalker uses a strict method similar to the one that the VAssignDamage was doing (actually, it was a bit more strict, but basically the same.) I can't speak for how MTGO does it.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Revision 19514

Postby Max mtg » 12 Feb 2013, 02:17

See examples under 510.1c
Example: The damage assignment order of an attacking Vastwood Gorger (a 5/6 creature) is Pride Guardian (a 0/3 creature) then Llanowar Elves (a 1/1 creature). Vastwood Gorger can assign 3 damage to the Guardian and 2 damage to the Elves, 4 damage to the Guardian and 1 damage to the Elves, or 5 damage to the Guardian.
The "strict" order you wrote about would not allow the last two options.

friarsol wrote:Previously, the extra restrictions would only let you assign damage to one creature at a time in strict assignment order. You couldn't be in the middle of assigning damage to the third creature, then jump back and assign more damage to the first.

This is not forbidden by rules.

friarsol wrote:I'm able to remove damage from the first blocker below Lethal Damage, which should never be the case.
You may do so, but the "OK" button will be disabled until you distibute damage correclty

friarsol wrote:The base damage assignment should always be Max Damage to the first blocker, and 0 to all the rest.
Why's that?
Last edited by Max mtg on 12 Feb 2013, 02:21, edited 1 time in total.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Revision 19514

Postby friarsol » 12 Feb 2013, 02:20

Max mtg wrote:See examples under 510.1c
Example: The damage assignment order of an attacking Vastwood Gorger (a 5/6 creature) is Pride Guardian (a 0/3 creature) then Llanowar Elves (a 1/1 creature). Vastwood Gorger can assign 3 damage to the Guardian and 2 damage to the Elves, 4 damage to the Guardian and 1 damage to the Elves, or 5 damage to the Guardian.
The "strict" order you wrote about would not allow the last two options.
I'm not sure why you think that. The strict order would (and did) allow those options. Just because you have assigned lethal damage to something, didn't mean you couldn't assign more. You just can't assign less than lethal damage to the first blocker.


You couldn't be in the middle of assigning damage to the third creature, then jump back and assign more damage to the first.

This is not forbidden by rules.[/quote]I don't believe I ever stated that, which is why I was asking which way was preferred from everyone else.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Revision 19514

Postby Max mtg » 12 Feb 2013, 02:23

friarsol wrote:I'm not sure why you think that. The strict order would (and did) allow those options. Just because you have assigned lethal damage to something, didn't mean you couldn't assign more.
You told about jumping from third creature to the 1st one as something undesirable. Looks like that allowed to assign 5 damage and move to next creture. But that's extra restrictions - need coding and add no value to player experience
friarsol wrote:You just can't assign less than lethal damage to the first blocker.
You won't be able to press 'ok' as long as damage is not fully distributed
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Revision 19514

Postby friarsol » 12 Feb 2013, 02:33

Max mtg wrote:
friarsol wrote:I'm not sure why you think that. The strict order would (and did) allow those options. Just because you have assigned lethal damage to something, didn't mean you couldn't assign more.
You told about jumping from third creature to the 1st one as something undesirable.]
Re-read your example:

When assigning to the first blocker you can deal 3, 4, 5 damage. Once you are done assigning to that, you can assign any remaining damage to the 2nd blocker, etc. Did you ever use the old VAssignDamage dialog before you just went and rewrote the whole thing?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Revision 19514

Postby Max mtg » 12 Feb 2013, 02:56

friarsol wrote:
Max mtg wrote:
friarsol wrote:I'm not sure why you think that. The strict order would (and did) allow those options. Just because you have assigned lethal damage to something, didn't mean you couldn't assign more.
You told about jumping from third creature to the 1st one as something undesirable.]
Re-read your example:

When assigning to the first blocker you can deal 3, 4, 5 damage. Once you are done assigning to that, you can assign any remaining damage to the 2nd blocker, etc. Did you ever use the old VAssignDamage dialog before you just went and rewrote the whole thing?
So, was there any advantage of such "strictness"?

If the class code were clear I would not have touched it. I needed a map of damage from that view (defender->amount) , but it didn't provide one. The class included some messy code with separate mouse listeners for blockers and defender, 40-lines long canAsignDamage, so it has deserved a rewrite.
My revision works according to game rules, differently from the old one, yes - allowing more freedom and providing more information. So what else do you want here?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Revision 19514

Postby friarsol » 12 Feb 2013, 02:59

Max mtg wrote:My revision works according to game rules, differently from the old one, yes - allowing more freedom and providing more information. So what else do you want here from me?
The same thing I said in the beginning of this thread. You seem to change/break functionality without actually trying to understand it, or ask around to see why things are the way they are. To me, that's a selfish way of acting in a group such as this.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Revision 19514

Postby Max mtg » 12 Feb 2013, 04:39

friarsol wrote:
Max mtg wrote:My revision works according to game rules, differently from the old one, yes - allowing more freedom and providing more information. So what else do you want here from me?
The same thing I said in the beginning of this thread. You seem to change/break functionality without actually trying to understand it, or ask around to see why things are the way they are. To me, that's a selfish way of acting in a group such as this.
I cannot discuss every change with you for obviuos reasons. This blocking window is definitelly a minor issue, not worth discussing with the team.

It seems to me that you want control over changes (that "ask around" part), or maybe you are offended that I wrote a better implementation than yours, and at this moment you start to find faults in the new version.

As for some real bugs, which may occur, I am always ready to fix them the soonest possible.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Revision 19514

Postby Sloth » 12 Feb 2013, 10:59

Max mtg wrote:... or maybe you are offended that I wrote a better implementation than yours, and at this moment you start to find faults in the new version.
This is just natural. Think about it Max, when someone completely replaces a big chunk of your code, you would check for things that might have gotten worse and complain about them. Wouldn't you?

Max mtg wrote:This blocking window is definitelly a minor issue, not worth discussing with the team.
We had some forum posts, because of people not understanding the damage assignment (mostly because people don't know/understand the current rules made by WotC). So while these aren't super important issues (because the damage window only turns up rarely), they are not so minor.

So i think at least this should be adressed:
friarsol wrote:I'm able to remove damage from the first blocker below Lethal Damage, which should never be the case. The base damage assignment should always be Max Damage to the first blocker, and 0 to all the rest.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Revision 19514

Postby Max mtg » 12 Feb 2013, 11:44

Yes, once doublestrike has replaced my fine deck editor with that new-styled editor - that was awful.
I am glad myk is working on editors now - he might add the features doublestrike has dropped.

Ok, the 19552 forbids player to remove damage from 1st blocker below lethal, and that base damage assignment was commited a few hours ago.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Revision 19514

Postby friarsol » 12 Feb 2013, 13:03

Thanks for mediating Sloth. That was the point I was trying to make. I could care less that the code was refactored (hell most of it wasn't mine to begin with), but I did rewrite the functionality to make it compatible with the M10 damage assignment rules which I've had to do twice now (since Doublestrike decided to rewrite it after I fixed all the functionality the first time around and I asked him to pretty up the dialog).
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 49 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 49 users online :: 0 registered, 0 hidden and 49 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 49 guests

Login Form