It is currently 11 Sep 2025, 17:38
   
Text Size

Big commit, no dice / SVN hugely broken on r10194

Post MTG Forge Related Programming Questions Here

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

Big commit, no dice / SVN hugely broken on r10194

Postby Doublestrike » 03 Sep 2011, 10:08

I just made a big commit that's likely to cause a bug or two. However, I felt this was justified since I just did a crapload of work. :) It should be work of good quality too :wink:

So, apologies ahead of time, but I think you'll like the results. Among other things:

- quest battles and quest quests can be created from files only.

- model and view separated for quest mode main panel

- computer can now use tokens in quests

- a few restructuring changes

There are a few bugs I couldn't figure out immediately, probably from my changes but maybe not (could have just arisen during testing). Here are the ones I know about:

- Poison counters sometimes double up during quests. Not sure why this is happening.

- Booster pack bonus card generator in Quest/Data/DeckSingleQuest > GenerateCardList is not working, generator only is broken, everything else in method is fine.

==========EDIT

OK, probably should just revert to r10193. I just did about 15 hours of work but significant changes while I was gone have invalidated a bunch of it. Disregard all of my previous excitement, now I feel like hitting somebody. Have to start over, I guess. Should check commits more often, is the lesson here.

Anyway if someone wants to have a look, I was feeling like there was some great progress being made. Seriously, it was really good, the quest decks could handle everything - tokens, AI cards, human cards, booster updates...

Code: Select all
List<String> fourletterwords;
Last edited by Doublestrike on 03 Sep 2011, 10:40, edited 3 times in total.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Commits with errors?

Postby Max mtg » 03 Sep 2011, 10:35

Which exactly previous commit do you mean? The mine which renamed deck editors or moved quest-related stuff into QuestUtilCards?

No, broken commits are not welcome. Before commiting his part of code developer should svn up and check that everything is working.
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: Big commit, no dice

Postby Doublestrike » 03 Sep 2011, 10:39

@Max - edited my previous post.

Yeah, the problem is, I updated and it broke pretty much everything I had worked on since the deck handling has all changed.

So, how should I proceed? I need a non-broken SVN copy to update all my stuff, and I'm not sure how to make an older update act as the most recent.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Big commit, no dice

Postby Max mtg » 03 Sep 2011, 10:45

Doublestrike wrote:@Max - edited my previous post.

Yeah, the problem is, I updated and it broke pretty much everything I had worked on since the deck handling had all changed.
Well, I'm sorry... The deckeditors' change was announced some time ago. These are some 7 days of work. Switching to lightweight cards was a necesary means to improve deckeditor's performance and make them more flexible. Since they deal that much with decks, they were swithced to CardPrinted too to support adding foiled and same cards from different sets or with different art.

Your efforts are very significant, I hope you'll make it to the end, cause quest data really should be data, not hardcoded challenges and rewards

It appears that some files from your commit are missing, cause the 6 remaining errors - I have no idea on how they can be fixed
Description Resource Path Location Type
The method getHumanExtraCards(QuestData, DeckSingleQuest) is undefined for the type QuestUtil QuestMainPanel.java /Forge-devel/src/main/java/forge/quest/gui line 720 Java Problem
The method getHumanExtraCards(QuestData) is undefined for the type QuestUtil QuestMainPanel.java /Forge-devel/src/main/java/forge/quest/gui line 697 Java Problem
The method getQuestAssignment() is undefined for the type AllZone GameAction.java /Forge-devel/src/main/java/forge line 618 Java Problem
The method getQuestAssignment() is undefined for the type AllZone GameAction.java /Forge-devel/src/main/java/forge line 1013 Java Problem
The method setQuestAssignment(null) is undefined for the type AllZone Gui_WinLose.java /Forge-devel/src/main/java/forge line 353 Java Problem
The method setQuestAssignment(Quest_Assignment) is undefined for the type AllZone QuestMainPanel.java /Forge-devel/src/main/java/forge/quest/gui/main line 703 Java Problem
Last edited by Max mtg on 03 Sep 2011, 10:50, 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: Commits with errors?

Postby Doublestrike » 03 Sep 2011, 10:47

Max mtg wrote:renamed deck editors

I was working on the dck files. Wasn't expecting a big changes to Deck.java and DeckManager.java, especially since I was working very hard to use existing resources instead of changing everything to suit my purpose.

Not sure what CardPool is, but I'll figure it out.

Max mtg wrote:moved quest-related stuff into QuestUtilCards
In my broken code, quest-related stuff is all handled in its specific dck file. It's a beautiful thing.
Last edited by Doublestrike on 03 Sep 2011, 10:52, edited 3 times in total.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Big commit, no dice

Postby Doublestrike » 03 Sep 2011, 10:49

Max mtg wrote:The deckeditors' change was announced some time ago. These are some 7 days of work...
No worries mate, thanks for that. I guess I'm mostly just frustrated since I failed to update the SVN as I was pounding along. The error is mine.

So, I'll be fixing stuff slowly - I really blasted a lot of work into 2 days for the last effort, and I'm a little fried.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Commits with errors?

Postby Max mtg » 03 Sep 2011, 10:55

Doublestrike wrote:Not sure what CardPool is, but I'll figure it out.

In my broken code, quest-related stuff is all handled in its specific dck file.
CardPool is a map of CardPrinted -> Quantity. It replaces list of strings that were used to store cards.

CardPrinted is a light out-of-battle presentation for Card. They are created from list of cards in cardfolder. No tokes or fictional cards (like citizen) are allowed among them.

Once you speak about quest assignments I don't think storing them in decks is a good idea.
As long as there is metadata - it's ok, but once it includes quest rewards and extra cards, it's a different entity.

10196 - I've commited a few fixes to the files you added by now, though they don't handle all the errors
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: Commits with errors?

Postby Doublestrike » 03 Sep 2011, 11:02

Max mtg wrote:but once it includes quest rewards and extra cards, it's a different entity.
Could you explain your reasoning? I'm pretty much doing that because the bug report said that needed to be fixed.

It actually works really well - have a look at the attached file, everything is encapsulated in there very neatly. New quests can be written, old quests can be edited, quickly and easily.

Max mtg wrote:10196 - I've commited a few fixes to the files you added by now, though they don't handle all the errors
OK thanks, I'll have a look and crack down on the broken stuff.
Attachments
quest8.rar
(585 Bytes) Downloaded 299 times
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Commits with errors?

Postby Sloth » 03 Sep 2011, 11:21

Doublestrike wrote:
Max mtg wrote:but once it includes quest rewards and extra cards, it's a different entity.
Could you explain your reasoning? I'm pretty much doing that because the bug report said that needed to be fixed.
Of course do the rewards belong in the dck files. People who want to contribute to the project can now write a single file, test it and upload it.

Thank you for your work Doublestrike. I'm sure we can sort this out. :D
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Big commit, no dice / SVN hugely broken on r10194

Postby Doublestrike » 03 Sep 2011, 11:25

@Sloth - Thanks for the encouragement. I think part of my panic is just that I've been too long at the keyboard. Got that "ohmygodohmygodohmygod" feeling that's common to programmers.

Anyway fixing now.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Commits with errors?

Postby Max mtg » 03 Sep 2011, 11:29

Doublestrike wrote:
Max mtg wrote:but once it includes quest rewards and extra cards, it's a different entity.
Could you explain your reasoning? I'm pretty much doing that because the bug report said that needed to be fixed.

It actually works really well - have a look at the attached file, everything is encapsulated in there very neatly. New quests can be written, old quests can be edited, quickly and easily.
Look, what is a deck? Deck is a set of cards, some of them are main deck and all others are sideboard. A deck can be picked for a match against other player, be it computer or human (I mean AI can pick that deck and play against you). Deck can be opened and edited in a deck editor, exported to some other site or program... and it's functionality won't change because of that. It's still a set of cards for one player to start game with.

The quest assignments that you are pushing into a dck file include not only a deck, but some extra stuff: starting conditions for players, custom cards that are don't exist in original MTG game, quest rewards. This is not a deck player can start game with.

These fields
Code: Select all
Repeatable=false
NumberWinsRequired=28
CardReward=3 random rares
CreditsReward=200
Icon=A Wolf in Sheeps Clothing.jpg
AILife=25
Deck Type=constructed
have no sense for a regular deck, and it's not constructed anymore.

Well, it can be encapsulated and may look pretty, but that is no longer a deck and should be stored in another file format, at least stop calling this a "deck". Do you agree?
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: Commits with errors?

Postby Doublestrike » 03 Sep 2011, 11:34

Max mtg wrote:Well, it can be encapsulated and may look pretty, but that is no longer a deck. Do you agree?
I see your reasoning, but honestly I'm not in any position to make design decisions regarding this project.

Also, this problem would go away if the encapsulation wasn't a requirement.

Like I said, I'm just doing what the bug said. If it doesn't need to be done, that's fine, I'll call it resolved and come away a lot more knowledgeable about the codebase. If it does need to be done, I've done it, but my work doesn't jive with the latest changes.

So, I guess the powers that be need to step in...or something. In the meantime, I'll keep fixing.

== EDIT ==
If it matters, my gut says hardcoding is inflexible and generally to be avoided. Maybe there's an alternate solution?

== EDIT 2 ==
Max mtg wrote:have no sense for a regular deck, and it's not constructed anymore.
I haven't been here for long and I'm not sure of what a "constructed" deck means to people. My approach to this was, that a battle or a quest deck has certain attributes (properties? meta?) required to use it. Certain deck instances, will have different properties, whether they're constructed, draft, battle, quest, etc. I was under the impression that those properties should be included with the deck data.
Last edited by Doublestrike on 03 Sep 2011, 11:47, edited 1 time in total.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Commits with errors?

Postby Max mtg » 03 Sep 2011, 11:44

Doublestrike wrote:I see your reasoning, but honestly I'm not in any position to make design decisions regarding this project.

Also, this problem would go away if the encapsulation wasn't a requirement.

Like I said, I'm just doing what the bug said. If it doesn't need to be done, that's fine, I'll call it resolved and come away a lot more knowledgeable about the codebase. If it does need to be done, I've done it, but my work doesn't jive with the latest changes.

So, I guess the powers that be need to step in...or something. In the meantime, I'll keep fixing.

== EDIT ==
If it matters, my gut says hardcoding is inflexible and generally to be avoided. Maybe there's an alternate solution?
I totally agree about the bads of hardcoding. That bug needs to be done still. On the other hand I'm opting against throwing everything into one pile, so this encapsulation - if it were not a requirement, how would you store the data?
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: Big commit, no dice / SVN hugely broken on r10194

Postby Chris H. » 03 Sep 2011, 11:49

This quest mode specific metadata should only be used by the AI. And these quest mode AI decks all follow the naming convention of:

Code: Select all
"quest" + number
`
Granted, the Deck Type is no longer a "constructed" type of deck. It might be nice to play test these decks in constructed mode while these special fantasy quest opponent decks are being created/tested/modified.

I think that it is a good idea to move the quest mode specific metadata from being hard coded into the dck file itself.

We may want to consider changing the Deck Type? I'm not sure of the various ramifications but I guess that we should think about it.
User avatar
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: Big commit, no dice / SVN hugely broken on r10194

Postby Max mtg » 03 Sep 2011, 11:50

r10197
Doublestrike -- 2 файл(ов) изменено
Frantic changes to Deck and DeckManager to fix errors in r10194
x /trunk/src/main/java/forge/deck/Deck.java
x /trunk/src/main/java/forge/deck/DeckManager.java
Doublestrike, you've just deleted decks and deckmanager. How are any people on the project supposed to continue developing?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 37 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form